AlloyCommands in ALang

Modified on Mon, 5 Oct at 1:53 PM

Some solutions require functionality that is not yet implemented in ALang. In these cases, it is possible to use AlloyCommands, as these enables to call other Alloy plugins in ALang using parameters defined in the function.

How to configure

To call commands from other Alloy plugins, insert the below inside your ALang command in the function:

XML
<AlloyCommands>
  <Cmd case=”…” … /> 
</AlloyCommands>

The <Cmd case=”…” … /> refers to the command from another plugin. This could for example be a command from BaseExtensions like the following:

XML
<AlloyCommands>
  <Cmd case="BaseExtensions:change-style" style="$RED_style$"/>
</AlloyCommands>

Every parameter in the AlloyCommands element which starts and ends with $ will look for the variable that must be present in the ALang module.

Furthermore, as seen in the example above, it is also possible to inject variables in the external AlloyCommands. To learn more about injected variables, have a look at this article.

Note that it is possible to call as many commands as needed in the

<AlloyCommands></AlloyCommands> element.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article