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 tool is executed within the action. 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 them 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:
|Selection_Count [O]||String|| Number of resources that must be selected for the referenced action to be executable.
* = Number of resources is irrelevant
0 = No resources may be selected
n = Exactly n (n = 1,2,3,...) resources must be selected
[*|n]-[*|n] = A range of numbers, for example, “2-*” = at least two resources must be selected.
Default value: *
|Complex_Enabled_Condition (0..1)[D]||Complex Condition||Complex condition. Consists of several combined conditions.|
|Simple_Enabled_Condition (0..1)[D]||Simple Condition||Simple condition. Checks a property value for a specific value.|
The enabled condition for an element action is specified 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).
|TargetID||Property||Reference to the property whose value should be checked.|
|Operator||Selection|| The check operator.
Valid values include:
|Value [D]||String||A fixed value that is compared with that of the Property.|
The meanings of the different operators are shown in the following table:
|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:
TargetID = PROP_Type
Operator = Equals…
Value = COBOL
|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:
TargetID = PROP_Stage
Operator = Equals not…
Value = PROD
|Regular Expression|| Checks whether the property value of the referenced property matches with the regular expression specified in "Value".
This check is not case sensitive.
| The action can only be executed on COBOL files:
TargetID = PROP_FileSuffix
Operator = Regular Expression…
Value = (cbl)|(cob)
|NULL||Checks whether the referenced property has no property value.|| The action can only be executed if the selected element has no access key:
TargetID = PROP_AccessKey
Operator = NULL
|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:
TargetID = PROP_ChangeDate
Operator = NOT_NULL
|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:
TargetID = PROP_Editable
Operator = TRUE
|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:
TargetID = PROP_Protected
Operator = FALSE