Date: Thu, 28 Mar 2024 17:25:17 +0100 (CET) Message-ID: <630019351.571.1711643117535@nm-docs> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_570_1038547120.1711643117535" ------=_Part_570_1038547120.1711643117535 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
You can use the Alf = editor to create an Alf body for a new Activity or to edit the existing= Alf body of an Activity. Compiling the Alf body of an Activity results in = the generation of Activity Nodes and Activity Edges within the Activity. Ex= ecuting the Activity then has the behavior specified by the original Alf co= de. The Alf code itself is stored in a Comment owned by the Activity, which= has the TextualRepresentation stereotype applied. Normally, you s= hould not modify any of the contents of an Activity with an Alf body, other= than by editing its Alf code using the Alf editor. (See also the discussio= n on the Alf compiler.= )
To create an Activity with an Alf body
Add Parameters to the Activity as desir= ed.
The easiest way to create an Activity with Parameters is to type the com= plete signature for the Activity with its name when you create it. For exam= ple, if you type Compute(x: Integer): Integer for the Activity nam= e, this results in an Activity named "Compute" with an Integer= input parameter named x and a return type of Integer. Parameter declarations may also be prefixed with in, out or inout to specify the Parameter direction.
Select the new Activity in the Model Br= owser and open the Alf editor window (select Windows > Alf), if it isn't already open.
Enter the Alf code for the Activity and= press Save to compile and save the code.
To edit an existing Alf body for an Activity
If an Activity has been defined using an Activity diagram, then it is no= t possible to enter Alf code for it. If you want to re-define an existing A= ctivity using Alf, then, first, open the Activity diagram and delete all Ac= tivity Nodes on it other than Activity Parameter Nodes. Then you can procee= d to enter Alf code for it as above.