Creating rules: rule syntax
Describing rules
Rules are defined through simple tags and attributes on the "Rules" tab in the Template Store.
In the process, each rule definition follows a certain structure. A rule definition always starts with an opening tag and ends with a closing <RULES/> tag. Within this rule definition, any number of rules can be defined, whereby a restriction level, a value determination, and a handling instruction must be defined. Optionally, a precondition can also be defined.
Tags | Brief description | Attributes |
---|---|---|
First level of rule definition | ||
<RULES/> | Top level of rule definition: | None |
Second level of rule definition - selection of a restriction level | ||
<ON_SAVE/> | Highest restriction level: rule violations within this restriction level prevent the saving of the form by the editor. Color scheme for messages from the FirstSpirit framework: berry. | None |
<ON_RELEASE/> | Medium restriction level: rule violations within this restriction level permit the saving of the form by the editor, but a release of the content is not possible. Color scheme: yellow. | None |
<ON_EVENT/> | Lowest restriction level: rule violations within this restriction level permit the saving of the form and the release of the content by the editor. Color scheme: no highlighting of the rule violation. | None |
Third level of rule definition - within a restriction level | ||
<IF/> | Initiates the definition of an (optional) precondition. The definition of a precondition must take place within a restriction level and before the tags for value determination and handling instruction. The following sections of the rule (value determination, handling instruction, validation) are performed only if the precondition is fulfilled. The specification of additional tags is necessary within the precondition. | None |
<WITH/> | Initiates a value determination. The value determination must take place within a restriction level after the definition of an (optional) precondition and before the tags for the handling instruction. The result of the value determination is evaluated in the subsequent sections of the rule (handling instruction and validation). Within the value determination, the specification of additional tags is necessary. | None |
<SCHEDULE/> | Initiates the asynchronous execution of a rule. In the process, the <SCHEDULE/> tag is used to transfer the value determination from JavaClient to a FirstSpirit module. | service: name of the module |
<DO/> | Initiates a handling instruction. The handling instruction must take place within a restriction level and according to the definition of an (optional) precondition and a value determination. The result of the value determination is evaluated in this section. | None |
Fourth level of rule definition - within a handling instruction | ||
<VALIDATION/> | Initiates a validation. The validation must take place within a handling instruction. The validation always refers to a certain property of the form or an input component that is checked within the value determination. The validity of this property is checked during the validation. For this purpose, the specification of a <PROPERTY/> tag with the VALID is necessary. All subsequent handling instructions within the validation section are then executed as long as the conditions defined in the value determination are not fulfilled (e.g. as long as the value determination returns FALSE). | None |
Internal tags for value determination or the output of correction notes: | ||
<MESSAGE/> | Use for the definition of language-dependent notes that are displayed directly below the corresponding input component in the form in case of a rule violation. The rule can be used within the validation. | long: specification of a language abbreviation to be entered in the "Abbreviation" field in the server properties to define for which project language the definitions should apply. Alternatively, an asterisk (*) can be used for fallback values. |
<PROPERTY/> | The tag can be used in all rule definition areas to evaluate the properties of an input component or general information for a form (e.g., is the input component empty?) or to define properties for an input or design component (e.g., input components should be hidden in the form). | source: name of an input or design component or #global (More ...) |
<MATCHES/> | Used to define a regular expression. The regular expression is transferred via the regex parameter. In addition to the regular expression, a comparison value must be specified through an internal <PROPERTY/> tag. The tag can be set within the value determination (or during the definition of a precondition). | regex: specification of the regular expression |
<EQUAL/> | Used for the comparison of values. The tag can be used within the value determination (or during the definition of a precondition). Within the tag, at least two values must be specified for comparison. | None |
<GREATER_THAN/> | Used for the "greater than" check of a numeric value with a comparison value. The tag can be used within the value determination (or during the definition of a precondition). Within the tag, at least two values must be specified for comparison. | None |
<LESS_THAN/> | Used for the "less than" check of a numeric value with a comparison value. The tag can be used within the value determination (or during the definition of a precondition). Within the tag, at least two values must be specified for comparison. | None |
<NOT_NULL/> | Checks whether an input components contains a value (TRUE) or not (FALSE). The tag can be used within the value determination (or during the definition of a precondition). The check always refers to the value of an input component. In addition, the specification of a <PROPERTY/> tag with the VALUE attribute within the tag is necessary. | None |
<IN_GROUP/> | This is used to check to which group the editor belongs. The tag can be used within the value determination (or during the definition of a precondition). | name: name of the group |
<AND/> | Used for the logical AND operation of several conditions within the value determination or during the definition of a precondition. If several conditions are linked using <AND/>, the compound expression is true precisely when all linked expressions are true. | None |
<OR/> | Used for the logical OR operation of several conditions within the value determination or during the definition of a precondition. If several conditions are linked using <AND/>, the compound expression is true precisely when at least one of the linked expressions is true. | None |
<NOT/> | Negation of a condition within the value determination or during the definition of a precondition. | None |
<ADD/> | Used to calculate with values in dynamic formulas. The tag can be used within the value determination, for example, to add whole numbers to an existing value or to add a defined period of time to an existing date. | value: using the attribute, a whole number or time unit can be transferred, separated by a space character. (More ...) |
Internal tags for the transfer of constants | ||
<DATE/> | Serves for indicating a constant date within a check for equality (<EQUAL/>), greater than (<GREATER_THAN/>) or less than (<LESS_THAN/>). | None |
<NUMBER/> | Used to specify a numeric constant within a check for equality(<EQUAL/>), greater than (<GREATER_THAN/>), or less than (<LESS_THAN/>). | None |
<TEXT/> | Serves for specifying textual constant within a check for equality (<EQUAL/>). | None |
Internal tags for the transfer of information to a FirstSpirit module | ||
<CONDITION/> | Initiates the definition of an (optional) precondition for the asynchronous execution of a rule. The definition of a precondition must take place within a <SCHEDULE/> tag and before the tags for the handling instruction. The following sections of the rule (value determination through an external module, handling instruction, validation) are performed only if the precondition is fulfilled. The specification of additional tags is necessary within the precondition. | None |
<PARAM/> | Transfer of parameters to a FirstSpirit module. If the value determination is transferred from JavaClient to a FirstSpirit module, parameters can be sent to the corresponding module within a <SCHEDULE/> tag, for example, the current values from an input component of the form. The specification of additional tags is necessary within a <PARAM/> tag. | name: name of the parameter |