Sparx Systems Forum
Enterprise Architect => General Board => Topic started 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]
-
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
-
[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.
-
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
-
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?
-
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.
-
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.
-
Ha, user oriented design. You picked up my thread about SDs, didn't you?
q.
-
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.
-
[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.
-
In an Action that invokes your Activity, you have the arguments, that you map to the Activity parameters.
Geert
-
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?
-
Probably not. An activity parameter is mapped to an action pin. And that can be used "as usual".
q.
-
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
- Activities A, B, and C
- Activity C is invoked by both activities A & B
- Activity C has a parameter Aparam
- Aparam can take values 1 to 3
- Activity C has a decision node executing different actions depending on the value of Aparam
What I trying to clarify is:
- Does Activity C need 1 or 3 action pins (an action pin per execution branch)? I am assuming it only needs 1 action pin.
- How do I internally represent the parameter? Using a variable?
P.S.: I am likely to have a similar question about action and actions calling activities.
-
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.
-
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.
-
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.
-
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.