BPMN 2.0 End of a process

A simple end event

Everything good ends sometime: that includes processes. Before, we’ve constructed processes with a very simple activity flow like in the following figure.

The process involves the selection of a menu item which is communicated to the server.
The process involves the selection of a menu item which is communicated to the server.

Now, this process can be represented in several alternative ways. Send (throwing) or receiving (catching) message events can alternatively be represented by activities with send/receive markers instead. There are multiple markers available:

  • Receive – receive information
  • Reference – reference some other process or information
  • Script – a script doing something or being executed
  • Send – sending, providing some information
  • Service – a service being used or offered
  • User – a user/person doing something
An alternative representation for sending messages
An alternative representation for sending messages

More commonly, if the process ends with throwing a message event, it can be merged:

The message and end event are merged into one.
The message and end event are merged into one.

Process termination

We’ve previously touched upon the concept of a token being instantiated when a process starts – just like a figure which moves across a game board. When the token reaches the end event, it’s consumed; when all tokens have been consumed, the process is terminated and finished.

Our process diagrams so far generally only had one end event; that’s not necessarily always the case in practice: a process diagram can have multiple end events, allowing several alternative endings to a process flow.

You can probably imagine that such process diagrams can quickly grow quite convoluted and that it becomes very important to keep track of the process flow so tokens aren’t “lost”. Remember: only when all tokens have been consumed is the process finished. It’s like in the army – no token is left behind!

BPMN offers a simple concept to simplify this “problem”: it’s the terminating end event. This type of end event looks just like the regular end event but has a black circle in the center.

Lets look at a little more complex example:

Terminating a process with the terminating end event
Terminating a process with the terminating end event

So, what’s going on here?

  1. We’re looking at the menu
  2. Next, if we didn’t find anything of interest, the process ends.
  3. If we did find something, the process instantiates a second token – sends the first one to the right and the second one downwards (or vice versa).
  4. The token going down,
    • goes on and leads us to printing out a detailed item description,
    • moves into the merging gate and waits for the other token to arrive
  5. In the meantime, the token which went to the right,
    • selects the particular item of interest, which in turn gives us information about availability
    • if the item is available, we move on to placing the order – moving the token into the merging gate
    • if the item is not available, the token moves into the terminating end event, which immediately consumes all tokens and terminates the process
  6. In case both tokens meet up in the merging gate and merge back into one token.
  7. The remaining process token moves into the end event where it is being consumed.

As you can see, the terminating end event makes it possible to completely terminate a process without having to consider where any other tokens currently are.

Continue on to next chapter

Next, we’ll look at process loops.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *