The <command> tag configures a command to execute one or several actions. The attributes parent, relatedObjects, src and target are used to assign further informations of the components.
The executable command is referenced by the xsi:type attribute .
Attribute name | Usage | Attribute values | Default value | Description |
---|---|---|---|---|
id | required | Unique name to reference to. | ||
relatedObjects | optional | this | Formula to the engineering object, that is currently inserted | |
src | required | Type of engineering object to be drawn | ||
xsi:type | required | changeInstanceParent changeClassParent createNodeForClass createNodeForInstance deleteNodeCommand instantiateAndCreateNode |
Specifies the function of the command changeInstanceParent: The node of an instance can be moved from one superordinate component to another. changeClassParent = the node of a modular system component can be moved from one superordinate modular system component to another. createNodeForClass = creates a node for a component that is moved from the modular system library to the diagram. createNodeForInstance = creates a node for a component that is moved from the project tree to the diagram. deleteNodeCommand = triggers further actions in addition to the deletion. instantiateAndCreateNode = creates an instance of the assigned component and a node from the palette. |
Allowed sub-elements | Quantity |
---|---|
ecAction | any |
The following example code defines a command, which creates a new node for a component, that is moved from the project tree into the diagram by drag & drop:
<command xsi:type="createNodeForInstance"
src="=isInstanceOf('WaterSupply_ModularSystem.Items.Cictern')"
id="command1"/>
The following example code defines a command, which creates a new node for an instance of a component, that is created out of the palette:
<command xsi:type="instantiateAndCreateNode"
src="=isClassEO() and
(absoluteName='WaterSupply_ModularSystem.Items.Cictern')"
eoClassPath="WaterSupply_ModularSystem.Items.Cictern"
id="command8"/>
The following example code defines a command with the type deleteNodeCommand which deletes the node of the type Execution (1) and additionally with the action ClearParameterReferenceAction (2) the value of the parameter with the reference to the successor (4) in the ancestor component (3).
Result:
After deletion of the node of the type Execution (1) the parameter Successor (4) in the ancestor component (3) is deleted.
If further parameter values have to be deleted, further actions with the same command must be configured.