Tags and keywords
isTrue()
via the corresponding scripting language. You can then return to the Init
state using the Retry
signal.
First we'll look at what fails. As far as I can tell, there is no way to "directly" access the operation isTrue()
defined on the context class using any of these scripting languages: "English" (vendor-specific built-in), BeanShell, JavaScript, JavaScript Rhino, Groovy. (There are some other candidates, I did not try them all.) This is indicated by a custom diagnostic stereotype «!ERROR».
The Action Language for Foundational UML (Alf) - which requires an additional commercial plugin - makes it easy! Just access the operation on the guard as:
[this.isTrue()]
The access via Action Language Helper (ALH) is not as elegant, but it works:
[ALH.callOperation($context$,"isTrue")]
That is relatively indirect compared with the Alf form. Note that I could not just use ALH.callOperation("isTrue")
, I needed to go via the explicit pre-defined variable $context$
object (which you can also access using ALH.getContext()
). You can also use self
, which is equivalent to $context$
:
[ALH.callOperation(self,"isTrue")]
You may wish to visit one of these tutorials next: