EASL Code Generation Macros

Enterprise Architect provides two Enterprise Architect Simulation Library (EASL) code generation macros to generate code from behavioral models. These are:

  • EASL_GET and
  • EASLList.


The EASL_GET macro is used to retrieve a property or a collection of an EASL object. The EASL objects and the properties and collections for each object are identified in the EASL Collections and EASL Properties topics.



$result = %EASL_GET(<<Property>>, <<Owner ID>>, <<Name>>)


  • <<Property>>        is either "Property" or "Collection"
  • <<OwnerID>>        is the ID of the owner object for which the property/collection is to be retrieved
  • <<Name>>                is the name of the property or Collection being accessed
  • $result                is the returned value; this is if not a valid property.



$sPropName = %EASL_GET("Property", $context, "Name")%


The EASLList macro is used to render each object in an EASL collection using the appropriate template.


$result = %EASLList=<<TemplateName>> @separator=<<Separator>>
                @indent=<<indent>> @owner=<<OwnedID>>

                @collection=<<CollectionName>> @option1=<<OPTION1>>

                @option2=<<OPTION2>>.........  @optionN=<<OPTIONN>>%



  • <<TemplateName>>        is the name of any behavioral model template or custom template
  • <<Separator>>                is a list separator (such as \n)
  • <<indent>>                        is any indentation to be applied to the result
  • <<owner>>                        is the ID of the object that contains the required collection
  • <<CollectionName>>        is the name of the required collection
  • <<OPTION1>....<<OPTION99>> are miscellaneous options that might be passed on the template; each option is given as an additional input parameter to the template
  • $result                        is the resultant value; this is if not a valid collection.



$sStates = %EASLList="State" @separator="\n" @indent="\t"

                @owner=$StateMachineGUID @collection="States" @option=$sOption%


Behavioral Model Templates

  • Action
  • Action Assignment
  • Action Break
  • Action Call
  • Action Create
  • Action Destroy
  • Action If
  • Action Loop
  • Action Opaque
  • Action Parallel
  • Action RaiseEvent
  • Action RaiseException
  • Action Switch
  • Behavior
  • Behavior Body
  • Behavior Declaration
  • Behavior Parameter
  • Call Argument
  • Guard
  • Property Object
  • Property Declaration
  • Property Notes
  • State
  • State CallBack
  • State Enumerate
  • State EnumeratedName
  • StateMachine
  • StateMachine HistoryVar
  • Transition
  • Transition Effect
  • Trigger.