SysML Activity Diagram
Some Basic Semantics
theokahn@gmail.com
1. Does this diagram follow all SysML rules, is it
semantically correct?
2. If it is correct, is it good SysML, is the
modeler’s intent clear?
3. What is the modeler’s intent?
The semantics discussed here are not comprehensive; rather, they are meant to cover only
some of the most common usages. Readers are encouraged to consult additional
documentation to obtain a fuller understanding of the SysML grammar.
Activity Edges
The most basic function of
Activity Diagrams is the
commutation of information
among Actions. This is
accomplished by using either
or both types of activity
edges, as required:
Best Practices
1. Use Object Flows whenever possible as they explicitly specify what is
being communicated between Actions.
2. The two object flow constructs on the right are semantically identical. In
general, the use of pins is preferred as it is more concise and allows for
typecasting, should that be required.
Control and Object Flows
Control Flow
Control flow
activity edge,
dashed line.
Object flow
activity edge,
solid line.
Pin.
Object Flow
Activity Edge Semantics
1. An Action cannot start until all Control and Object tokens are received at the Action edge.
2. When an Action finishes, it provides all Control and Object tokens to their respective flows.
1. When A finishes, it provides
Control tokens to B and C at the
same time.
2. B then starts. When B finishes, it
provides a Control token to C.
3. C now starts as both Control
tokens are available at the Action
edge.
What is the problem with this
diagram?
Discussion
The Activity Diagram on the
left is grammatically correct.
However, the Control Flow
between A and B is
unnecessary as C cannot
start until B finishes.
Perhaps the modeler had a
different intent in mind?
As it is, the left diagram can
be simplified as shown in the
diagram on the right.
Diagram Flow
Merge and Decision Nodes
These nodes address OR conditions
Merge Node
As soon as an
input token
arrives it is
offered to the
output edge.
Multiple inputs, one output.
When the input token
arrives it is evaluated
and offered to the
output edge meeting
the condition.
Be sure and
use the guard
parameter in
the flow to
specify the
constraint.
One input, multiple outputs, but only one at a time.
Decision Node
Join and Fork Nodes
These nodes address AND conditions
Join Node
Multiple inputs, one output. One input, multiple outputs.
Fork Node
As soon all
input tokens
arrive, they
are offered to
the output
edge.
The output
contains
object tokens
from all
inputs.
When the input
token arrives it
is offered to all
output edges.
Question 1
What is the problem
with this diagram
and what might you
do to correct it?
Answer 1
What is the problem
with this diagram?
This Action requires two
control tokens to execute
but the second token can
only be generated by the
Action’s execution. So the
Action never starts.
What might you do to
correct the problem?
Add a Merge Node. It
offers the control token to
the output edge whenever
it receives any (one) input
control token.
Question 2
Diagram A Diagram C
Discuss the differences between
Diagrams A and B. Is one better
than the other? How is Determine
Flight Range affected?
Discuss the differences between
Diagrams B and C. Is one better
than the other? How is Determine
Flight Range affected?
Diagram B
Answer 2
Diagram A Diagram B Diagram C
The two Diagrams A and B represent two possible methods
for determining flight range. As such, there is no correct
diagram. Modelers need to produce diagrams representative
of the system as designed. And obviously, the flight range
calculation is different for each diagram. Diagram A
calculates the range based on one tank at a time whereas
Diagram B calculates the range based on both tank weights.
The two diagrams B and C are semantically identical
and the flight range calculations are the same: As
such, modelers are free to choose the representation
they feel is visually most appealing. Note that the fork
has additional semantics allowing modelers to specify
a subset of tokens before the output token is offered.

Basic SysML Activity Diagram Semantics

  • 1.
    SysML Activity Diagram SomeBasic Semantics theokahn@gmail.com 1. Does this diagram follow all SysML rules, is it semantically correct? 2. If it is correct, is it good SysML, is the modeler’s intent clear? 3. What is the modeler’s intent? The semantics discussed here are not comprehensive; rather, they are meant to cover only some of the most common usages. Readers are encouraged to consult additional documentation to obtain a fuller understanding of the SysML grammar.
  • 2.
    Activity Edges The mostbasic function of Activity Diagrams is the commutation of information among Actions. This is accomplished by using either or both types of activity edges, as required: Best Practices 1. Use Object Flows whenever possible as they explicitly specify what is being communicated between Actions. 2. The two object flow constructs on the right are semantically identical. In general, the use of pins is preferred as it is more concise and allows for typecasting, should that be required. Control and Object Flows Control Flow Control flow activity edge, dashed line. Object flow activity edge, solid line. Pin. Object Flow
  • 3.
    Activity Edge Semantics 1.An Action cannot start until all Control and Object tokens are received at the Action edge. 2. When an Action finishes, it provides all Control and Object tokens to their respective flows. 1. When A finishes, it provides Control tokens to B and C at the same time. 2. B then starts. When B finishes, it provides a Control token to C. 3. C now starts as both Control tokens are available at the Action edge. What is the problem with this diagram? Discussion The Activity Diagram on the left is grammatically correct. However, the Control Flow between A and B is unnecessary as C cannot start until B finishes. Perhaps the modeler had a different intent in mind? As it is, the left diagram can be simplified as shown in the diagram on the right. Diagram Flow
  • 4.
    Merge and DecisionNodes These nodes address OR conditions Merge Node As soon as an input token arrives it is offered to the output edge. Multiple inputs, one output. When the input token arrives it is evaluated and offered to the output edge meeting the condition. Be sure and use the guard parameter in the flow to specify the constraint. One input, multiple outputs, but only one at a time. Decision Node
  • 5.
    Join and ForkNodes These nodes address AND conditions Join Node Multiple inputs, one output. One input, multiple outputs. Fork Node As soon all input tokens arrive, they are offered to the output edge. The output contains object tokens from all inputs. When the input token arrives it is offered to all output edges.
  • 6.
    Question 1 What isthe problem with this diagram and what might you do to correct it?
  • 7.
    Answer 1 What isthe problem with this diagram? This Action requires two control tokens to execute but the second token can only be generated by the Action’s execution. So the Action never starts. What might you do to correct the problem? Add a Merge Node. It offers the control token to the output edge whenever it receives any (one) input control token.
  • 8.
    Question 2 Diagram ADiagram C Discuss the differences between Diagrams A and B. Is one better than the other? How is Determine Flight Range affected? Discuss the differences between Diagrams B and C. Is one better than the other? How is Determine Flight Range affected? Diagram B
  • 9.
    Answer 2 Diagram ADiagram B Diagram C The two Diagrams A and B represent two possible methods for determining flight range. As such, there is no correct diagram. Modelers need to produce diagrams representative of the system as designed. And obviously, the flight range calculation is different for each diagram. Diagram A calculates the range based on one tank at a time whereas Diagram B calculates the range based on both tank weights. The two diagrams B and C are semantically identical and the flight range calculations are the same: As such, modelers are free to choose the representation they feel is visually most appealing. Note that the fork has additional semantics allowing modelers to specify a subset of tokens before the output token is offered.