Flag attribute rule
Rule type – Abstract
Purpose: Is considered 'passed' if the evaluation of the indicator attributes of the reference object for at least one of the usually selected Flag types meets the criterion defined by the Flag value (selected: true or deselected: false/not present).
The Flag attribute rule is considered 'passed' if the evaluation of the flag attributes of the reference object for at least one specified Flag type meets the criterion defined by Flag value (true/false):
If the Flag value option is selected, then the rule is considered 'passed' if the reference object has at least one flag attribute with the value true whose Flag type is selected in the Flag type parameter.
If the Flag value option is deselected, then the rule is considered 'failed' if the reference object has a flag attribute whose value is true for each Flag type selected in the Flag type parameter.
►IMPORTANT◄ The 'Flag value deselected' configuration defines as a check criterion for each Flag type selected in the Flag type parameter, and that it should be among the attributes of the reference object with the value false or not present. If multiple types are selected under Flag type, then the rule as a whole is considered to have 'passed' if the reference object does not have a flag attribute for at least one selected Flag type or has one with the value false.
Only entities whose type supports the possession of flag attributes can be considered as reference objects. By default, this applies to the following entity types:
All business transaction objects (Allgemeines Geschäftsobjekt, Bestellungen, Manifeste, Shipments and time slot book entries – see Zeitfenstermanagement).
Line items of business transaction objects (exception: manifest line items, which are not considered as 'attribute owners').
►NOTE◄ The use of the Flag attribute rule for reference objects that (may) not support flag attributes should be strongly avoided. The rule does not categorically return 'failed' for all unsuitable entity types. The 'failed' rule applies reliably only to reference objects that are not an entity by type (e.g. a client object), or are an entity but not an attribute owner (e.g. a Role). Especially when checking against the Flag value false , this can lead to unexpected or confusing results, since the rule is categorically considered 'failed' for some types from the attribute owner group, while for other attribute owner types the rule is considered 'passed' because a flag attribute is 'not present'.
For the following explanations, it is assumed that only suitable reference objects are used in order to reduce the complexity of the presentation.
The Flag type parameter is technically optional, but should always be specified to ensure that a meaningful and effective check criterion is obtained (see table).
The option Flag value is only taken into account if at least one flag type is specified (see table).
Flag type |
Flag value |
Effective check criterion of the rule (for a reference object that supports flag attributes) |
Comment |
|
|
The reference object has at least one flag attribute with the value true, whose Flag type is selected in the Flag type parameter? |
typical use |
|
|
The reference object does not have a flag attribute with the value true for each Flag type in the selection for the Flag type parameter. |
typical use |
|
irrelevant |
Always 'passed' (for a suitable reference object) |
limited usefulness |
Configuration
The Flag attribute rule expects a reference object that supports flag attributes (see above).
The optional Flag Type parameter defines a static multiple selection for values from the dynamic enumeration for the Flag type. The selection determines which flag attributes of the reference object criterion should be evaluated depending on the Flag value option defined. |
|
The Flag value option defines the check criterion applied to the reference object for each Flag type specified via the Flag type parameter. The rule is considered to be passed overall if the test criterion for the Flag value applies to at least one Flag type:
|
|
Example
Simple use case
An association criterion should apply to instances of an entity type 'Shipments' that are classified as stackable via the Flag type 'Stackable' or 'Stackable Pallets' in the shipment header.
Configuration:
The Flag attribute rule is configured as shown on the right:
Within an overview for 'Shipments', the selection for the screenshot illustrates to which shipments the association criterion applies:
|
|
More complex use case
An association criterion 'recognizes' whether a shipment is stackable, as in the previous example. However, this time the classification cannot be read directly from flag attributes in the shipment header. Instead, the flag attributes of the 'Stackable' and 'Stackable Pallets' types are evaluated at line item level. The association criterion shall apply in total to classify a shipment as stackable if the shipment does not contain a direct line item (with the Line item type 'Default') that is not explicitly marked as 'Stackable' and/or 'Stackable Pallets'.
►NOTE◄ As long as the shipment does not contain any 'Default' line items, it should also be considered stackable.
Configuration:
The rule for the association criterion can be configured as shown on the right:
►NOTE◄ In connection with the Flag value false, both Flag types cannot simply be used in the same Flag attribute rule, otherwise a shipment line item would already be evaluated as not-stackable if one of the two flags is false or not present. However, the following alternative configuration for the rule in the Rule list resolver would have the same effect, with a single instance of the Flag attribute rule:
The negation (see Not rule) of the Flag attribute rule is crucial, which is marked by the '!' symbol. The AND junction on the right (not 'Stackable' AND not 'Stackable Pallets') is alternatively reformulated as not ('stackable' OR 'Stackable Pallets'). Since an OR junction applies within the Flag attribute rule for the check per Flag type. This results in a more streamlined configuration. |
|