Author Topic: How to specify that an operation or a reception is linked to a behavior  (Read 326 times)

Miguel

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
I'm on EA15.1 build 1528.  SysML:

I keep my structural model separate from behaviors, just to make it easy to find all the behaviors together (customer desire).  I have defined a block with an operation foo().  I have a behavior in another package called foo activity.  Is there a way for me to link the foo() operation with the foo activity in SysML/EA?  I just want to indicate that this activity is what happens when foo() is called.

Similarly, I have a reception of a signal called Bar Signal on the same block.  I have another activity that will be executed upon receipt of that signal by the block.  How do I link that activity to the reception?

Thanks,
Miguel.


qwerty

  • EA Guru
  • *****
  • Posts: 11121
  • Karma: +262/-246
  • I'm no guru at all
    • View Profile
Usually (in UML) you instatantiate an operation so it becomes a call behaviour (sort of an action). That will be placed in AD of an activity. This way you have a direct link between the static operation and the invocation(s).

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7212
  • Karma: +83/-10
    • View Profile
If you open the properties dialog for an operation or reception to the behavior page you can select a behavior as a definition. In recent versions of EA that's also available as the "Referenced Behavior".

In UML terms I think that's specified with an association called "operation".
Eve

support@sparxsystems.com

Miguel

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Thank you both for responding.  Eve, yes, that worked, although I was not able to do it FROM the Referenced Behavior property.  If I click the ... next to Referenced Behavior, I couldn't navigate to the behavior.  Instead, I had to go to the Operation or Reception Properties->Behavior, select the specific element, and only then did it appear as the Referenced Behavior.  I suspect that's a bug, but the important things is that I was able to get it to work, the long way around.

Just to note it for others encountering this, when I originally tried to click the ... next to Referenced Behavior, I got the following dialog with no way to get to the Activity:





But if I went to the Operation or Reception properties->Behavior, I got the same dialog but with the full model browser to select from:




Anyway, thanks again for the help.


--Miguel.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7212
  • Karma: +83/-10
    • View Profile
Actually the Referenced Behavior property is the correct one.

The other end of the association is define as follows. (Emphasis mine)

Quote
specification : BehavioralFeature [0..1] (opposite BehavioralFeature::method)
Designates a BehavioralFeature that the Behavior implements. The BehavioralFeature must be owned by the
BehavioredClassifier that owns the Behavior or be inherited by it.
The Parameters of the BehavioralFeature
and the implementing Behavior must match. A Behavior does not need to have a specification, in which case it
either is the classifierBehavior of a BehavioredClassifier or it can only be invoked by another Behavior of the
Classifier.

The reception properties dialog behavior goes back to before EA knew of that constraint, and still provides a way to override the valid list.
« Last Edit: July 02, 2020, 09:48:12 am by Eve »
Eve

support@sparxsystems.com

Miguel

  • EA User
  • **
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Thanks, Eve.

So, it has to be an owned behavior.  The only way I know to do that is to have the Activity or Reception element to be defined directly IN the block.  Is there another way to define a behavior as being owned by a block?  I do like having all the behaviors together outside of the block definitions.  I get that others like it inline, but like I said before, customer preference to have them all together under a "Behaviors" package.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10129
  • Karma: +326/-30
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
I'm afraid "owned" really means "inside the owner object".

If it would be in a "Behaviors" package they would be owned by that package, not by the block.

Geert

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7212
  • Karma: +83/-10
    • View Profile
The good news is that EA isn't enforcing the ownership rule. It's just making it a little harder to select a behavior that doesn't obey it.

On the other hand, if what you really want is all activities available in one place you could define a model view or a search to provide that regardless of where the actual owner is.

Finally, it did occur to me that you could put the behaviors in a more general block (generalization from the block owning the operation to the block owning the activity). You could then move all the blocks that contain activities to your separate package. Unfortunately from my quick reading of the spec and what I see, EA is not allowing selection of those types.
Eve

support@sparxsystems.com