Skip to main content
Version: 2.12.X

Creating the Processing Logic

Once you have finished preparing your data, you can define the logic that Cogynt should use to process it. You can use this functionality to create sophisticated models and data outputs.

For the purposes of this guide, you will configure a simple model whose sole function is to show you your data. The first part of building this model is to add an event pattern node.

Add an Event Pattern Node

The primary unit of logic in a Cogynt model is the event pattern. An event pattern contains pattern detection logic. Users decide what kind of data it should receive, process, and produce for output. For more information about working with event patterns, see System Authoring in the Cogynt Authoring User Guide.

In modeling diagrams, event patterns are represented by event pattern nodes. Models can contain a great many nodes, but this guide's simple model requires only one.

To add an event pattern node to your diagram:

  1. In the tool palette, click the Event Pattern icon.
  2. Click any open space in the diagramming area to place an event pattern node there.

Your model now has a place to store some pattern detection logic. Next, you'll start to configure that logic by creating some event types.

Create Event Types

An event type represents the data processed by an event pattern. It uses a user data schema for its field list. An event type also contains other specifications for the data stream (for example, stream type, stream source, stream filter, and so on).

For this model, you'll create two event types: One to serve as an input (or "source"), and one to serve as an output (or "target"). This guide provides the basic steps. For detailed information about working with event types, see Establishing Event Pattern Data Flow and Creating New Event Types in the Cogynt Authoring User Guide.

Add an Element

An element is a logical entity within an event pattern that represents the input event type. Elements define what parts of the incoming data constitute a match. In other words, elements tell the system what kinds of things to look for in the data. For more information about elements, see Working with Elements in the Cogynt Authoring User Guide.

To add an element:

  1. In the tool palette, click the Element (⬭) icon.
  2. Click the event type to associate with the new element. If a new event type should be created, click New Event Type, then follow the instructions in Creating New Event Types in the Cogynt Authoring User Guide.
  3. Click any open space in the diagramming area to place the element.
  4. In the details panel, edit the element’s properties as needed. For more information, see Editing Elements in the Cogynt Authoring User Guide.

Elements may also be created directly on the canvas as follows:

  1. Right-click any empty space in the canvas.
  2. In the selection menu, click Add Element.
  3. In the dialog, select an event type. If a new event type should be created, click New, then follow the instructions in Creating New Event Types in the Cogynt Authoring User Guide.

Note

Depending on the source of the input data, elements in the event pattern view may have differently shaded colors:

  • If an element is associated with a raw event type, its color is deep blue.
  • If an element is associated with a derived event type (i.e., one that comes from an output of a lower-level event pattern), its color is brighter blue.

Once you have an element in place, you'll need to add an outcome next.

Add an Outcome

An outcome is a logical entity within an event pattern that represents output data. In other words, once the system finds a pattern established in an element, an outcome tells the system what to do after that discovery. For more information about outcomes, see Working with Outcomes in the Cogynt Authoring User Guide.

To create an outcome:

  1. In the tool palette, click the Outcome (▭) icon.
  2. Select the event type to associate with the new outcome. If a new event type should be created for the outcome, follow the process in Creating New Event Types in the Cogynt Authoring User Guide.
  3. Click any open space in the diagramming area to place the outcome.
  4. In the details panel, edit the outcome’s properties as needed. For more information, see Editing Outcomes in the Cogynt Authoring User Guide.

Outcomes may also be created directly on the canvas as follows:

  1. Right-click any empty space in the canvas.
  2. In the selection menu, click Add Outcome.
  3. In the dialog, select an event type. If a new event type should be created, click New, then follow the instructions in Creating New Event Types in the Cogynt Authoring User Guide.

With both an input and output in place, the next step is to set the partitions for the pattern node.

Set Partitions on the Pattern Node

A partition instructs the system to analyze events based on a particular field within a specified event pattern. For more information, see Creating Partitions in the Cogynt Authoring User Guide.

To create a partition for your event pattern:

  1. In the diagramming area, click the event pattern node.
  2. In the details panel, click the Contents tab if it is not already selected.
  3. Under Attributes, click the Partitions section to expand it.
  4. Click +.
  5. In the Create Partition dialog:
    1. From the Elements dropdown menu, select the element containing the field to partition over.
    2. From the Fields dropdown menu, select the field to partition over. (The Fields dropdown menu cannot be opened until a selection has been made from Elements.)
  6. Click Create to create the partition, or click Cancel to discard it.

Once the partitions have been configured, the next task is to set the windowing.

Set Windowing

Output windowing defines an interval of time during which the system listens to incoming data streams, and only publishes the data's updated (i.e., latest) state during that interval. For more information, see Configuring Output Windowing in the Cogynt Authoring User Guide.

Note

The output windowing interval refers to server time (time that has elapsed during the operation of the server), not data time (time specified in the data's timestamps or metadata).

To configure the output windowing for your event pattern:

  1. In the diagramming area, click the event pattern's outcome.
  2. In the details panel, click the Contents tab if it is not already selected.
  3. Click the Output Windowing section to expand it.
  4. From the Type dropdown menu, select the output windowing to use.
  5. In the Time Value field, enter the interval of time that the output window should span.
  6. From the unit dropdown menu to the right of the Time Value field, select the appropriate unit for the time value.
  7. Click outside of the details menu to save the changes.

Once you're satisfied with how your output windowing looks, you can move on to mapping computations.

Map Computations

Cogynt has many built-in computations and functions that make it possible to perform complex calculations or analyses based on inputs from multiple sources. The following computation elements can be added and configured as needed:

For more information about working with computation elements, see Outcome Computations Authoring in the Cogynt Authoring User Guide.

To add a computation element to your model:

  1. In the tool palette, select the category of computation element to add.
  2. From the context menu, select the specific function or type of computation.
  3. Click any open space in the diagramming area to place the computation element.
  4. In the details panel, set any values or enter other details as needed.

Now that all your internal logic has been defined, it's time to prepare it for launch by creating a deployment.

Create a Deployment

A deployment translates a model you've built into code for the Cogynt system to process. This allows other Cogynt applications, such as Workstation, to interpret data in accordance with your model and provide you its findings. For more information about working with deployments, see Creating Deployments in the Cogynt Authoring User Guide.

To add a deployment to your project:

  1. In the Deployment Management window, click the Deployments tab.
  2. Click the Project dropdown menu, then select the appropriate project.
  3. Click the Add New Deployment (+) button.
  4. In the Create Deployment window:
    1. In the Name field, enter a name for the deployment. The name cannot exceed 255 characters in length.
    2. In the Description field, enter a description for the deployment if necessary.
    3. Toggle the Auto create missing Kafka topics switch to "On" to automatically create Kafka topics based upon the fields found in the incoming data stream.
    4. Under Flink Configurations:
      1. Click the Add a configuration (+) button to add a new configuration:
        1. If the desired configuration has already been defined elsewhere, select it from the dropdown list.
        2. If the desired configuration has not been defined:
          1. Select Add Custom Config from the dropdown list.
          2. In the Name field, enter a name for the configuration.
          3. In the Value field, enter the value that the configuration should track.
          4. Click the checkmark (✓) icon to save the configuration, or click X to discard it.
      2. Edit any existing configurations as needed:
        1. In the Name column, verify that the configuration has the appropriate name. Click the information (i) icon to the left of the name to read a description.
        2. In the Value column, verify that the configuration has the appropriate value. Enter a new value in the corresponding field or dropdown menu as needed.
        3. In the Unit column, verify that the configuration has the appropriate unit of measurement. Select a new value from the corresponding dropdown menu as needed.
      3. Delete any unnecessary configurations by clicking the corresponding Delete (trash can) icon.
    5. Click the Log Configurations tab to specify the deployment target's logging configurations, repeating steps 4.iv.a.1-3 as needed.
    6. Under Deployment Target, select the appropriate deployment target from the drop-down menu. The panel displays key details about the selected deployment target for review. For more information, see Viewing Deployment Targets in the Cogynt Authoring User Guide.
    7. Under Deploy Entities, select the event patterns to include in the deployment:
      1. Click the System Nodes tab to see the list of available event patterns, or click the Tags tab to the list of available event patterns grouped by their tags.
      2. Check the corresponding checkbox for each system node or tag to include in the deployment. Checking or unchecking the checkbox in the header does the same for the checkbox of every system node or tag.
    8. Click Create to create the deployment, or click Cancel to discard it.

With your deployment details in place, it's time to pull in your data.