Combined condition - Event Management
Create a combined condition to evaluate several condition types simultaneously in the monitor rule. All condition types can be combined using the logical operators AND and OR.
The evaluation result of a combined condition is based on the evaluation results of the sub-conditions. Parentheses are used to specify the order of evaluation.
This table shows the syntax of a combined condition:
Syntax | [Condition1] AND | OR [Condition2]
Note: You can have more than two sub conditions in one combined condition. For example:
[Condition1] AND [Condition2] AND [Condition3] |
---|---|
Condition1 | A monitor condition already defined in the list of conditions. |
Condition2 | A monitor condition already defined in the list of conditions. |
Evaluation if AND is used | Evaluates to True if all conditions are True. |
Evaluation if OR is used | Evaluates to True if at least one of the conditions is True. |
This table shows the syntax that you can use to nest combined conditions:
Syntax | [Condition1] AND | OR ([Combined Condition]) |
---|---|
Condition1 | A monitor condition already defined in the list of conditions. |
Combined Condition | A monitor combined condition, already built using AND or OR, based on the list of conditions. Combined conditions that are reused are surrounded by round parenthesis. |
Evaluation | The comparison conditions are evaluated first. Then the combined conditions marked by parenthesis are evaluated. The evaluation result is True or False. |
Example 1
You want to generate an alert if a sales order is shipped, and the shipment is late or it was partially shipped. You define a monitor that evaluates the SalesOrder and Shipment documents.
The SalesOrder and Shipment documents are related. In the monitor definition, you must select a reference between these Application Documents.
See References.
This table shows the conditions you create:
Name | Type | Condition | Description |
---|---|---|---|
SalesOrderShipped | Attribute-Value Comparison | SOStatus = Shipped | Checks whether a sales order is shipped. |
PartialShipment | Attribute Comparison | ShippedQuantity < OrderedQuantity | Checks whether only a part of the ordered items were shipped. |
DelayedShipment | Attribute Comparison | PromisedShipDateTime < ActualShipdateTime | Checks whether the shipment was late. |
PartialOrDelayedShipment | Combined Condition | SalesOrderShipped AND (PartialShipment OR DelayedShipment) | Checks whether a partial or delayed shipment took place. |
You define a monitor rule of type Condition Only. In this rule, you select the PartialOrDelayedShipment combined condition. When a sales order with status shipped is intercepted, the monitor starts waiting until it receives the corresponding shipment document. When the sales order and shipment documents are both available, the monitor compares the attributes from the defined conditions. If the combined condition evaluates to true, an Alert is sent.
Example 2
You want to generate an alert if a partial shipment takes place for items in the sales order. You define a monitor that evaluates the SalesOrder and Shipment documents.
The SalesOrder and Shipment documents are related. In the monitor definition, you must select a reference between these Application Documents.
See References.
This table shows the conditions you create:
Name | Type | Condition | Description |
---|---|---|---|
SameLine | Attribute Comparison | ShipmentRefLineNr = SOLineNr | Ensures data is read from the shipment that belongs to the order line. |
SameItem | Attribute Comparison | ShipmentItemID = SOLineItemID | Ensures shipment data is read for the item used in the order line. |
ShipmentOccurs | Attribute-Value Comparison | ShipmentStatus = Shipped | Checks whether items were shipped. |
LessQuantity | Attribute Comparison | ShippedQuantity < SOLineQuantity | Checks whether only a part of the ordered items were shipped. |
PartialShipment | Combined | ShipmentOccurs AND SameLine AND SameItem AND LessQuantity | Checks whether a partial shipment took place. |
You define a monitor rule of type Condition Only. In this rule, you select the PartialShipment combined condition. When a sales order with status shipped is intercepted, the monitor starts waiting until it receives the corresponding shipment document. When the sales order and shipment documents are both available, the monitor compares the attributes from the defined conditions. If the combined condition evaluates to true, an Alert is sent.
For more information, see Defining combined conditions.