To define a new activity using Alf, first the Activity needs to be created in the model, and then Alf code needs to be written for it and compiled.
To create the Hello World Activity
- Right click on the root Model and select Create Element > Activity.
Enter the name Hello World.
To create an Alf body for Hello World
Select the new Activity in the Model Browser and open the Alf editor window (select Windows > Alf), if it isn't already open.
In the Alf editor window, type WriteLine("Hello World!");
- If there are any errors in your code, fix them.
When the code is entered correctly, click the Save button. The Alf code will be compiled into Activity Nodes and Edges within the selected Activity.