This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
v070:layout [2018/10/05 22:08] djnemeth [Diagram Language Guide for version 0.7.0] |
v070:layout [2018/10/08 09:08] (current) djnemeth [Execution] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Diagram Language Description for version 0.7.0 ====== | ====== Diagram Language Description for version 0.7.0 ====== | ||
- | In txtUML, class and state machine diagrams can be defined to visualize model structure and behavior. To express test cases for expected communication, sequence diagrams can be used. | + | In txtUML, class and state machine diagrams can be defined to visualize model structure and behavior. Moreover, test cases for expected communication can also be specified in the form of sequence diagrams. |
===== Class and State Machine Diagrams ===== | ===== Class and State Machine Diagrams ===== | ||
Line 195: | Line 195: | ||
==== General structure ==== | ==== General structure ==== | ||
- | A sequence diagram description is a Java class inheriting from class ''SequenceDiagram''. | + | A sequence diagram description is a Java class inheriting from class [[http://txtuml.inf.elte.hu/releases/txtuml-v070/api/java/hu/elte/txtuml/api/model/seqdiag/SequenceDiagram.html|SequenceDiagram]]. |
Lifelines can be defined as class members in a diagram description. To give an ordering between them on the generated diagram, the ''Position'' annotation can be used. | Lifelines can be defined as class members in a diagram description. To give an ordering between them on the generated diagram, the ''Position'' annotation can be used. | ||
Line 208: | Line 208: | ||
* ''Sequence.send(from, msg, to)'': **from** is expected to send a message to **to** which is equal to **msg**. | * ''Sequence.send(from, msg, to)'': **from** is expected to send a message to **to** which is equal to **msg**. | ||
- | * ''Sequence.fromActor(msg, to)'': **msg** should be sent to **to** by an actor. | + | * ''Sequence.fromActor(msg, to)'': **msg** should be sent to **to** by an actor. Reaching this call, the sequence diagram executor actually sends the message to the target. |
* ''Sequence.assertState(obj, s)'': immediately after the target of the most recent ''Sequence.send'' or ''Sequence.fromActor'' call has received the message, **obj** is in state **s** (also see [[v070:layout#Condition evaluation during execution]]). | * ''Sequence.assertState(obj, s)'': immediately after the target of the most recent ''Sequence.send'' or ''Sequence.fromActor'' call has received the message, **obj** is in state **s** (also see [[v070:layout#Condition evaluation during execution]]). | ||
Line 240: | Line 240: | ||
==== Execution ==== | ==== Execution ==== | ||
- | The execution of the diagram can be configured by setting the execution mode. For this purpose, the ''ExecutionMode'' annotation of the ''run'' method can be used. | + | The execution of the diagram can be configured by setting the execution mode. For this purpose, the ''ExecutionMode'' annotation can be used on the ''run'' method . |
- | Regardless of the chosen mode, the entire messaging defined in ''run'' should happen in the model during the execution. ''ExecMode.STRICT'' does not allow any other communication, while ''ExecMode.LENIENT'' does. | + | Regardless of the chosen mode, the entire messaging defined in ''run'' should occur in the model during the execution. ''ExecMode.STRICT'' does not allow any other communication, while ''ExecMode.LENIENT'' does. |
=== Condition evaluation during execution === | === Condition evaluation during execution === |