Date: Fri, 29 Mar 2024 10:40:08 +0100 (CET) Message-ID: <223083452.1810.1711705208873@nm-docs> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1809_91963407.1711705208872" ------=_Part_1809_91963407.1711705208872 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
You can use the Alf edito= r to create an Alf Expression for the guard of a Transition in a State = Machine or to edit an existing guard Expression.
To create an Alf guard Expression
Enter the Alf code for the Expression a= nd press Save to compile and save it.
Note that the text entered must be an expression, not a stateme= nt. Therefore, it must not have a semicolon at the end.
The expression can access attribute values of the context Classifier of = the Activity containing its Activity Edge (using Alf this expressi= ons) or the decision input value for the De= cision Node (see Accessing data in Ac= tivity Edge guards).
To edit an Alf guard Expression
On the State Machine diagram, click on = the text of the Transition trigger with the guard to be edited.
If a Transition has a guard Expression in Alf, but no effect Behavior, t= han selecting the Transition on a diagram results in the Alf code for the g= uard being displayed in the Alf editor window. However, if the Transition a= lso has an effect Behavior in Alf, then selecting the Transition line= em> on a diagram results in the Alf code for the Behavior being di= splayed in the Alf Editor. In order to edit the guard, select the = text for the trigger of Transition.
=
The Alf code for a guard Expression can also be entered or edited direct= ly in the Guard property in the Specification window of th= e Transition. If you open the Edit Guard window, then the Alf code can be e= dited just as in the Alf editor window. However, instead of Save and Revert buttons, this window has OK and Cancel buttons, either of which will close it. If= you press OK, then the Alf text is saved, and, if it has = no errors, compiled. If you press Cancel, the Alf tex= t is not saved.
To be recognized as Alf code, the Body of an Opaque Exp= ression must have the Language Alf. If your project was cr= eated using the Alf project template, then Alf will be the default language= . Otherwise, select Alf from the Language menu (you may ha= ve to scroll upwards in the menu to find the selection for Alf).= p>
To make Alf the default language for Opaque Expressions