Enabled/Visible Conditions are two model classes by which relationships can be linked to element types, actions, properties, tools or dialog input fields. These conditions determine when the execution of an action or tool is permitted or when an input dialog field is editable, grayed out, hidden or when a property is visible in the Eclipse Property view.
When modeling an enabled condition for an Action_Has_Tool relationship, the administrator defines the permitted values for certain properties, so that the action can be executed. By doing this, simple and complex rules can be defined, where complex rules link the simple rules via operators.
Simple enabled condition example:
A complex enabled condition contains any number of simple and complex enabled conditions, and links these via operators.
The visible condition defines whether an action, property or dialog input field is shown in the corresponding view, context menu or dialog. You can specify simple and complex rules for the condition in the same way as for enabled conditions.
The following table shows the relationships which enabled or a visible conditions can be defined:
Relationship | Enabled Condition | Visible Condition |
---|---|---|
Application Options has Application Action | Yes | Yes |
Global Action has Workbench Action | Yes | Yes |
Global Action has Editor Action | Yes | Yes |
Element has GetChildren Action | Yes | No |
Element has Action | Yes | Yes |
Element has Property | No | Yes |
Element List Structure has Action | Yes | Yes |
File Descriptor has Action | Yes | Yes |
Action has Tool | Yes | No |
Tool has Input Parameter | Yes | Yes (modeled dialog) |
Text Decoration has Decoration Value | No | Yes |
If both an Enabled and Visible condition is defined for a relationship the two conditions are evaluated in the following way:
The enabled condition for an element action is defined here. It begins with a complex enabled condition (green dashed framed), which links the two simple enabled conditions (red framed) with the AND operator. AWM interprets this model as follows:
Action ACT_X from ElementType ELE1 can only be executed if the property value of PROP_Protected is false and corresponds to the property value of Property PROP_Group “TEST”. In addition, exactly one Element must be marked.
A simple enabled condition checks a property value for a defined value or status, and activates or deactivates the action depending on the result of the check. If the check is done during the execution of an action, for example, by a Tool Enabled Condition, a property value is first searched for among output parameters of the previous tools of the action and then in the context of the selected element(s).
The meanings of the different operators are shown in the following table:
Operator | Description | Example |
---|---|---|
Equals… | Checks whether the property value of the referenced property has the same value as specified in "Value". | The action can only be executed if the selected element is a COBOL program: |
Equals not… | Checks whether the property value of the referenced property has a value different from the specified "Value". | The action can only be executed if the selected element is not in production: |
Regular Expression | Checks whether the property value of the referenced property matches with the regular expression specified in "Value". | The action can only be executed on COBOL files: |
NULL | Checks whether the referenced property has no property value. | The action can only be executed if the selected element has no access key: |
NOT_NULL | Checks whether the referenced property has any property value. | The action can only be executed if the selected element has a change date: |
TRUE | Checks whether the referenced property has the Boolean value true. The valid value for true which is checked during run time is defined in the property definition. | The action can only be executed if the selected element can be edited: |
FALSE | Checks whether the referenced property has the Boolean value false. The valid value for false which is checked during run time is defined in the property definition. | The action can only be executed if the selected element is not write-protected: |