Deployment Macros
All backends have an alias definition in the component diagram. So the backend information is hidden from the activity diagrams and access to backends within activity diagrams can be established by using these aliases. An alias links the physical definition of the backend in the component diagram with the backend adapter in the activity diagram. In the activity diagram, the alias is defined by specifying the tagged value alias on an action node, which is stereotyped as backend adapter. For more details, please refer to Aliases.
In cases where you need to reference information, which is located in the component diagram and is needed in activity diagrams, the separation of the logical view and the physical view needs to be softened. Suppose you want to access a Web Server to request a specific Web page. Protocol, host, and method are static information that is defined in the component diagram. The URL, which is composed of protocol, host name, and path may contain an id as a dynamic parameter that is known only at run-time. To build such a service, you would define the static information in the component diagram. This information can be accessed from the activity diagram, and can be concatenated with the run-time value of the id.
In activity diagrams, data that reside in component diagrams can be accessed with deployment macros. The deployment macros are used within action scripts of activity diagrams. Aliases help to specify, which data of which backend is to be retrieved. The tagged value alias needs to be defined on the action node that contains the deployment macros. In this case, the action node needs not necessarily to be stereotyped as backend adapter.
Deployment macros are expanded to their actual values during compilation. This means that return values of macros are not objects of a basic type but constants. For instance, concat(getURLFromAlias(), "/index.htm") works, whereas getURLFromAlias().concat("/index.htm") does not.
Deployment macros only retrieve the values specified in the component diagram. Deployment settings, that have been changed via the Bridge, will not been taken into consideration.
Example File (Builder project E2E Action Language/Operating):
<your example path>\E2E Action Language\Operating\uml\deploymentMacros.xml |
UML Example
The following example shows how to get the static information from the deployment diagram, and how to store the retrieved data in an object.
Figure: Example with Deployment Macros
In the example above, the alias getURL (tagged value of the action write deployment information) specifies, from which backend the deployment data will be retrieved (refer to the alias getURL that is drawn in the component diagram of the example model deploymentMacros.xml). Using the macro getPortFromAlias()
would retrieve the value 80. Using the macro getMethodFromAlias()
would retrieve the value get.
Deployment Macros in Builder Releases before 6.0
On this Page: