Input Nodes
About Input Nodes in Family Policies
Input nodes represent various items and values that you can use as inputs to the policy logic.
Because Input nodes provide successor nodes with values to evaluate, the first node in a policy model must be an Input node. A Query node, however, cannot be the first node in a policy model.
Input Nodes
Constant Nodes in Family Policies
A Constant node is an Input node that represents a specific value that does not change from one policy execution to another. You can use a Constant node for input values that are used in multiple places in the policy model.
The output of a Constant node is the value that you specify in the Value section of the node's Properties window.
Node Properties
The Properties window for a Constant node contains the items that are described in the following table.
Item |
Description |
Notes |
---|---|---|
Data Type list |
Specifies the type of data that the node represents. |
This property is not required, but it is highly recommended to select a value. This minimizes the chance of the Constant node result either being misinterpreted during the policy execution and the validation, or being displayed in an incorrect format while viewing the execution and the validation results. |
Value box |
Specifies the value that the node represents. |
If the data type for the Constant node is a Data Frame, then, on the Properties window, <DATAFRAME> appears in the Value box. You can select to access the Edit Data Frame window, in which you can view the Data Frame or configure its input values. |
Current Entity and Current Relationship Nodes in Family Policies
Current Entity and Current Relationship nodes are Input nodes that represent the APM entity or relationship family, respectively, that is associated with the family policy. You can use these nodes to access information that is stored in the record whose changes triggered the family policy.
- Any field in the record that triggered the family policy
- The following system fields in the family of the record that triggered the family policy:
- Created By User Key
- Created Date
- Entity Key
- Entity ID
- Family Key
- Last Updated By User Key
- Last Updated Date
- Site Key
- Any field in the record that triggered the family policy
- The following system fields in the family of the record that triggered the family policy:
- Created By User Key
- Created Date
- Entity Key
- Entity ID
- Family Key
- Last Updated By User Key
- Last Updated Date
- Predecessor Family Key
- Predecessor Key
- Relationship Definition Key
- Site Key
- Successor Family Key
- Successor Key
- The Current Entity node is available only for family policies associated with entity families and the Current Relationship node is available only for family policies associated with relationship families.
- There can be only one Current Entity or Current Relationship node in a single family policy.
Node Properties
Other than optionally specifying a name for the node, there are no properties to configure for a Current Entity or Current Relationship node.
Current Entity or Current Relationship nodes are often the starting point in policy models because they provide successor nodes with fields to evaluate. For example, consider an AfterUpdate family policy belonging to the Work History entity family. Using a Current Entity node, you could configure a policy such that, when the policy is triggered by a change in a Work History record, successor nodes evaluate whether or not the value in the Work Order Status field of the corresponding record has changed. If it has, the policy sends an email message to notify users of the change. In addition, the policy updates the related Recommendation record to reflect the new status of the work order.
Current User Nodes in Family Policies
A Current User node is an Input node that represents information associated with the currently logged in APM user (i.e., the user who makes the change that triggers the family policy).
- Any field in the Security user or Human Resource record for the logged in user.
- The following system fields in the Security User record for the logged in user: Entity Key, Family Key, and Entity ID.
Node Properties
Other than optionally specifying a name for the node, there are no properties to configure for a Current User node.
Current User node
The following example illustrates how you can use the Current User node to access the current user's email address, which exists in the Human Resource family, and their User ID, which exists in the Security User family. Consider the following nodes and connections.
In this example, a Current User node named Engineer is connected to an Email Contact node and a Create Recommendation node.
As shown in the following image, you can use the Properties window for the Email Contact node to select the Current User node and the Email Address field in the Human Resource family.
Additionally, as shown in the following image, you can use the Properties window for the Create Recommendation node to select the Current User node and, in this case, the User ID field in a field in the Security User family.
Query Time Series Nodes
A Query Time Series node is an Input node that queries Time Series data for an asset that uses the Predix Time Series service. You can use the Query Time Series node to retrieve readings from the default Time Series data source.
The Query Time Series node, requires you to provide the Tag ID as an input to the node. For example, the Tag ID to query could be retrieved from other records in the APM database using a Query node, or, determined by the policy logic and constructed from other node outputs using a Text node.
A Query Time Series node generates the following outputs:
- Time stamp, which represents the time stamp value for the most recent reading.
- Value, which represents the most recent reading value.
- Quality, which represents the quality of the most recent reading. The quality of the reading is indicated by one of the values described in the following table.
Numeric Value Description 0 Bad Quality 1 Uncertain Quality 2 Not Applicable 3 Good Quality Note: You must use the numeric value when you configure the nodes in the policy to operate on Quality values. However, in a policy output (for example, the text output from an Email Contact node), the description will be displayed. The example in this topic shows how to use the Quality value in a Collection Filter node. - Collection, which represents all readings associated with the Time Series service within the specified time frame and maximum number of readings. Each reading in the collection includes time stamp, value, and quality details.
- Tag, which represents the ID of the Tag.
Node Properties
The Properties window for a Query Time Series node contains the items described in the following table.
Item | Description | Notes | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Time Series Tag | Specifies the ID of the Predix Time Series tag for which data will be retrieved | You can select to specify the output of a predecessor node in this section. | ||||||||||
Start Time | Specifies the beginning of the period within which the readings that you want to retrieve were recorded. | This is not a required field. However, we recommend that you specify an appropriate value in this field to retrieve the most relevant data. | ||||||||||
End Time | Specifies the end of the period within which the readings that you want to retrieve were recorded. | This is not a required field. However, we recommend that you specify an appropriate value in this field to retrieve the most relevant data. | ||||||||||
Max Readings | Specifies the maximum number of readings that you want to retrieve from the Time Series data source. | By default, up to 10000 readings are retrieved from the Time Series data source. However, as needed, you can specify any value up to the maximum number of points supported by the Time Series data source. Note: For best performance, we recommend that you specify the minimum number of readings required for the policy. Note: If you do not specify a value, and 10000 readings are retrieved, the execution history details for the node displays a potential data truncation warning. | ||||||||||
Query Operation | Specifies the type of data you want to retrieve from the Time Series data source. | By default, raw is selected. However, as needed, you can select interpolated, average, or sum to retrieve the required data.
| ||||||||||
Interval (seconds) | Specifies the time interval in seconds. | This is required when query mode is Interpolated or Average; it is an optional field for Sum. This is the time interval in seconds that the query for interpolated or average data is based on. | ||||||||||
Interpolated Mode | Specifies the interpolation mode. | Interpolated mode field is required when query mode is Interpolated. |
Start Time | End Time | Max Readings | Result |
---|---|---|---|
Date 1 | No value | No value | Returns up to 10,000 earliest points starting on Date 1. |
Date 1 | No value | N | Returns up to N earliest points starting on Date 1. |
No value | Date 2 | No value | Returns up to 10,000 latest points ending on Date 2. |
No value | Date 2 | N | Returns up to N latest points ending on Date 2. |
Date 1 | Date 2 | N | Returns up to N points starting on Date 1 and ending on Date 2. |
No value | No value | No value | Returns up to 10,000 latest points ending on the current date. |
No value | No value | N | Returns up to N latest points ending on the current date. |
An example to help understand the use of Query Time Series node is provided in the Policy Designer documentation.
Query Nodes in Family Policies
A Query node is an Input node that represents a query that is stored in the APM Catalog. You can use a Query node to access the results of a specific query. The query will run each time the policy is executed so that the latest results are used in the policy execution. If the specified query contains prompts, you must use the node's Properties window to identify the values that should be provided to the prompts.
A Query node generates the following outputs:
- Result Set, which represents the results of the specified query. This output can be used only with successor nodes that are capable of handling collections.
- Any value in the top row of the specified query.
- A Query node cannot be the first node in a policy model.
- The Result Set is restricted to the 10000 rows of the query results.
Node Properties
The Properties window for a Query node contains the items that are described in the following table.
Item |
Description |
Notes |
---|---|---|
Query Path |
Specifies the path to the query that will run when the policy is executed. |
You can select the switch to field input () button to select an input from another node. You can select the show the constant field input () button to select an output of a predecessor node in this section. Note: When the query path is sourced from a predecessor node, the results collection output from the query node can be used only when you do not need to select a specific column in the collection.
You can enter the path manually, or you can browse to the query by selecting . The query that you choose must have an ID and a caption. |
Query section |
Provides values to any query prompts. |
One Query section appears for each prompt in the selected query. The label that appears after Query: identifies the prompt caption. You can select to specify the output of a predecessor node in this section. |