5

I want to model a process that can be initiated by receipt of a message (which will be done via a REST call). The process will lead to a task that is assigned to a user. The user will supply some extra information and then the process will terminate.

However, I also want to model the case when additional information is received after the first info has been received. Receipt of this extra information via REST should terminate the process.

This overall model represents a computer system that monitors a flow of information and if it detects a problem it creates a task for someone to investigate. However if further information becomes available, the the task should've terminated.

What is the best way of modelling this in BPMN and Camunda please?

What I have at the moment:

(MSE) --> (UT) -->(TEE)
          (RT) --> (TEE)


Where:

MSE = Message Send Event
UT = User Task
TEE = Termination End Event
RT = Receive Task

I can successfully start/add a process for using curl to post a message representing the start message. This adds a process and the task is allocated to a user.

However, I don't seem to be able to get the receive task to correlate with the process, it just seems to add a new process. The cancel message that the receive task is supposed to represent should specifically cancel the particular process that it exists in, not any old process.

John
  • 10,837
  • 17
  • 78
  • 141
  • Apologies, I didn't have the exact details to hand when I posted, I've posted them now. – John Jun 12 '17 at 06:55

1 Answers1

5

There are different ways to model this.

You could use an interrupting boundary message receive event and if the extra info was received the user task is canceled by the boundary event.

enter image description here

Another approach would be to use an interrupting event sub process. If the message with the extra information was received the event sub process is triggered and will cancel the process.

enter image description here

You could also use a parallel gateway and a terminate end event. But I would recommend one of the methods above-mentioned.

Zelldon
  • 5,396
  • 3
  • 34
  • 46
  • Thanks, that's very helpful. I am very new to BPMN and am simply implementing this as a proof of concept of how to integrate an external processing system into Camunda. Is there a preferred / best-practice way of modelling the system out of the 2 methods that you've highlighted and if so, why is that? – John Jun 12 '17 at 08:17
  • You can read the camunda examples and best practice guides for more information https://camunda.org/bpmn/examples/. And you ask why is that. Do you know old saw many roads lead to rome this is the same. Some suites better then others depending on your needs. Since your process is very simple I can choose the way you want. – Zelldon Jun 12 '17 at 08:40