Combined condition
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:
Syntax | [Condition1] AND | OR [Condition2] You can have more than two sub conditions in one combined condition. For example:
|
---|---|
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. |
Combined conditions can be nested using this syntax:
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. Note: In case two or more conditions
are defined that apply to the same element and this is a
repeating element, the conditions are evaluated within a single
instance of that element and the combined evaluation happens for
every repeating element. If the combined condition is
True for one of the repeating
elements, the condition is considered
True.
For example, in a repeating
element, this table shows if a filter is defined in this
way:
then, based on below received document, the filter reports the condition to be True, because:
|
||||||||
Evaluation | The comparison conditions are evaluated first. Then the combined conditions marked by parenthesis are evaluated. The evaluation result is True or False. |
Note that if one of the sub-conditions is of type DateTime
Check
, the evaluation of the combined condition waits for the timer to
expire.
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 Application Documents.
The SalesOrder and Shipment Application Documents are related. In the monitor definition, you must select a reference between these Application Documents. See References.
You create these conditions:
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 occurred. |
Define a monitor rule of type "Condition Only". In this rule, select the
PartialOrDelayedShipment
combined condition. If a sales order
that has the status shipped is intercepted, the monitor waits
until it receives the corresponding shipment document. If 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
To generate an alert if a partial shipment occurs for items in the sales order.
You define a monitor that evaluates the SalesOrder
and Shipment
Application Documents.
The SalesOrde
r and Shipment Application Documents are related.
In the monitor definition, you must select a reference between these Application
Documents. See References.
Create these conditions:
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 occurred. |
Define a monitor rule of type Condition Only. In this rule, you select the PartialShipment combined condition. If a sales order that has the status shipped is intercepted. The monitor waits until it receives the corresponding shipment document. If 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.