2

I want to model a BPMN process, where two parallel tasks are validating two independent forms. If either of the forms is invalid, then we have to call the customer and request a new form. The problem is, that I don't want to call the customer about form 1 and separately about form 2 - if both forms are invalid I want to call him only once.

Is there a way to check if both validations have been completed before the call customer task is scheduled?

Then I have another question - how can I re-enter the process after the customer has been called? If one form is invalid I would like to re-enter in the corresponding form validation process when the new form is received, and if both are invalid the re-entering should occur in both subprocesses.

I am using Activiti to implement this, if it's important.

BPMN sketch

Edit

The validation tasks in each process can be days apart and I don't want to block a subprocess because of the validation in the other subprocess. I am seeking a solution, where a subprocess would continue past the validation (if it's valid), and where the customer call would be made only when both validation tasks are completed (and at least one of them is invalid).

lmazgon
  • 1,215
  • 1
  • 21
  • 40

3 Answers3

2

Okay, so the underlying problem here is that we have 4 states to thing about - valid/valid, invalid/valid, valid/invalid, and invalid/invalid. Now, we can ignore valid/valid as I assume that is the happy path model and you already know how to make that work. So what can we do for the invalid options.

One thing I get is that you need the "next step" after a form is valid to continue, even if the other form hasn't been validated yet. I think what you want to do is simply change the process for handling invalid. I think an event gateway may get us there.

Now, my experience is mostly IBM BPM, not Activity, so there is a chance this answer will not be valid BPMN, but I think it is. Basically what I would picture is that your initial split is actually a 4 way split. The 2 you have for the forms now, and 2 to event gateways. Those event gateways are waiting for each form to message either "valid" or "invalid". When answers for both are received, it would then know if the next step is to simply end that part of the flow, or fix the validity.

In IBM BPM that model would look roughly like this (sorry, my Activiti VM is down right now)

BPMN Diagram

I haven't tried diagrams before. That link is - https://i.stack.imgur.com/i7eGS.jpg

Drux
  • 486
  • 2
  • 6
1

To expand on Drux' solution, the following diagram is built using the Activiti Modeler

Parallel Evaluation

Here, a signal event is sent after form validation for both forms. The events are captured and then correlated to determine if an email needs to be sent to the customer.

While the diagram below doesnt show it, having both status' for the forms means we can also trigger a re-entry to one or both form sub processes if we need.

Hope this helps. Gharley-BP3

Greg Harley
  • 3,230
  • 1
  • 11
  • 14
  • Thanks, I will probably implement a similar solution. Just one quick question about signal events - if I understand correctly the signal event is broadcasted to EVERY process instance by default (according to BPMN 2.0 standard), but Activiti has an option to limit the scope to one instance. So am I right that this solution would not work in a pure BPMN environment without customizations? I got this information from here - http://activiti.org/userguide/index.html#bpmnSignalEventDefinition – lmazgon May 21 '14 at 20:23
  • Yes you are correct, signal events are generally global (but Activiti does provide a mechanism to limit scope). However, while signal events are received by all processes, every implementation platform I have come across provides a mechanism to "correlate" the signal so that only valid listeners "fire" on the event. As such, the approach will work in a "pure" BPMN environment. – Greg Harley May 21 '14 at 22:18
0

You can execute the validation in parallel and then merge the two paths with a parallel gateway. In BPMN, the merging parallel gateway waits for all incoming flows. Regarding your second question, you can simply make use of several exclusive gateways. Attached is an example process, based on your textual description. It's valid BPMN. However, I'm not an activiti expert, so I don't know if there are any activiti-specific issues. enter image description here

Timotheus.Kampik
  • 2,425
  • 1
  • 22
  • 30
  • I would like to keep the subprocesses separate. My example is just an abstraction of the real process, which is much more complex. The validation tasks in each process can be days apart and I don't want to block a subprocess because of the validation in the other. – lmazgon May 20 '14 at 14:20
  • I don't understand. The sub process is waiting for the process to finish in order to execute only one phone call. So this part of the process is necessarily blocked. But you can execute other tasks in parallel, simply trough introducing a parallel gateway. So where is the problem? An alternative approach would be to try to use message events for solving the issue... – Timotheus.Kampik May 20 '14 at 15:28