This project has moved and is read-only. For the latest updates, please go here.

User Documentation

This a documentation on how to use KangaModeling. For documentation on how to contribute to KangaModeling please refer to the Developer Documentation


More Samples

Kanga Sequence Markup Tutorial

The "language" we use to describe sequence diagrams is based on markup used by http://www.websequencediagrams.com. It is very compact and simple, therefore the compromise made is that the language has no formal syntax and can not be formalized in terms of EBNF.

Using Kanga.Sequence you must not care about layout of diagram. You just describe lifelines, calls, operators and the tool chooses optimal alignment for you.

Signals

There are two kinds of signals call A->B and return B-->A.

A->B
B-->A


Note that you can skip lifeline declarations using participant statement if you used a signal statement.
Tutorial2.png

Order of Lifelines

Order of lifelines is defined by order of their occurring in code. Nevertheless you can enforce different order by declaring them in explicit order using participant statement.

participant B
participant A
A->B
B-->A


Tutorial3.png

Activation

Usually a call leads to lifeline activation. Nevertheless sometimes it is more relevant to show communication between components, thus we decided to provide dedicated statements for activation and deactivation.

A->B
activate B
B-->A
deactivate B


Tutorial4.png
Note that self calls and activations are also supported:

A->A
activate A
deactivate A


Tutorial5.png

Texts

Lifeline Alias participant Long name as A

Sometimes you want to give a lifline some descriptive name. It might be long and boring to type it again and again when using in code. So you are able to create an alias using participant declaration.

participant Some component with long name as A
A->B
B-->A


Tutorial6.png

Diagram Title

title Diagram 1
A->B
B-->A


Tutorial7.png

Signal Name

A->B : call
B-->A : return


Tutorial8.png

Multiline Text

Use \n to enforce the line break.

title Title line 1\n line 2
participant A line 1\n line 2 as A
A->A : call line 1\n line 2


Tutorial9.png

Escaping Characters

Some characters like '>', '<, ':' might be ambiguous. Use parentheses to escape them.

"Escaped : name A "-> "Escaped : name B"


Tutorial10.png

Combined Fragments

Currently we support 3 operators alt, opt, loop.

opt

opt Sometimes
A->B
end
}}
Tutorial11.png
Operators may contain any number of interactions and must terminate with end statement. Nested operators are also supported.

loop

loop from 1 to 100
a->B
opt Sometimes
B->C
end
end


Tutorial12.png

alt

Alt statement can have any number of else sections.

alt first 
a->b 
else second
a->c
else third
a->d
end


Tutorial13.png

Dispose or Destroy of Lifeline

Usually a lifeline starts at the top of diagram end ends at the very bottom. End of the lifeline is indicated by cross at the end of the vertical line. Using dispose or destroy statement (they are synonyms - there is no semantic difference between them) you can end the lifeline earlier.

A->B
activate B
B-->A
deactivate B
dispose B
A->C
activate C
C-->A
deactivate C


Note that accessing a disposed lifeline (using it in signal or activation) is not allowed.
Tutorial14.png

Last edited Jun 18, 2012 at 8:03 AM by FlorianGreinacher, version 22

Comments

No comments yet.