Book a Demo

Author Topic: Use Operation Name instead of Behaviors  (Read 2647 times)

MatthiasW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Use Operation Name instead of Behaviors
« on: July 17, 2012, 06:23:32 pm »
Hey,

I'm trying to generate code from a statemachine build in EA.
My states do have a entry, do and exit operation and I want the names of these operations (right-click on one state -> Operations... -> Properties -> General -> Name) to be printed in code as well besides the behaviors.

So I looked into the States Template and found the command:

%EASLList="Action" @separator="\n" @indent="\t" @owner=$GUID @collection="DoBehaviors"%

I tried different variations of this command to get the operation name of the behaviors, but actually I could not get it working.

Can someone give me a hit? Is there a tutorial I could read?
Thanks.

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Use Operation Name instead of Behaviors
« Reply #1 on: July 18, 2012, 09:14:55 am »
In the Help, have you looked at:

Standard UML Models > MDG Technology SDK > Code Template Framework > Code Template Syntax > Macros > EASL Code Generation Macros

?
Best Regards, Roy

MatthiasW

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Use Operation Name instead of Behaviors
« Reply #2 on: July 18, 2012, 09:58:01 pm »
I have got the GUID of the state:

ID: %EASL_GET("Property", $GUID, "ID")%  ({....})
Name: %EASL_GET("Property", $GUID, "Name")% (Statename)
ObjectType: %EASL_GET("Property", $GUID, "ObjectType")% (otState)

But now how do i get the list of operations from a state?
I tried this to get the operationlist:

%EASLList="Operation" @separator="\n" @indent="" @owner=$GUID @collection="DoBehaviors"%
%EASLList="Operation" @separator="\n" @indent="" @owner=$GUID @collection="EntryBehaviors"%
%EASLList="Operation" @separator="\n" @indent="" @owner=$GUID @collection="ExitBehaviors"%

but these print only

();
();
();

I am using Version 9.2.922 (Build 922) and want to generate C++ Code.