Outcome Computations Authoring
The core of the outcome computations view is its data mapping capability. When there are matches in the pattern, the system evaluates the data mappings designed for the outcome to create the output data. Outputs can be monitored and picked up by other tools (such as Cogynt Workstation) to:
- Provide human-in-the-loop interaction.
- Generate automatic notifications.
- Feed into other event patterns for next-level pattern detection (in cases of transitory output).
Adding Computation Elements to Diagrams
At its simplest, data mapping is a value transfer from an element field to an outcome field. However, in situations of greater complexity, it may be necessary to compute an outcome field value based on computations or a chain of computations from values of various element fields. The outcome computations view provides a variety of computation elements for this purpose, including:
- Constants
- Arithmetic Operators
- Boolean Operators
- Comparison Operators
- Functions
These elements, along with basic elements and favorite functions, can be added using the tool palette or the right-click selection menu. The corresponding topics in this section explain how to add each element.
Adding Constants
The Constants tool grants access to constants of different primitive data types, including:
- Boolean – A true or false value.
- Date/Time – A datatype that represents a date and time together as a single data unit.
- Float – A floating point number (decimal value or fractional number).
- Integer – A whole number, such as 25 or -25.
- IP - A unique address that identifies a device on the internet or a local network.
- Null – An empty value. Its datatype conforms to whatever datatype the function is interacting with.
- String – A sequence of (often alphabetical) characters.
- Unique ID – An alphanumeric string for labeling information in a computer system.
- URL – An address for a unique resource on the Internet.
To add a constant:
- In the tool palette, click the Constants tool.
- From the context menu, select the intended data type for the constant.
- Click any open space in the diagramming area to place the constant.
- In the details panel, set the constant's value.
For Date/Time constants, click the calendar icon to bring up date/time control.
Adding Arithmetic Operators
The Arithmetic Operators tool grants access to common arithmetic operators, including:
- Add (+)
- Subtract (-)
- Multiply (x)
- Divide (÷)
- Modulus (%)
To add an arithmetic operator:
- In the tool palette, click the Arithmetic Operators tool.
- From the context menu, select the intended operator.
- Click any open space in the diagramming area to place the arithmetic operator.
Adding Boolean Operators
The Boolean Operators tool gives access to logical conjunctions or disjunctions, including:
- AND
- OR
- NOT
To add a Boolean operator:
- In the tool palette, click the Boolean Operators tool.
- From the context menu, select the intended operator.
- Click any open space in the diagramming area to place the Boolean operator.
Adding Comparison Operators
The Comparison Operators tool grants access to standard comparison operators, including:
- Equal (=)
- Greater Than (>)
- Greater Than or Equal To (≥)
- Less Than (<)
- Less Than or Equal To (≤)
- Not Equal (≠)
- Is Null (∅)
To add a comparison operator:
- In the tool palette, click the Comparison Operators tool.
- From the context menu, select the intended operator.
- Click any open space in the diagramming area to place the comparison operator.
Adding Functions
The Functions tool grants access to a list of built-in functions that can be used in conjunction with other operators.
For a full list of supported functions and their descriptions, see Built-In Computation Functions.
To add a function:
- In the tool palette, click the Functions tool.
- From the context menu, select the intended function. Filter the list using the search box as needed.
- Click any open space in the diagramming area to place the function.
Favoriting Functions
If certain functions are frequently used, they can be designated as favorites, and can be accessed using the Favorite Functions tool for greater convenience.
To designate a function as a favorite:
- In the tool palette, click the Functions tool.
- In the context menu, select the function to designate as a favorite. Filter the list using the search box as needed.
- Click the heart icon. The icon changes to a highlighted heart to indicate that the function is now a favorite.
Unfavoriting Functions
Favorite functions can have their favorite designations removed as needed, which also removes them from the Favorite Functions tool.
To remove a favorite function's designation:
- In the tool palette, click the Functions tool.
- In the context menu, select the function to unfavorite. Filter the list using the search box as needed.
- Click the heart icon. The icon changes to a non-highlighted heart to indicate that the function is no longer a favorite.
Duplicating Computation Elements
Copies of computation elements can be made as needed.
To duplicate a computation element:
- In the diagramming area, click the computation element to copy.
- Click the Clone button and drag the cursor to an open space in the diagramming area.
- Release the mouse button. The duplicate computation element is created at the cursor’s location.
Deleting Computation Elements
Existing computation elements can be deleted as necessary.
To delete a computation element:
- In the diagramming area, click a computation element to delete.
- Click Delete (X).
Hiding and Showing Fields
The field list for elements or outcomes can be hidden from view to reduce onscreen clutter, or returned to view as needed.
To hide or show the fields of an element or outcome:
- In the diagramming area, click the appropriate element or outcome.
- Click Collapse to hide the field list.
- Click Expand to reveal the hidden field list.
Drawing Connections
All computation elements require their input and output parameters to be connected to either:
- Element or outcome fields.
- Other computation elements.
If this condition is not met, Cogynt Authoring draws a red border around it to flag it as a consistency error.
- Elements can only have output connections from their fields.
- Outcomes can only have input connections to their fields.
When drawing a connection, you must always start with a source that is either:
- A field of an element.
- The output parameter of a computation element.
The authoring environment highlights all possible targets in the diagram where you may connect the line.
Drawing from Element Fields
To draw a connection from a field of an element:
- In the diagramming area, click the appropriate element.
- Click and hold the mouse button over the cell containing the appropriate field name. (Note: When a field can be clicked and held, the cursor turns into a crosshair (+).)
- In the diagramming area, look for a highlighted target (either a computation element's input or an outcome field name).
- Drag the cursor to the desired target.
- When the target's border is highlighted, release the mouse button.
As a form of data type validation, a target is highlighted if the target field data type is consistent with the data type of the output field of the element or computation element.
Drawing from Computation Element Outputs
To draw a connection from the output of computation elements:
- In the diagramming area, click the appropriate computation element.
- Click and hold the cell containing the computation element's output. (Note: It is typically labelled "Result." When the output can be clicked and held, the cursor turns into a crosshair (+).)
- In the diagramming area, look for a highlighted target (either a computation element's input or an outcome field name).
- Drag the cursor to the desired target.
- When the target's border is highlighted, release the mouse button.
Changing Link Types
There are two types of line connections (or links) in an output computations diagram:
- Set-of-values link – A link whose source is treated as a set of input values. Only an element field can be the source for this link type. All built-in aggregation functions expect links of this type connected to them because their input parameters require sets. In the diagram, this type of link is represented by a teal double-arrow.
- Single-value link – A link whose source is treated as a single input value. The source can be either an element field or a computation element’s output. In the diagram, this type of link is represented by a grey arrow.
By default, drawing a connection from an element field to a computation element that is not an aggregated function produces a single-value link. To change it to a set-of-values link:
- In the diagramming area, hover the cursor over a link originating from an element field. (Note: It should connect to a computation element, not an outcome.)
- Click the Set icon to toggle the link type. Alternatively, right-click the link and select "As-Set On" or "As-Set Off" as needed.
A link connected to an aggregated function is not editable.
Removing Connections
Right-click an existing connection to delete it.