Book a Demo

Author Topic: "Effect is an activity" (in Transition)  (Read 9908 times)

tomte

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Reverse Engineering
    • View Profile
"Effect is an activity" (in Transition)
« on: December 11, 2007, 03:48:40 am »
Hello,

I am looking for a mechanism to link a transition (in a State Machine Diagram) to an Activity Diagram.
I.e. instead of directly editing the effect e.g. " /setXFlag, showYDialog" I would like to link the transaction to an activity that does those actions "setXFlag, showYDialog" and even more.
During transition the actions of this Activity should be performed.

At EA's transition arrows in State Machine Diagrams there is a check box called "Effect is an activity". (The Help / explanation of "Effect is an activity" does not help). I could not detect any change when checking this box or not.

So how could I link?
How can I drill down from the transition to the Activity diagram then?
By clicking on what ...?

Thank you in advance, tomte
« Last Edit: December 11, 2007, 03:58:01 am by tomte »

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #1 on: December 11, 2007, 05:04:28 am »
Several of us have requested that EA provide the type of drill-down capability from several diagram elements such as you are requesting.  For example, a drill-down from declared operations on class models has also been requested. Eventually, we might get them, but not soon I think.  So I propose a work-a-round. Just to set the stage to allow others to follow my logic...

As I'm sure you are aware, transitions may have parameters, guards, actions and/or sends.  Appearing on a statechart as an edge, or line, between two states, They may be adorned by their formal specification.  The formal syntax for transitions is:
Event-trigger(<parameter-list>) [<guard>]/<action list>^<Send-Clause>

As an interim solution, I suggest using a Do statement in the action list.  The syntax would be
do(<namedactivity>) where namedactivity is the associated activity's diagram name.

An example transition statement might be:
T1(x) [x>0]/x=0,do(CoolStuff)^monitor.on(3)

This means that a value of x is passed with the notification of the T1 event’s occurrence.  The T1 initiated transition will proceed if the value of x is greater than zero.  When the transition fires, three actions are taken:  First the value x is set to zero, second the activity modeled by CoolStuff is executed, and finally an on signal is sent to the monitor; the argument value of 3 is passed with the On signal event to the monitor for its optional use.  Ostensibly, monitor has a transition that will be triggered by the On signal.

Just an initial thought. But hey, its very early in the morning here and I have not taken my coffee yet.

-Jim
« Last Edit: December 11, 2007, 05:07:57 am by jeshaw2 »
Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #2 on: December 11, 2007, 05:54:43 am »
Well, I got my coffee with me now and I'm trying to implement my work-a-round in EA.  I think we have a bug here!  I tried to enter trigger specifications and got either no activities or a GUID (not sure what it is pointing to).  Also ended up doing some unexplained  loopdi loops through the same windows in the process.  This interface is special! :(  Somewhere, some Sparxian has an undocumented thought about how this all works in EA.  It is not very intuative.

Maybe I need to switch to hot chocolate?
Verbal Use Cases aren't worth the paper they are written upon.

tomte

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Reverse Engineering
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #3 on: December 11, 2007, 07:40:44 am »
Hello jeshaw2,
many thanks for trying to find a workaround!
Do you feel any chance left to find any?
tomte

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #4 on: December 11, 2007, 08:08:36 am »
Tomte;

I don't think I'll find a way to do a click initiated drill-down like one may do with a composite diagram, but I'm sure I'll find a way to at least document activity with a Do statement.  I developed an understanding of this interface about a year ago, but have forgotten how it works.  When I get a few mins., I'll dig into my past models and see how it is done.  I'll have it, perhaps, by tommorrow.

-Jim
Verbal Use Cases aren't worth the paper they are written upon.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #5 on: December 11, 2007, 08:20:04 am »
Quote
Well, I got my coffee with me now and I'm trying to implement my work-a-round in EA.  I think we have a bug here!  I tried to enter trigger specifications and got either no activities or a GUID (not sure what it is pointing to).  Also ended up doing some unexplained  loopdi loops through the same windows in the process.  This interface is special! :(  Somewhere, some Sparxian has an undocumented thought about how this all works in EA.  It is not very intuative.

Maybe I need to switch to hot chocolate?

I'd say you should - after you've had your hot chocolate - take the time to word your bug report very carefully.

IMHO we need to solution to the problem, so that the behavior is both correct and as expected. What we don't want to get is better documentation of the reasoning behind the current (broken) behavior.

Make sense?

David
No, you can't have it!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #6 on: December 11, 2007, 10:20:50 am »
Quote
IMHO we need to solution to the problem, so that the behavior is both correct and as expected. What we don't want to get is better documentation of the reasoning behind the current (broken) behavior.


Agreed.  If I remember properly, EA is not using the standard UML terminology for the transition specification elements.  At least that is part of the problem...as I remember it.
Verbal Use Cases aren't worth the paper they are written upon.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #7 on: December 11, 2007, 06:39:51 pm »
Tomte;
Here is what I've figured out so far...

In a new state diagram
  • add two states and a transition between them.
  • Open the Transition Properties.Constraints window and enter the following
    • Guard:  x>0
    • Effect is Activity => not selected
    • Effect:  Do CoolStuff^Signal(monitor.ON)
  • In the Trigger Panel enter
    • Name:  T1
    • Type:  Signal
    • Specification:  T1(x)
Save this stuff and take a look at what you get on the diagram.  Is it what you want?

I get:   T1[x>0]/Do CoolStuff^Signal(monitor.ON)  
I should get get:   T1(x)[x>0]/Do CoolStuff^Signal(monitor.ON)  

The CoolStuff is an activity diagram.

I have no idea what the Effect is Activity check box is for, but when you check it, you loose almost everything.

-Jim
« Last Edit: December 11, 2007, 06:50:28 pm by jeshaw2 »
Verbal Use Cases aren't worth the paper they are written upon.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #8 on: December 11, 2007, 06:53:02 pm »
The Effect is an activity checkbox specifies that the effect that the effect is no longer a free text field, but corresponds to an activity from the model.  (Click the elipsis button to set this)

This behavior will be clearer in the next build, where it will automatically prompt for an activity when checking the checkbox.

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #9 on: December 11, 2007, 09:35:26 pm »
Thanks simonm.  That's what I hoped it was for.  Now if we can get the specification boxes working correctly too I'd be really happy.
Verbal Use Cases aren't worth the paper they are written upon.

tomte

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Reverse Engineering
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #10 on: December 12, 2007, 01:34:13 am »
If there actually is no way for a drill down from a transition to an Activity diagram anyway, then I prefere to simply:
- draw the transition between two states
- open the "StateFlow Properties" dialog via the context menu of the transition
- check "Effect is an activity" and thereby get the "..." button enabled
- select an Activity via "..." the name of which will then be shown read-only (greyed) in the "Effect" field
- in "Trigger:" I give it
- - a Name
- - a Type: signal
- - no Specification
- - Save
- Ok

Maybe this turns out to be a good preparation for future drill down links.

Quote
... it will automatically prompt for an activity when checking the checkbox.

Not really. In the selection list behind the "..." button in my oppinion also Activity DIAGRAMS should be selectable, probabely by providing a third preselector in "ElementType": "ActivityDiagram" (besides the two existing ones "Activity" and "<any>").
"Activity DIAGRAMS" because by convention each Activity Diagram implies at least one Activity, though not automatically added to the Project Browser.
I prefer to put the Actions on the Activity Diagram directly without an Activity element as a holder. Lassoing multiple actions / elements is much easier when putting them onto the diagram directly.

The other reason is: Linking to an Activity element (instead of a diagram) would be another indirection on the way to drill down links.

(all above said based on the company's standard EA 6.5)

Sincerely, tomte

tomte

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
  • Reverse Engineering
    • View Profile
Re: "Effect is an activity" (in Transiti
« Reply #11 on: December 12, 2007, 02:29:24 am »
Quick and dirty workaround to get a drill down link from a transition arrow to an Activity Diagram:

- Context menu of the transition
- AttachNoteOrConstraint | Note | OK
- Shrink the note to as small as possible, leave it empty
- from the Project Browser drag an Activity Diagram onto the StateMachine Diagram,
 DropDiagramAs: Hyperlink
- draw a note link from the note to the hyperlink
- double click on the hyperlink

Sincerely, tomte