Generating UML Sequence Charts: Difference between revisions

No edit summary
Line 15: Line 15:
* a couple (ActorFrom,ActorTo) specifying the name of the actor sending the message (ActorFrom) and the one receiving the message (ActorTo). You can use strings or other values (which will be converted to strings).
* a couple (ActorFrom,ActorTo) specifying the name of the actor sending the message (ActorFrom) and the one receiving the message (ActorTo). You can use strings or other values (which will be converted to strings).
* a triple (ActorFrom,ArrowStyle,ActorTo), where the actors are like above and ArrowStyle is a string representing a valid plantUML arrow.
* a triple (ActorFrom,ArrowStyle,ActorTo), where the actors are like above and ArrowStyle is a string representing a valid plantUML arrow.
* a triple (ActorFrom,ArrowStyle,ArrowSuffix,ActorTo), where the actors and arrow style are like above and ArrowSuffix is a string representing a valid plantUML arrow suffix.


Currently these arrow styles are supported:
Currently these arrow styles are supported:
* <pre>--></pre>
* <tt>--></tt>
* <pre>-></pre>
* <pre>-></pre>
* <pre>->x</pre>
* <pre>->x</pre>
Line 24: Line 25:


Optionally you can add these suffixes:
Optionally you can add these suffixes:
* <pre>++</pre> (activate the target)
* < tt>++</tt > (activate the target)
* <pre>-</pre> (deactivate source)
* < tt>--</tt > (deactivate source)
* <pre>**</pre> (create an instance of target)
* < tt>**</tt > (create an instance of target)
* <pre>!!</pre> (destroy an instance of target)
* < tt>!!</tt > (destroy an instance of target)

Revision as of 09:07, 24 November 2021

= UML Sequence Charts for Traces

ProB has a new experimental feature to generate a UML sequence chart from the current animation trace. It currently only works for classical B models and you need to copy the plantUML.jar file to ProB's lib folder.


Specifying the Actors

For every B Operation Op that you want to visualise you need to add a definition

SEQUENCE_CHART_Op

in your DEFINITIONS. The definition can take arguments, in which case the actual arguments in the trace are passed to the definition. The definition can take fewer arguments (but not more) than the B operation.

The definition should either return

  • a couple (ActorFrom,ActorTo) specifying the name of the actor sending the message (ActorFrom) and the one receiving the message (ActorTo). You can use strings or other values (which will be converted to strings).
  • a triple (ActorFrom,ArrowStyle,ActorTo), where the actors are like above and ArrowStyle is a string representing a valid plantUML arrow.
  • a triple (ActorFrom,ArrowStyle,ArrowSuffix,ActorTo), where the actors and arrow style are like above and ArrowSuffix is a string representing a valid plantUML arrow suffix.

Currently these arrow styles are supported:

  • -->
  • ->
  • ->x
  • ->>

etc

Optionally you can add these suffixes:

  • < tt>++ (activate the target)
  • < tt>-- (deactivate source)
  • < tt>** (create an instance of target)
  • < tt>!! (destroy an instance of target)