Book a Demo

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pmueller

Pages: [1]
1
General Board / Re: Enumerating State Machine Triggers for Code Ge
« on: May 13, 2010, 01:11:37 am »
Ah, I found the solution, the REMOVE_DUPLICATES() macro. Below is the fix:

$sEvents = %EASLList="StateEnumerate" @separator="\n" @indent="" @owner=classGUID @collection="AllStateMachines"%
$sEvents = %REMOVE_DUPLICATES($sEvents, "\n")%

2
General Board / Enumerating State Machine Triggers for Code Gen.
« on: April 27, 2010, 09:59:56 am »
Hi,

I am using EA Systems Engineering edition, ver. 7.5.

I am attempting to significantly modify the code generation templates  (for state machines) to use the Boost Statechart library: http://www.boost.org/doc/libs/1_34_1/libs/statechart/doc/index.html

Boost will provide more functionality than is available with the default EA code generation. :D

However, I am stumbling on something, enumerating triggers. The Boost library needs me to enumerate all triggers that are referenced by the state machine. How do I do this?

The default template iterates through all transitions and enumerates all triggers for each transition. The problem is that if multiple transitions use the same trigger event, that trigger will be listed as a duplicate. And this will cause compile-time errors in the generated code.  :'(

My idea:
In the EA User Guide, the EASL Collections topic states that I can get
TimedTriggers and AsynchTriggers from a Classifier. Indeed, I can enumerate all of my TimedTriggers, but I cannot enumerate the AsynchTriggers or any other trigger types. For the Classifier, I've tried using classGUID and StateMachineGUID. Is there another classifier that I should use?

My StateMachine template contains the following:
Code: [Select]
$sTriggers = %EASLList="StateEnumerate" @separator="\n" @indent="" @owner=classGUID @collection="AsynchTriggers"%
In the above, if I simply change "AsynchTriggers" to "TimedTriggers", I can list all of the TimedTriggers.

Furthermore: I still don't know how to enumerate the other trigger types: Call and Change. I couldn't find any info in the User Guide about these trigger types.

Should I try an entirely new tactic?
Will a newer version of EA solve this?
Any ideas?

To add to my confusion, I found this note on transitions:
Quote
Code generation for State Machines currently supports Change and Time trigger events only, and expects a specification value.

This note came from:
http://www.sparxsystems.com/uml_tool_guide/uml_dictionary/transition.htm
But I don't quite understand the implications of that note...

Thanks

/me

3
I am modifying the  code generation templates. However, I noticed what seems like a flaw.

Scenario:
I have a composite state machine (state chart) with an inner state. In the inner state, I have a final pseudo state.

The transition to the final pseudostate has the target as Final and this is shown in the Transition Properties dialog. But the template macros return that the target is the outer state, not the Final pseudostate.  The transition template snippet is below:

Code: [Select]
$Target           = %EASL_GET("Property", $GUID, "Target")%
$sTargetName = %StateEnumeratedName($Target)%

Is this the correct behavior?
I'm using EA 7.5.849

4
Ah, thank you much. I may need to try out 8.0.
Thanks again  :)

5
Thanks for responding.
This still does not give me the 'Specification' of an event as shown in the Transition Properties dialog.

For example, for the CallEvent, the only property that is documented is:
Operation
      The operation of the CallEvent.

while the ChangeEvent has:
ChangeExpression

Is there a 'hidden' property to get the Specification?
Thanks again

6
I am modifying the C++ code generation templates for state machines. I need to retrieve the Specification value from Triggers. But EA ver. 7.5 does not provide an EASL property to retrieve the specification of a trigger. Am I overlooking something?

Below are the properties that EA exports:
AsynchDestinationState
DependentProperty
Event
Name
Type

Pages: [1]