Book a Demo

Author Topic: Problem with activity parameter  (Read 5929 times)

zadeluca

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem with activity parameter
« on: April 10, 2007, 09:25:57 am »
Hello,

I have a structured activity with an activity parameter. Not too different from this diagram found in Help



The problem is, I cannot for the life of me figure out how to connect from the final node in the activity to the output parameter...

Thank you in advance for your help,
Zach

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with activity parameter
« Reply #1 on: April 10, 2007, 09:47:35 am »
Quote
The problem is, I cannot for the life of me figure out how to connect from the final node in the activity to the output parameter...
Hi Zach,

I had no problems.  What specifically is your problem?  The nature of the link or the actual drawing?

I was able to connect an Action to the output parameter using both the Quick Linker and the Toolbox relations.

A connection from an Activity was a bit more problematic, but still doable

Often, you do have to fight EA's UI (Unique Interface)

Can you be more explicit on exactly what you see the problem as?  For example, one could argue that you might want to be able to connect a control flow from the internal item to the output parameter (and by default, you can't).  

Also, can you indicate which version of EA you are using (mine was 804).

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

zadeluca

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with activity parameter
« Reply #2 on: April 10, 2007, 10:07:11 am »
Thank you for the reply. I am using version 6.5.804

Quote
For example, one could argue that you might want to be able to connect a control flow from the internal item to the output parameter (and by default, you can't).


I believe this is what I am trying to do. I have a decision element; on failure I have a control flow to program termination. On success I would like to have a control flow to the output parameter, but I do not know how to make the connection with EA. Simplified, it looks like this...





If any of my UML is incorrect forgive me I just started teaching it to myself last week.

Zach

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with activity parameter
« Reply #3 on: April 10, 2007, 10:30:07 am »
Quote
I believe this is what I am trying to do. I have a decision element; on failure I have a control flow to program termination. On success I would like to have a control flow to the output parameter, but I do not know how to make the connection with EA.
Hi again Zach,

I think, in principle, one normally doesn't connect a control flow to an output parameter.  Output parameters should, by default, receive object flows.  Are you saying that on failure the output parameter isn't set but on success it is?

If so, then you might have an action to set the output parameter.  This action is bypassed on failure (that is, the control flow does NOT enter it) and invoked on success (the alternate control flow DOES pass through it).  You can then link that action to the output parameter via an object flow.

Does that help?

Paolo
BTW: if you REALLY want to connect a control flow to the output parameter, you can use the Toolbox Control Flow relation instead of the Quick Linker.

OH... and BTW2: The example in the Help you cited is WRONG!  It is most certainly NOT an exemplar.  It's not a simple diagram (as it claims), it's a simplistic diagram - there's a big difference...
« Last Edit: April 10, 2007, 10:37:36 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

zadeluca

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with activity parameter
« Reply #4 on: April 10, 2007, 10:49:47 am »
Okay, I understand what you mean, but I must be doing something incorrectly in EA, as I cannot make the connection either way.

Perhaps my UML is incorrect...what I am trying to do is this (and I am diagramming existing code so I do not really have a choice here):

Upon success of "AGENT_initialize", I would like control to flow out of the "Initialize Subsystem" and into "Parser."

Does that make more sense?

Zach

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with activity parameter
« Reply #5 on: April 10, 2007, 11:13:39 am »
Quote
Okay, I understand what you mean, but I must be doing something incorrectly in EA, as I cannot make the connection either way.

Perhaps my UML is incorrect...what I am trying to do is this (and I am diagramming existing code so I do not really have a choice here):

Upon success of "AGENT_initialize", I would like control to flow out of the "Initialize Subsystem" and into "Parser."

Does that make more sense?

Zach
Yes, your UML is somewhat incorrect.  What you are describing (as I understand it) is two activities, the execution of the second being contingent on the sucessful execution of the first.

[Edit] You'll need to make the success path within "Initialize Subsystem" connect directly to its final node (or better do what I orginally sugessted).[/Edit]

From the appearance of your first diagram, you want to pass the session parameter between the two activities.  So the two pins should be connected by an object flow.

You ALSO need to connect the two activities with a control flow with a Guard Condition on it to prevent it transitioning if there was a failure in "Initialize Subsystem".  You'll need another control flow for the failure case going to the (missing) final node at this outer level (this is for the failure return from ""Initialize Subsystem" - which should have the opposite guard (or [Else]).

Have you had a look at the various tutorials on the Sparx website?  You may want to look up some of the above terms in the Help and User Guide; and when all else fails there's always: the [size=13]UML 2.1.1 Superstructure (formal)[/size] Specification  ;D

Paolo
« Last Edit: April 10, 2007, 11:16:35 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Problem with activity parameter
« Reply #6 on: April 10, 2007, 02:32:54 pm »
Did you try checking the Strict UML Syntax of the Tools | Options | Diagram dialog, and then running a model validation? Perhaps EA will complain, which in turn might give you a lead.
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with activity parameter
« Reply #7 on: April 10, 2007, 03:12:46 pm »
Quote
Did you try checking the Strict UML Syntax of the Tools | Options | Diagram dialog, and then running a model validation? Perhaps EA will complain, which in turn might give you a lead.
I had strict checking on, and EA still let me connect using a Control Flow.  However, I didn't use validation.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

zadeluca

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with activity parameter
« Reply #8 on: April 11, 2007, 08:12:16 am »
Thank you both for your help. I did have strict checking on, but even with it off I could not connect the decision element to the activity parameter. If I am on the outer-most model and attempt to make the connection, it draws the line from the initialize activity to itself. If I am inside the initialize activity, I cannot make the parameter appear on the model in the first place. It says I must drop it on the parameters owner.

However, I looked at some of the tutorials that you suggested, and it prompted me to change the diagram slightly. Would this UML be correct?



Would I be incorrect in saying that in this diagram, control flow from initialize to parse implies the successful completion of both decisions within initialize?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Problem with activity parameter
« Reply #9 on: April 11, 2007, 01:19:52 pm »
Quote
Would I be incorrect in saying that in this diagram, control flow from initialize to parse implies the successful completion of both decisions within initialize?
Yes Zach you are incorrect.  The unguarded transition just says:  "When I exit Initialize Subsystem (regardless of the outcome) I invoke Parse"

You need two paths out of Initialize Subsystem - one for the successful path and one for the unsuccessful path.  Only the successful path connects with Parse.  The Guards are used to determine which path to take on exit.

Just to reinforce the issue... If you took the internal flows that lead to the Exit pseudo-state and connected them instead to the End pseudo-state, it would make no material difference to the semantics of your Initialize Subsystem activity.  In both cases it means: "Go to the edge of the Activity and find an outgoing transition".

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

zadeluca

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Problem with activity parameter
« Reply #10 on: April 12, 2007, 09:12:32 am »
Alright, I completely understand now. And actually, after reading more of the Sparx tutorials yesterday, I actually changed my diagram to indicate what you just said. I was going to re-post it but now there is no need. ;D

Thank you very much for all your help Paolo.

Zach

Kevin G. Watson

  • EA User
  • **
  • Posts: 217
  • Karma: +0/-0
  • I love EVERYTHING including Microsoft
    • View Profile
Re: Problem with activity parameter
« Reply #11 on: April 13, 2007, 05:25:56 pm »
thats a shame :( I would have appreciated a glimpse of it drawn correctly.

Completion and that
Kevin