Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Modesto Vega on March 23, 2022, 10:02:22 pm

Title: Activity Parameters
Post by: Modesto Vega on March 23, 2022, 10:02:22 pm
The following link refers to both input and output parameters, https://sparxsystems.com/enterprise_architect_user_guide/15.2/model_domains/activityparameternodes.html, is there a way to explicitly set parameters as input or output?

Also, when invoking an activity with parameters. Parameters appear as Param: instead of of :Param, this led me to believe that the parameter in the invocation had the activity parameter as its classifier. This does is not the case. Is it by design or a bug/feature? [Note: The issue with this is that I cannot get the name of the parameter in the invocation to display on the diagram like  Order : Number or Purchase Order Number]

Title: Re: Activity Parameters
Post by: Geert Bellekens on March 23, 2022, 11:01:41 pm
Yes, there is a property Direction you can set to
- in
- out
- inout
- return

If you give your parameter a type it will show up on the activity as "param: type"

Setting you argument on the Action, referencing the parameter will then result in: "argument: type"

Geert
Title: Re: Activity Parameters
Post by: Modesto Vega on March 24, 2022, 12:50:09 am
[SNIP]
Yes, there is a property Direction you can set to
- in
- out
- inout
- return
Where in v15 I can find these properties? I keep looking for them and cannot find them.
Title: Re: Activity Parameters
Post by: Geert Bellekens on March 24, 2022, 01:22:29 am
If you click on the Activity in a diagram, you'll see a parameters section in the properties window

See https://imgur.com/a/LSvnyJW (https://imgur.com/a/LSvnyJW)

Geert
Title: Re: Activity Parameters
Post by: Modesto Vega on March 24, 2022, 01:47:51 am
If you click on the Activity in a diagram, you'll see a parameters section in the properties window

See https://imgur.com/a/LSvnyJW (https://imgur.com/a/LSvnyJW)

Geert
Thanks Geert, much appreciated. Is this documented anywhere? Somehow I keep looking at the online help and cannot find it; maybe I have gone selectively blind.

One other question. When an activity is invoked, is there a way to assign a value to the parameter? What do you suggest?
Title: Re: Activity Parameters
Post by: qwerty on March 24, 2022, 02:53:30 am
I think I've seen it somewhere in the docs. Bu honstly, the EA documentation is best used as weight for loose papers so they don't fly around when the window is opened.

q.
Title: Re: Activity Parameters
Post by: Modesto Vega on March 24, 2022, 05:00:43 am
This is a really annoying user interface, its designer was not thinking about usability. The properties Geert was referring to cannot be setup when and interaction point is created; setting those properties is a 2 step process: they have to be created as a feature of the activity, and then the "other" properties of the activities have to be used to set these properties.

Furthermore, for some mysterious reason I have now lost the "other" properties tab and cannot remember how to get it back (will try again tomorrow).

Note: there are of course 2 sets "properties" in Sparx, those you can access via right clicking in the element and selecting properties and the "other" properties, these typically appear as a tab on the right hand of my screen. I hope, probably in vain, the this would be sorted in version 16.
Title: Re: Activity Parameters
Post by: qwerty on March 24, 2022, 07:41:07 am
Ha, user oriented design. You picked up my thread about SDs, didn't you?

q.
Title: Re: Activity Parameters
Post by: Modesto Vega on March 24, 2022, 07:41:56 pm
Ha, user oriented design. You picked up my thread about SDs, didn't you?

q.
Yes, actually when I replied to your sequence diagram thread I was also thinking about activity diagrams.
Title: Re: Activity Parameters
Post by: Modesto Vega on March 24, 2022, 10:45:51 pm
[SNIP]
One other question. When an activity is invoked, is there a way to assign a value to the parameter? What do you suggest?
Any takers for this.
Title: Re: Activity Parameters
Post by: Geert Bellekens on March 24, 2022, 10:51:49 pm
In an Action that invokes your Activity, you have the arguments, that you map to the Activity parameters.

Geert

Title: Re: Activity Parameters
Post by: Modesto Vega on March 25, 2022, 02:19:01 am
In an Action that invokes your Activity, you have the arguments, that you map to the Activity parameters.

Geert


Are you saying that in order to map arguments to Activity parameters an action has to be always used to call the activity - i.e., decision and fork/join cannot be used?
Title: Re: Activity Parameters
Post by: qwerty on March 25, 2022, 06:38:35 am
Probably not. An activity parameter is mapped to an action pin. And that can be used "as usual".

q.
Title: Re: Activity Parameters
Post by: Modesto Vega on March 25, 2022, 09:22:42 pm
Probably not. An activity parameter is mapped to an action pin. And that can be used "as usual".

q.
Thanks Thomas, just to clarify what I have in mind. Let's say I have
What I trying to clarify is:

P.S.: I am likely to have a similar question about action and actions calling activities.
Title: Re: Activity Parameters
Post by: qwerty on March 25, 2022, 10:17:29 pm
Heed your words. An activitity has no action pin. Only an intantiated activity which is an action of type call behavior has action pins. You create as many invocations of your activity as needed. Each has the number of action pins that match the number of activity paramaters of their parent.

q.
Title: Re: Activity Parameters
Post by: Modesto Vega on March 26, 2022, 01:09:16 am
Heed your words. An activitity has no action pin. Only an intantiated activity which is an action of type call behavior has action pins. You create as many invocations of your activity as needed. Each has the number of action pins that match the number of activity paramaters of their parent.

q.
Good point Thomas, perhaps I should have been more precise with my use of language but I wasn't and this, together with your reply, made me experiment.

The results of the experimentation is that Sparx EA does not prevent you from adding a Action Pin to an activity.

The 2nd bullet in the example should have read as follows: "Activity C is invoked by both an instance of activities A & B"

The 2 questions still stand.

Title: Re: Activity Parameters
Post by: qwerty on March 26, 2022, 08:23:51 am
I will have to sketch a model to actually see through your question. Will do that during the WE. EA does nor completely obey all constraints from the UML metamodel. The fact tha EA allows to add a pin does not mean it is correct UML. You have to consult the UML specs (and I too as I'm wrinting this out of the blue).

q.
Title: Re: Activity Parameters
Post by: qwerty on March 26, 2022, 11:33:30 pm
You should model that yourself. Create the three Activities and give C an ActivityParameter. Open the composite diagram for A and drag C as an invocation onto that. Select that action and in the Features/Interaction Points make the ActivityParameter visible. Now, what you see in an Action with a Pin. What ever you send into that pin (one of those integers) will be passed to that Activity. When you model the Activity C you have your ActivityParameter going with an ObjectFlow to some internal actions which will process it (and branch in what ever way you designed it). That happend hidden in the invocation when you supply that value. You can probably call "information hiding" or "procedure call", all the same. I think it's pretty much straight forward.

Pins on Activities are wrong. You might consider sending a bug report, but probably it's always best to not 100% rely on some tool. Look into te specs. There was a time when I thought EA implements UML correctly. Once... Honestly it's quite close, but just close.

Activities do have ActivityNodes (one of which are specialized ActivityParameters).

q.