in an activity dgm .. if an activity involves two sub activities..
should i make separate ending nodes for sub activities?
Should I make one ending node for main activity only ?
This is what i wants to say
Well, I would say that setting one ending node for your main activity can be enough. The ending node represent the termination of the whole activity you depict in your diagram. Thus the ending nodes as you put them are clearly invalid.
You can however describe ViewDetails and EditDetails with sub-activities. It that case, you can also terminate them with an ending point. In that case the ending is in the context of your activity. See here.
Personally I would create distinct diagrams for such a purpose but it seems that it is possible to represent this inside an action.
The diagram You have drawn so far is wrong. Activity diagrams represent the flow of control from activity to activity in the system.In your diagram "My profile" should not be an activity.And you need to represent activities in rounded rectangles.You can make decision point to separate the "view details" activity from the "Edit details" activity. Typically there is one starting point for the workflow and there may be more than one ending point. (one for each alternate flow in the workflow)
Related
We've been asked to create an activity diagram to illustrate the occurrence of one non-trivial action of an app we're creating.
Should an activity diagram show all possibilites of an activity, or just those actions undertaken in the specific activity?
For example, let's say the activiy diagram is about processing an order for an item through your app...should the diagram have an decision action or an interrupting edge that says "Order cancelled?" (Yes/No) or should it simply show what happens when a successful order is completed?
Should Activity Diagram show just the actions required to complete? Simply yes. You do not create a single AD for a model but as many as needed. So a single AD focuses on a certain (part-) scenario.
I would like to create an activity diagram in which one of the actions is depicted with its sub-actions.
To better clarify I would like to be able to depict something like the following diagram
The problem in my case is that SubActivity1 does not have any input parameter. I just want SubActivity1 to start its execution when OpaqueAction1 is completed.
I know that it is possible to use a CallBehaviorAction to express that an Action will result in the execution of another Activity like in the following diagram
But, in this way I cannot depict the sub-actions in the same activity diagram.
I also thought of using a StructuredActivityNode like in the following diagram
here the problem is that I am not able to show the name of the StructuredActivityNode. I do not know whether this is an issue of the tool that I am using (Papyrus) or it is a general issue.
What you always can do it to use diagram frames and place them inside an activity:
If you need to pass parameters and make use of them inside an activity you can do it this way:
The action pin on Action1 takes the parameter to process it. As you see, you can also place the contents of an Activity manually inside its frame.
An activity is completed when it has reached its last action. More explicitly you should use a flow final to show that. I omitted it in the first example since your examples lacked it. But I usually place it at the end of each (sub-)flow.
I would like to represent the following in a UML Activity Diagram
1) User requests a product list from Application
2) Application requests product list from Database
3) Database returns product list to Application
4) Application displays list to User
Originally I thought this would be a simple case of arrows travelling from left to right connecting to each activity boxes then drawing arrows back all the way to the where the request started as follows:
User-->Application-->Database
User<--Application<--Database
But then I noticed I see no examples of UML Activity Diagrams with arrows showing the return of anything back to a requester. They all show a one way path to an end point. Is a return always implied if it started with a request to get something? Are return arrows incorrect to use?
Thanks in advance.
Update ---
After some looking around it appears paths are one way. When you reach the end point that is to provide something like a list instead of drawing arrows all the way back to the requester it looks to me like you just add a phrase to the end node saying something like the following: "Return list".
It seems you may not understand the token semantics in activities. An activity diagram does not represent a call stack where one action returns to the previous action. However, one action calling another Call Behavior Action does work like a call stack.
The way an activity diagram works is that each action is a step. A completed action offers tokens to outgoing edges. As soon as any action is offered all the tokens it needs to start, it actually starts. Data and control both work this way.
You can think of each action like a function call. When all tokens are ready on all incoming edges, the function is invoked. When a function finishes, all the outgoing tokens are offered to all enabled outgoing edges. (Outgoing edges are enabled when an optional guard is not false.)
I recommend you read the excellent series by Conrad Bock to be sure you understand how activities work. Otherwise, you are going to frustrate yourself and others trying to make it fit your preconceptions.
There's nothing stopping you from introducing loops in an activity diagram, although for clarity, whenever you've got two or more possible exits from one activity, you should use guards on your connectors to specify under which condition that connector may be followed (eg [x < 10] on one and [x >= 10] on the other).
You can also use decisions (rhomboid) if you want to make the branching condition explicit (eg a decision named "x < 10 ?"); you'd then draw a single connector from the preceding activity to the decision, and the two guarded connectors from the decision.
But from your example it seems you're not drawing a proper activity diagram at all. In an activity diagram, the nodes must be activities -- not actors. There should always be a verb in the name of every activity. So "User requests a product list from Application" is a good activity, but if you've got an activity named "User" you're doing it wrong.
My Question may be simple, but I am confused because I have no idea about activity diagrams.
My question- Are multiple end points ever acceptable in an activity diagram?
It's a bit touchy to reference IBM though they are one of the big OMG parents. The "truth" is written in OMG's superstructures.
Actually UML2.5 talks about Final Node in the context of activity diagrams:
Final Nodes
A FinalNode is a ControlNode at which a flow in an Activity stops. A FinalNode shall not have outgoing ActivityEdges. A FinalNode accepts all tokens offered to it on its incoming ActivityEdges.
There are two kinds of FinalNode:
A FlowFinalNode is a FinalNode that terminates a flow. All tokens accepted by a FlowFinalNode are destroyed. This has no effect on other flows in the Activity.
An ActivityFinalNode is a FinalNode that stops all flows in an Activity ...
A ControlNode is a kind of ActivityNode and those form Activities. The definition except in the context of the FinalNode does not tell how the single ActivityNodes can be related. So from that you can have as many as you like/need.
Yes, there may be cases where multiple endpoints are acceptable.
It is possible for an activity diagram to show multiple final states.
Unlike initial state symbols, of which there can be only one on an
activity diagram, final state symbols can represent the termination of
one of many branches in the logic -- in other words, the activity may
terminate in different manners.
https://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep03/f_umlbasics_db.pdf
(Page 5)
Other Resources-
http://iswwwup.com/t/08d7e57730dc/uml-do-activity-diagrams-always-end-in-one-endpoint.html
https://softwareengineering.stackexchange.com/questions/215071/do-activity-diagrams-always-end-in-one-endpoint
My activity diagram would be too big and complex, so I decided to split it into many diagrams. I replaced one branch with another diagram and I linked it into the first diagram, which looks well. I designed the second diagram but I do not know, how to start it.
I think that there must be link to the first diagram. But is it enough or shall there be initial activity (circle) before it? See attached images.
On the contrary, the initial node is excessive on the second diagram. It is already included in the start activity. It is OK to say that the whole activity diagram is an activity in another activity diagram. Look at starting diagram here - a group of activities is concluded in activity frame, as a larger activity.
Also think about using Interaction overview diagram. It is just for showing structured activity diagrams.