Book a Demo

Author Topic: Înstance of an action  (Read 13601 times)

beginner

  • Guest
Înstance of an action
« on: June 16, 2010, 07:46:21 pm »
Today I came across a new area in UML. I want to model activities and I'm using partitions with actors as instance classifier. When I create actions inside the partitions these are nicely grouped under the according partition in the project browser. So far so good.

Now I wanted to re-use the actions. It seems obvious that the actions initially belong to the classifying actors. So why not move them (manually) there so I can re-use them in different scenarios. So far still good.

Unfortunately when I have multiple partitions with the same classifier (e.g. two customers "A" and "B") I can use an action only once in an activity diagram. Hmmm.

Now I thought: why not using an "instance of an action" which then would be placed inside the according partition. BUT: that does not work. EA will silently ignore the option "An Instance of Element (Object)" with dragging from the project view.

Now my questions:
- Is an "instance of an action" something I could use (from my point of view it's the use of a procedure)?
- Is it a bug that EA doesn't let me create such a thing (an action is an element, isn't it?)?

b.
« Last Edit: June 16, 2010, 07:48:59 pm by beginner »

beginner

  • Guest
Re: Înstance of an action
« Reply #1 on: June 16, 2010, 07:58:56 pm »
Notwithstanding my above question I solved a part of my issues. Obviously you can instantiate activities which then result in actions. So I can use activities instead of actions in the case where I want re-use.

b.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Înstance of an action
« Reply #2 on: June 16, 2010, 09:15:24 pm »
b,

I don't think you can instantiate Actions.
Actions are NamedElements, which are Elements, whereas Activities are Behaviors, who are Classes, who are Classifiers.
According to the InstanceSpecification you need to have a Classifier in order to create an instance of of it.

And indeed, as you already figured out you can use Activities (and call those in the action) if you want to re-use actions.

Geert


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Înstance of an action
« Reply #3 on: June 16, 2010, 09:22:20 pm »
Quote
[size=18]...[/size]
Now I thought: why not using an "instance of an action" which then would be placed inside the according partition. BUT: that does not work. EA will silently ignore the option "An Instance of Element (Object)" with dragging from the project view.
[size=18]...[/size]
- Is it a bug that EA doesn't let me create such a thing (an action is an element, isn't it?)?
EA's behaviour (857) suggests it's a bug.  In 857 it doesn't silently fail, it tries to create another copy of the same action - which fails.  It looks as though the radio button is not actually operating.

Report it.

HTH,
Paolo
« Last Edit: June 16, 2010, 09:23:55 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

beginner

  • Guest
Re: Înstance of an action
« Reply #4 on: June 16, 2010, 10:16:18 pm »
Will do so. If (which is likely true) Geert is right then EA should not offer the option or complain correctly. It seems to ignore the option an paste the element a 2nd time which then fails.

b.

beginner

  • Guest
Re: Înstance of an action
« Reply #5 on: June 16, 2010, 10:29:39 pm »
To the Sparxians which eventually will fix this. Here's more:
- create an action inside an activity diagram
- notice that Advanced from the context has 3 entries
- move the action so it is located under an actor.
- again open the Advanced context menu
-> now it has a different context (4 entries) and you can choose "Convert linked Elements to Local Copy"
(almost what I wanted, but this definitely looks like another bug)
- choose this very option
-> indeed it creates a local copy but it's not classified. It's a simple copy. Which is probably right according to Geert, but it should not have been offered as option here.


b.
« Last Edit: June 16, 2010, 10:33:09 pm by beginner »

beginner

  • Guest
Re: Înstance of an action
« Reply #6 on: June 16, 2010, 11:10:08 pm »
One more question: When I instantiate an activity which has action pins, how do I get EA to show these on the instantiated action? I suppose there should be a way to make them visible.

[Edit1] When I do similar things with classes the embedded elements will be copied into the instance. So I suppose this is a bug and EA should copy the action pins to the activity instance?

[Edit2] Seems I opened a can of worms here. I have another bug. Related to my other post about Advanced Properties. When you set the kind property for an instantiated activity to AccceptCall it hides the name of the element (just a flag is shown). I will not post separate bug reports. I already have too many open issues with Sparx.


b.
« Last Edit: June 16, 2010, 11:32:34 pm by beginner »