I have drawn an activity diagram to depict my project. Please, could anyone tell whether it is correct or wrong?
The diagram has the following errors:
The start node should be a filled circle (you have an open circle).
The end node should have a filled inner circle, like a bull's eye.
If an action has more than one outgoing arrow, then this means that all outgoing paths are traversed simultaneously. In your case, you want only one path at a time. Use a decision symbol (diamond) in between Login and the subsequent actions.
All actions should have at least one outgoing arrow. This arrow should go back to the decision symbol you forgot to draw (see 3).
The two arrows to the end node mean that the activity ends if both paths have been traversed. In your case, you want the activity to end if either of the paths has been traversed. Use a merge symbol (diamond) for that.
Related
I am trying to connect cloned nodes (rects and ellipses) using the diagram connectors tool. I want the paths to connect the bounding boxes of the nodes, in order to show the line marker (arrow tip).
As mentioned in this bug report, connecting cloned objects with diagram connectors does not work as intended. What I've found to work better is to convert the objects to paths. Then, the diagram connectors usually work as they should.
That is, until they do not. In this example all nodes (as paths) are vertically aligned and the paths connect to the center points. If I nudge the rectangle slightly to the right (right arrow key), the paths snap to the bounding boxes. See here. There are more placements in which the arrows show desired/undesired behaviour. In particular, if the nodes are placed diagonally from each other.
Is this where Inkscape hits its limitations or can I somehow produce the desired behavior? I'd like to (1) use clones so I can apply changes to my design globally and need to (2) flexibly (re)layout the diagrams I'm drawing without having to manually adjust all paths.
Big thanks in advance
I am doing a UML sequence diagram and I've got like, say, a GUI Controller object who wants to create a new Circle object and then add it to an ActiveDrawables object. Would the diagram in the picture below be correct? Or should I've sent the add() from like the Circle's lifeline (thought this seems kind of weird)?
In code, for example, the Controller would have been the one calling add, like in the picture, but I was having doubts whether I should have sent the message from the Circle's lifeline (though, again, this seems weird).
Of course it depends on your design, but what you have drawn is the usual approach.
The other approach (with Circle contacting ActiveDrawables) is sometimes used as well, e.g.
when all Circles has to be in the same ActiveDrawables,
for efficiency reasons GUIController might pass ActiveDrawables identifier to Circle to create it immediately in ActiveDrawables
if Circle needs to be always attached to ActiveDrawables you may also pass identifier like in previous point
Few things to consider about your diagram:
You don't have to number your messages. It's a technology used in communication diagram rather than in sequence diagram.
The last message seems to be a return (reply) from the previous one. You should use a different arrow for that.
Instead of Circle name the lifeline c1: Circle. Then you'll have an object c1 of type Circle. Then in add operation you can use c1 showing precisely that your passing the newly created Circle object, not just some Circle.
I was reading about statechart diagrams, which are diagrams that model the different states that one or more instances of one or more classes can be.
An object can go from one state to the other through a transition, which is represented using arrow with an event and eventually a action to that event over and respectively below it.
My problem now is that I don't understand exactly what are OR and AND decompositions in a statechart diagram. Could you please give me an explanation (since I've not found around any)?
I would really appreciate a concrete example with the corresponding picture or diagram.
The following picture is an example for an OR. Consider a token traveling from Initial to the Choice (diamond). Here the token travels either to the left or right guided by the constraints which test the condition checked in Choice. From then where they are they next transit through the following unnamed diamond to Continued. You might leave away the joining diamond and draw the transitions directly to Continued.
The AND condition looks like this:
The first Fork(the bar) duplicates the token and sends them to Either and Or. The Join behind these states waits for two tokens to arrive before it sends only one token further to Continued.
Fork and Join use the same symbol. They wait until all incoming tokens arrive and then send as many tokens as there are outgoing transitions. So they are actually some split personality. But mostly they are used the one or the other way.
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.
I'm using Dia to make a sequence diagram and I need to make a lifeline with two (or more) execution specification, like the image below:
(What I want is inside the green circles)
How can i do that?
You can simply stack two Lifeline elements on top of each other. The top of the second lifeline can be connected to the end of the execution (the grey area) in the first lifeline.