I am still new to SysML and UML and the simulation of those diagrams. I am using Cameo Systems Modeler 19.0.
Context: My problem concerns the continuous simulation of an activity diagram in which a state machine diagram is nested. In the activity diagram I have a Call Behaviour Action which calls the state machine diagram. After this call behaviour action there are other actions to be executed. When I simulate the activity diagram the simulation switches to the called state machine diagram without any problem. Also the simulation of this state machine diagram is fully functional.
Now onto my problem: When I finalize the simulation of the state machine diagram by choosing states, path and their triggers so that I get to the Final State Node, it terminates the simulation of the State Machine Diagram (as expected). But the simulation won't continue executing in the parenting activity diagram.
Am I doing something wrong? Are you not supposed to be able to simulate these kinds of diagrams nested like that? Am I expecting something of Cameo Systems Modeler, that this programm just can't do?
Thanks for your help! If my description is not sufficient, I will happily provide a .mdzip as a minimal example!
In UML and SysML state machines, reaching a termination pseudo state means that the scope to which the behaviour that is defined by the state machine is terminated (when it is on the top scope in the state machine diagram). This is treated in different tools diffently. Some tools use (by default or always) the state machines as mester for simulation and when the topmost state machine enters a termination pseudo state the simulation is stoped, even if it was triggered from an activity.
There is a further kind of end pseudo state for state machines, it is called an exit point. Exit points trigger that the current scope is left. And as you dont want to stop your simulation this is waht you could use. An exit point is denoted by a hallow circle with cross.
Thought: Plenty of tools deviate from whats defined in UML and SysML especially when simulating dynamic behaviours. So there might be some special options in Cameo that possibly need some consideration. One solution to some of the tools is that you create a master state machine, that triggers your master activity.
It definetely is a bug. I issued a problem and the support team identified it as such.
Update: it has been fixed
Related
Im new in UML,
I am recently in charge of a web application, this application manages projects through a flow of states. There are multiple users within the application and each of them can intervene in the flow in a certain state.
Therefore I want to represent this information through a state diagram for me and for future developers do not have to ask the same question again.
My question is: How do I represent the different actors in the state diagram and their intervention in each of them?
Do I need to create a different state diagram for each actor?
Is there a diagram to do this that you do not know?
Thanks.
This is my example diagram and how an actor can pass from stateX to stateY
You try to oversimplify your model.
Each actor has certain system functionality that they can run. These single functionalities are called Use Cases (UC) and you present them on a Use Case diagram. This diagram shows which Actor can perform what Use Case but it does not show a relation to a state. While each Use Case can have pre-conditions defining what has to be true before the UC can be performed and post-conditions declaring what will be true if the UC ends successfully (which in your case would both probably be something like "System is in State A"), UC diagram does not support showing pre- and post-conditions. You can always add them in the notes attached to a UC.
To have a clear view of the system State Machine you can use two diagrams. One will be UC diagram, the other one will be State Machine Diagram or to be more specific Protocol State Machine. Then on State Machine you depict which UC causes what system State change while UC diagram provides information which Actor is eligible for running specific UC.
Finally you can use Sequence Diagram if you want to model how specific flow of interactions in the system impact changes of the system state. You can present states and actors on a single diagram here, but it is not designed, cannot and should not be used to depict all possibilities on a single diagram.
Disclaimer
Next part of my answer is opinion based
/Disclaimer
Most probably I would use UC diagram and SM diagram together according to information you've provided.
On the notation
A side note to your diagram - ovals are used only on UC diagram and represent Use Cases. They are not associated with each other, only with Actors.
States are presented as rectangles with rounded corners (both in State Machine Diagram and Sequence Diagram).
As far as I know, UML state machines model the behavior of one element, for example the behavior of one class.
I wonder how to model state machines with two classes which interact.
The state of one class depends on the state of the other class and transition of one state machine may trigger transition of the other state machine.
Do I have to use UML effect? Could an UML effect of one state machine trigger a transition of another state machine?
You can send events between classes to trigger transitions, something like this, for example:
I was wondering if you could help me clarify two aspects regarding multi-instance state machines.
First question
Consider an example state machine SM1 containing one state A:
On the left, transition start creates a new instance of the state machine. Transition stop terminates the instance.
There can be multiple instances of state machine SM1 running in parallel, e.g. 5 instances.
Now, what I want is a transition that would terminate ALL state machine SM1 instances that are running at the given time.
E.g. we create five state machines A and then transition stopALL would terminate ALL of them at once.
Is such behaviour permitted by UML specification? If yes, is there a graphical notation to unambiguously represent such a behaviour? I could not find the answer in the UML specification document.
Second question
Consider a multi-instance state machine SM2 with state A and one transition startStop:
The behaviour of the transition is as follows: upon firing, the transition creates a new instance of SM2 and terminates an existing one.
Is such behaviour permitted by the specification? Is there an unambiguous graphical way to express such a behaviour?
There is no special UML method but standard UML tools are absolutely sufficient. You need to broadcast a terminate signal (on state machine diagram you can represent it by behaviour on a transition that should terminate other instances). Then you just need to model that on terminate reception the state machine goes to final state.
Terminate All Example
Note that the behaviour after slash (/) is a behaviour invoked on a state transition i.e. when a state machine changes it's state into final the behaviour sendStopAllSignal is invoked which in turn should be described on a class diagram (with probably corresponding activity diagram)
Similarly you need to have a receiveStopAllSignal behaviour included in class diagram.
Terminate Existing At Start
This is similar situation - you need to have both sendStopSignal and receiveStopSignal modelled elsewhere.
Note however that such naming convention (sendAbcSignal for behaviour of sending/broadcasting signal Abc and receiveAbcSignal for behaviour as a reaction to Abc signal reception) is quite common, useful and self-explanatory (i.e. you probably won't model a separate action diagrams for those behaviours unless some extra logic is needed there).
I'm using Enterprise Architect version 9, and I'm trying to draw a state machine diagram, in this diagram I want to draw internal operation (do/entry/exit..) as following :
I looked about a solution and all I can find is to draw a self transition and then set the "kind" of the transition to "internal", but it doesn't make any change: transition is still drawn like an external transition and thus the diagram is still wrong/looks wrong :
As I can notice it is not practicable to handle internal triggers in the operations compartment, since the "Action" type for the operation must be entry, exit, or do ("event" is not an option), nor is there any meaningful way to specify the event, since a transition is not an operation.
I'd appreciate any help to solve this.
The entry/exit/do are just stereotyped operations of the state. From the context of the state in the diagram choose Features/Operations. Here your see the Action with you desired entry/exit/do.
Is it "legal" to for the only transition out of a composite state to originate from a decision node as shown in the picture?
http://pokit.org/get/?7358c1cf25ccd026b9ebe528768b0eb5.jpg
Yeah, I know the writing seems like I'm speaking in tongues. :) Apart from that, does the diagram make sense like this and is it valid according to UML rules?
Thank you for your time!
For full UML (2.5) compliance, you would need entryPoint and exitPoint pseudostates when you enter or exit a state. However, these are often not shown when there is no transition to/from a substate or when hierarchical state history is not tracked.
So you would need an entryPoint pseudostate on the Zapoceta state that would act as the "bridge" between the initial point and the Nepotpuna states.
Similarly, you would also need an exitPoint pseudostate in the Zapoceta state that would act as the "bridge" between the choice pseudostate and the Potpuna state.
Also, you would not need an "or" constraint on the transitions between the Obracunata and Placena states. What you would have are different triggers for each transition. Having multiple transitions out of a state machine implies that the transitions' triggers are mutually exclusive.