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).


images/download/attachments/201665163/image-2025-3-26_14-34-16-version-1-modificationdate-1742996055127-api-v2.png

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:

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

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg one or more
'flag types' selected

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg selected
(true)

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

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg one or more
'flag types' selected

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg selected
(false)

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

images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg no selection

irrelevant
images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/check.svg / images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/error.svg

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.

images/download/attachments/201665163/image-2025-3-26_14-34-48-version-1-modificationdate-1742996088023-api-v2.png

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:

  • 'selected': Flag value = true

  • 'deselected': Flag value = false
    OR flag attribute not present

images/download/attachments/201665163/image-2025-3-26_14-35-27-version-1-modificationdate-1742996127049-api-v2.png

images/download/attachments/201665163/image-2025-3-26_14-35-41-version-1-modificationdate-1742996140922-api-v2.png

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:

  • The Check type ensures that the reference object is a shipment.

  • The subsequent Flag attribute rule specifies in the Flag type parameter which flag attributes of the shipment are checked.

  • The option Flag value is set because it is checked whether at least one of the flags selected by Flag type is 'set' for the shipment. Then the corresponding flag attribute contains the value true in the 'Flag value' (flagValue) field.

Within an overview for 'Shipments', the selection for the screenshot illustrates to which shipments the association criterion applies:

images/download/attachments/201665163/image-2025-3-26_14-31-22-version-1-modificationdate-1742995881790-api-v2.png

images/download/attachments/201665163/image-2025-3-26_14-30-44-version-1-modificationdate-1742995843917-api-v2.png

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:

  • In the input, a Check type ensures that a reference object of the Shipments type is present as an input value.

  • Below this follows an Entity property rule in which a Direct line items value resolver is combined with a Rule list resolver. This combination is used to determine whether a direct line item exists that does not meet the criterion for 'stackability' at the line item level. This criterion must be configured in the Rule list resolver:

    • In the example, the Flag attribute rule is used twice in an AND junction to check for exactly one Flag type to see whether the flag attribute in question is false or not present. The Flag value option is deselected for this purpose.

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:

images/download/attachments/201665163/image-2025-3-26_14-28-30-version-1-modificationdate-1742995709892-api-v2.png

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.

images/download/attachments/201665163/image-2025-3-26_14-29-22-version-1-modificationdate-1742995761578-api-v2.png