Skip to main content
Version: 2.18.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 Setting 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. On the project screen, click Deployments.
  2. In the Deployments window, click + New Deployment.
  3. In the New Deployment window, under Step 1: Patterns:
    1. In the Name field, enter a name for the deployment.
    2. In the Description field, enter a description for the deployment if desired.
    3. In the Patterns list, select any patterns that should be included in the deployment. (Note: If a pattern is utilized by another deployment, it will be marked with a rocket symbol.)
  4. Click Create to create the deployment, or Cancel to discard it. Alternatively, click Create and Deploy to deploy the deployment once it is created.
note

The process outlined here is only a partial breakdown of the necessary settings needed to deploy a basic project using Cogynt. For more detailed instructions, please refer to the Authoring user guide article on Creating Deployments

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