gaphor icon indicating copy to clipboard operation
gaphor copied to clipboard

Ability to set owned behavior to Use Case

Open sz332 opened this issue 2 years ago • 9 comments

Is your feature request related to a problem?

During modeling, when refining a Use Case, a modeler allocates behaviors describing a use case. Those behaviors are described using state machines, sequence diagrams, etc.

Describe the solution you'd like

  • I would like to allocate behavior(s) to a Use Case (diagram being a BehavioredClassifier).
  • I would like to navigate to the diagrams of those behaviours from the use case some way.

sz332 avatar Jul 27 '23 07:07 sz332

I would like to allocate behavior(s) to a Use Case (diagram being a BehavioredClassifier).

Is this similar to CallBehaviorAction?

For reference: image

"A UseCase specifies a set of actions performed by its subjects, which yields an observable result that is of value for one or more Actors or other stakeholders of each subject." [UML2.5.1,p649,https://www.omg.org/spec/UML/2.5.1/PDF].

marek-piirikivi avatar Jul 28 '23 03:07 marek-piirikivi

image

Basically each usecase is a BehavioredClassifier, means you can connect behaviors to it using the ownedBehavior property. Among those there is one classifierBehavior.

A Behavior is an abstract class and it has specializations:

image

And yes, you are right, it is the same type (Behavior) that we have for CallBehaviorAction.

image

That means, if we have a common component (behavior(s) selector) then it can be used for this purpose.

sz332 avatar Jul 28 '23 03:07 sz332

This ticket also has the same problem of how to select one or multiple model elements in the properties settings, because this component is missing.

sz332 avatar Aug 08 '23 15:08 sz332

@sz332 How is this handled by other tools? Let's research this.

marek-piirikivi avatar Aug 08 '23 16:08 marek-piirikivi

  • You can press right mouse button on the use case, and a popup is displayed.
  • You can select the corresponding diagrams (Sequence, Activity, State machine).
  • The corresponding model element (interaction, activity, etc.) is added as a behavior to the use case.
  • You can add multiple diagrams, therefore multiple behaviors.

Remaining question:

  • What about removal?

sz332 avatar Aug 08 '23 16:08 sz332

@sz332 What about the way you can add, remove relationships in Jira?

You can just press + and then a dropdown option appears. And then you can see list of the relationships you have already added and just click (x) to remove it.

marek-piirikivi avatar Aug 20 '23 17:08 marek-piirikivi

@danyeaw can we involve the UI/UX guy who helped us previously?

sz332 avatar Aug 20 '23 18:08 sz332

I think we need to mock up or propose something using GTK or libadwaita widgets, then we could get feedback on the mockup.

danyeaw avatar Aug 21 '23 01:08 danyeaw

I'll reference this one https://github.com/gaphor/gaphor/pull/2665 purely because I described another feature that I think we should take into the consideration.

"Ideally, I would like to preserve the option to create the behavior when it does not exist on the property page; or defer its creation at the later point and just keep it as a text."

So:

  • you can still just write text and if you do not select anything from the model browser, it just keeps the text and does not create the element.
  • you can also at any time go back and finally select "Create element"; or select already existing one.

It is also aligning well with the ability to defer creating correct model to prevent interruptions in the flow.

Moreover, drag&drop would additionally be something that we may want to consider. Think: we can drag behavior from the model browser into the behavior selection. Later we can also expand this by giving an ability to drag the behavior directly on the diagram item.

Just some thoughts :slightly_smiling_face: @danyeaw @sz332

marek-piirikivi avatar Aug 21 '23 04:08 marek-piirikivi