Adapter - Condition Evaluator
This page describes version 2.0.13 of the adapter.
Overview
The Condition Evaluator Adapter allows you to fire an event (Condition met event) whenever a specified number of Condition Instances match. A Condition Instance contains an ID and five properties. For two instances to match all five properties, need to match. Any one or all properties may be empty.
For example the following two instances match:
InstanceID: "I1", p1: Empty, p2: "B", p3: "C", p4:"D", p5: Empty
InstanceID: "I2", p1: Empty, p2: "B", p3: "C", p4:"D", p5: Empty
while the following two instances do not match:
InstanceID: "I3", p1: Empty, p2: "B", p3: "C", p4:"D", p5: Empty
InstanceID: "I4", p1: Empty, p2: Empty, p3: "B", p4:"C", p5:"D"
For a condition to trigger the Condition Met event, a minimum number of instances (Number of Condition Matches) with unique instance IDs need to match. To set a Condition Instance, you use the SetCondition command, specifying the Condition Name, Instance ID and the properties. Please note that calling SetCondition multiple times with the same Instance ID for the same Condition Name will not add multiple Instances with the same ID but rather will overwrite the properties of the already existing Instance having that ID. Also, be aware that Condition Instances have a limited lifespan, configured in the Expiration Time adapter property. When a Condition Instance’s lifespan reaches the Expiration Time, it will be discarded and will no longer be subject to condition matching.
Properties
Name | Display | Is Required | Comments | Type | Default Value | Maximum Value | Minimum Value | Maximum Length | Minimum Length |
---|---|---|---|---|---|---|---|---|---|
expirationtime | Expiration Time | True | Time in seconds after which a evaluated condition expires. After the time expires the condition will need to be reevaluated. | integer | 10 | 65535 | 1 | ||
conditionsmatchcount | Number of Condition Matches | True | Minimum number of conditions that need to match before the evaluator sends a Condition Met event | integer | 5 | 5 | 1 |
Commands
Set Condition (setcondition)
Sets a condition to be handled by the Evaluator
Request Properties
Name | Display | Description | Is Required | Type |
---|---|---|---|---|
conditionname | Condition Name | The name assigned to this condition | True | string |
conditioninstance | Condition Instance | Condition Instance identifier | True | string |
property1 | Property 1 | 1st property of the condition | False | string |
property2 | Property 2 | 2nd property of the condition | False | string |
property3 | Property 3 | 3rd property of the condition | False | string |
property4 | Property 4 | 4th property of the condition | False | string |
property5 | Property 5 | 5th property of the condition | False | string |
Response Properties
Name | Description | Type |
---|---|---|
conditionmet | true if the condition was met and the event sent. false if the condition was not met. | string |
Clear Condition (clearcondition)
Clears a condition to be handled by the Evaluator
Request Properties
Name | Display | Description | Is Required | Type |
---|---|---|---|---|
conditionname | Condition Name | The name assigned to this condition | True | string |
property1 | Property 1 | 1st property of the condition | False | string |
property2 | Property 2 | 2nd property of the condition | False | string |
property3 | Property 3 | 3rd property of the condition | False | string |
property4 | Property 4 | 4th property of the condition | False | string |
property5 | Property 5 | 5th property of the condition | False | string |
Response Properties
Name | Description | Type |
---|---|---|
cleared | true if the condition was cleared. false if the condition was not found. | string |
Events
Condition met event (conditionmet)
An event that occurs when the specified number of conditions are met
Event Properties
Name | Display | Description | Type |
---|---|---|---|
conditionname | Condition Name | The name assigned to this condition | string |
property1 | Property 1 | 1st property of the condition | string |
property2 | Property 2 | 2nd property of the condition | string |
property3 | Property 3 | 3rd property of the condition | string |
property4 | Property 4 | 4th property of the condition | string |
property5 | Property 5 | 5th property of the condition | string |
Release History
Version | Type | Description | Tracking # | Date |
---|---|---|---|---|
2.0.1 | Initial | First release in the Adapter Type store. | ||
2.0.9 | Maintenance | Updated third-party components and improved maintainability. | NAP-11518 | |
2.0.10 | Feature | Added 'Clear Condition' command | NAP-22104 | |
2.0.11 | Maintenance | Updated third-party components and improved maintainability. | NAP-23945 | 2022-11-29 |
2.0.12 | Maintenance | Updated third-party components and improved maintainability. | NAP-27635 | 2024-07-31 |
2.0.13 | Maintenance | Updated third-party components and improved maintainability. | NAP-27635 | 2024-12-18 |