cancel
Showing results for 
Search instead for 
Did you mean: 

BoundaryEvent linking to a parallelGateway

prad
Champ in-the-making
Champ in-the-making
Hello all,

I have the following scenario.

A user task with a boundaryEvent for a time duration of 5 mins. At the expiry of this duration, the user task from boundayEvent triggers. Upon completing this task, the sequence joins the main flow and continues further. But in my case, I don't see that the main flow is continuing. It just waits at the join. There are no tasks in the ACT_RU_TASK table. But in ACT_RU_EXECUTION, I can see an entry that seems like waiting at the join. The relevant xml is given below.


      <sequenceFlow targetRef="viewMatter" sourceRef="createMatter" />
      <userTask id="viewMatter" name="View Matter" activiti:assignee="ken"></userTask>
      <sequenceFlow id="normalView" targetRef="join1" sourceRef="viewMatter"></sequenceFlow>
      <parallelGateway id="join1"></parallelGateway>
      <boundaryEvent id="timeOut" cancelActivity="true"  attachedToRef="viewMatter">
         <timerEventDefinition>
            <timeDuration>PT5M</timeDuration>
         </timerEventDefinition>
      </boundaryEvent>
      <sequenceFlow targetRef="phoneDebtor" sourceRef="timeOut"></sequenceFlow>
      <userTask id="phoneDebtor" name="Phone Debtor" activiti:assignee="ken"></userTask>
      <sequenceFlow targetRef="join1" sourceRef="phoneDebtor"></sequenceFlow>
      <sequenceFlow targetRef="checkDebtorType" sourceRef="join1"></sequenceFlow>
      <exclusiveGateway id="checkDebtorType" name="Debtor Type"></exclusiveGateway>

Can anyone help me understand if I am doing anything wrong. As far as I can see, I'm only doing something similar to the diagram attached below (from user guide)

Regards
Prad
5 REPLIES 5

trademak
Star Contributor
Star Contributor
Hi,

Be aware that you use a parallel gateway in the right way.
If you have a parallel gateway with two incoming sequence flows, it'll wait until both sequence flows have been executed.
So in your case , just don't use a parallel gateway and you will be fine.

Best regards,

prad
Champ in-the-making
Champ in-the-making
Thanks for the reply.

I understand that a parallel gateway normally will wait for all incoming flows before moving ahead. But in case of a boundary event, will it retire the main flow?

The user guide says that
A typical use case is sending an escalation email additionally but not interrupt the normal process flow
.

So if we take the user guide example (diagram below), will the 'Main Task' be retired, if the timer triggers the 'Escalation Task'? In which case the only incoming flow to the parallel gateway (at run time) would be the one coming from Escalation Task? So how then the escalation task will ever proceed through the join if it's still waiting for 'Main Task' which is inactive by then?

My problem is am able to proceed something like escalation task, but waiting at the join. What does the cancelActivity="true" doing? I thought that would retire or cancel the main flow.

Regards
Prad

jbarrez
Star Contributor
Star Contributor
Your current process will kill the usertask, and continue through the boundary event.
The parallel gateway will wait for 2 sequence flow, hence your exception.

Setting the cancelactivity to true might work, but it's not yet tested enough (and thats the reason why we haven't put it in the userguide yet)

prad
Champ in-the-making
Champ in-the-making
Thanks for your reply, Joram.

I can see that boundary time duration event works fine - kills the main task and progress to the escalation task. But it's the parallel gateway that doesn't know about it. cancelActivity- as far as I can see, doesn't seem to do anything. I tried with and without that attribute only to find that the process works exactly the same way.

On a different note, can you suggest me some alternate ways of achieving the said outcome. I can see that the process I am trying to implement has many of such occurrences and me being new to Activiti is hard to find a way to go.

Regards
prad

prad
Champ in-the-making
Champ in-the-making
Hello all,

If you're in similar situation to me, this is how I fixed it. It's pretty simple and straight forward. Bit of thinking and trial is all you need. Follow the diagram below.

Where the two sequences were merging to 'Review Matter' I was initially using a parallel gateway. But in reality, you wouldn't need that.

Thanks everyone for reading and commenting on my post.

cheers
Prad