Wednesday, December 22, 2010

Modelling in WebSphere Lombardi: parallel paths and tokens

When modelling a process in the Lombardi authoring environment, it is possible that different paths are executed in parallel.
You can implement this using a gateway, as done here:

Running this process, will result in three process threads. In Lombardi they call these threads "tokens".
Using the inspector, the different tokens are visualized with red markers:
  (there is a bug here, activity 3 has no red marker, while it should have).

And you can see the different tokens in the execution state view:

 A process will end, when all tokens have finished an End Event, or when one token reaches a Terminate Event.

There are other ways to create and finish tokens. Using Intermediate Message Events you can start a new token somewhere else in your process, while releasing or not releasing previous tokens.

In this next example, an Intermediate Message Event will create an extra thread. If the "Close Attached Activity" property is not checked, the token in activity 1 will not move to activity 2 when the message arrives, but a second token will be created. This second token will move along the wire to activity 2.
If the "Close Attached Activity" is checked, the token will move along the wire. No new tokens will be created.

This is the result when testing this process in the Inspector:
When in activity 1, the message was sent. A new token moved to activity 2, the token that was at activity one stayed there. Again, there should be another red marker for the token in activity 1.