Book a Demo

Author Topic: Actions and Class Operations  (Read 4555 times)

mikegill

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Actions and Class Operations
« on: January 16, 2007, 06:46:22 am »
I can drag a class operation onto an activity diagram and it creates a CallOperation Action and correctly puts the class name in parentheses followed by two colons ( ClassName:: ) beneath the operation / action name.

However when I create an action directly on an activity diagram of this kind it places the two colons in parentheses beneath the name but doesn't allow me to specify a class name, or at least I can't find out anywhere to do this.

Does anyone know whether this is possible?

According to the UML 2.1 Superstructure specification:

'The name of the class may optionally appear below the name of the operation, in parentheses postfixed by a double colon. If the node name is different than the operation name, then the behavioral feature name may be shown after the double colon.' (page 364)

Neither seems possible when creating an action directly, nor does the latter occur if I change the action (node) name once I've dragged an operation onto an activity diagram.

Any help would be appreciated on this.

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: Actions and Class Operations
« Reply #1 on: January 16, 2007, 06:56:21 am »
It is just missing feature. Report it as a bug. (Inconsistency is a bug.)
Jan 'Bary' Glas

mikegill

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Actions and Class Operations
« Reply #2 on: January 16, 2007, 06:58:07 am »
OK, thanks.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Actions and Class Operations
« Reply #3 on: January 16, 2007, 07:23:18 am »
Quote
It is just missing feature. Report it as a bug. (Inconsistency is a bug.)
Whatever gave you that idea?  ;D

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

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Actions and Class Operations
« Reply #4 on: January 16, 2007, 07:58:12 am »
Hi Mike,

Since I'm currently working with Actions and Activities, your post intrigued me.  You might be interested in what's going on "under the covers" so to speak...
Quote
I can drag a class operation onto an activity diagram and it creates a CallOperation Action and correctly puts the class name in parentheses followed by two colons ( ClassName:: ) beneath the operation / action name.
EA actually uses a "trick" in order to do this...  In t_object, EA has a column named Classifier_guid.  Normally, this is not used.  However, for Action objects it provides the GUID of the Operation in t_operation for which this action is an embodiment.  So technically, you can't just add a Class to an Action, you actually have to establish a mapping between the Action and an Operation in a Class.  The ClassName:: part of the name comes by derivation from the Operation.
Now, an Operation is, by definition, NOT a Classifier... But what's a naming inconsistency between friends? ;)
Quote
However when I create an action directly on an activity diagram of this kind it places the two colons in parentheses beneath the name but doesn't allow me to specify a class name, or at least I can't find out anywhere to do this.

Does anyone know whether this is possible?
I suspect, Sparx may come back and say you aren't allowed to set the Class  (alone) for the reason I've outlined above.  However, there should be an option to Map Action to Operation.  This should probably bring up a dialog that allows you to select a Class and then the Operation within it (and should include the option to add an Operation with (by default) the name of the Action to the selected Class).
[size=0]©2007 Paolo Cantoni, -Semantica-[/size]

Quote
According to the UML 2.1 Superstructure specification:

'The name of the class may optionally appear below the name of the operation, in parentheses postfixed by a double colon. If the node name is different than the operation name, then the behavioral feature name may be shown after the double colon.' (page 364)

Neither seems possible when creating an action directly, nor does the latter occur if I change the action (node) name once I've dragged an operation onto an activity diagram.
This is actually possible.  If you reload the diagram after you've changed the name of a dragged operation, EA will follow the Specification and provide the additional name as required.  EA often appears to have a problem with refresh.
Quote
Any help would be appreciated on this.
Hopefully this has illuminated the issue a bit.
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

mikegill

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Actions and Class Operations
« Reply #5 on: January 16, 2007, 08:35:11 am »
Hi Paolo,
Thanks for the info.

Yes you're right about the refresh and on reloading the original operation name does appear, which is great!

Your explanation of how EA accommodates this notation clarifies why the software behaves as it does and your solution (being able to specify or create an operation while adding an action) would be extremely elegant!

We are going to document business processes using structured activities and actions. However I would like to build up responsibilities (operations) on business workers (classes) either by the communication diagram route or the activity diagram route depending on the situation and / or target audience. The communication diagram route is well-established but having the ability to either select an operation or add one from an action would enable us to build up responsibilities on business workers irrespective of diagram chosen. These business workers and responsibilites can then be reused on both diagram types.

I did (rather hastily in retrospect) report this as a bug, although phrased it in the context of a feature request if the behaviour was by design.

Anyway thanks for your help and I might come calling again as we progress down this road.

Cheers

Mike

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Actions and Class Operations
« Reply #6 on: January 16, 2007, 03:17:55 pm »
[size=13][Edits appear in red below][/size]
Quote
[size=13][SNIP][/size]
Your explanation of how EA accommodates this notation clarifies why the software behaves as it does and your solution (being able to specify or create an operation while adding an action) would be extremely elegant!
Thanks for that...  There's no reason why workable solutions shouldn't be elegant as well.
Quote
[size=13][SNIP][/size]
I did (rather hastily in retrospect) report this as a bug, although phrased it in the context of a feature request if the behaviour was by design.
If it's by design, it's BAD (Broken as Designed),   The essence of the CallOperation Action is that it references (by invocation) an Operation in a Class.  In many ways one could consider it an alternate rendering.  As I mention in my "discussion" with Neil (KP) in [size=13]Action doesn't have rectangle notation[/size], I view an Action more as a Feature (in the case of CallOperation it is directly an Operation) than as a Classifier and so it shouldn't be in t_object.  Nevertheless, any Element that can be represented standalone in a diagram should be able to be rendered in Compartmentalised Notation (not Rectangular - but again, what's a misname between friends)
Quote
Anyway thanks for your help and I might come calling again as we progress down this road.

Cheers

Mike
No problems, Mike.  You may (if you haven't already done so, want to reference this Topic in your support request.

That way the ongoing discussion can be referenced by Sparx.

For example, there are related BUGS to the problem you've already mentioned.  If you move the operation to another Class, the ClassName changes correctly.  Howe ever, if you change the name of the operation, the name of the action (if it was previously the same) does not change.  This seems to me to be an incorrect level of coupling between the CallOperation Action and the Operation itself.

Paolo
« Last Edit: January 17, 2007, 09:18:24 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Actions and Class Operations
« Reply #7 on: January 17, 2007, 09:42:30 pm »
Following on from the changes in the previous post, a formal coupling exists between a CallOperation Action and its invoked Class Operation.

An additional menu item: <context menu>|Invoked Operation Properties needs to added to assist in maintaining related information in the two objects.

On the Operation side, <context menu>|Find invoking CallOperations is required.

I will add a more complete analysis in a separate post.  The above is a minimum requirement.
Paolo
[size=0]©2007 Paolo Cantoni, -Semantica-[/size]
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!