cancel
Showing results for 
Search instead for 
Did you mean: 

Signal Boundary Event

hheckel
Champ in-the-making
Champ in-the-making
Hello,

I put together a process definition for a hiring process, where a job opening is advertised and then monitored for incoming job applications (catching boundary signal on 'Monitor Incoming Applications' until a boundary timer expires and ends the monitoring.

[attachment=0]HiringProcess.png[/attachment]

During the monitoring phase, a number of job applications can come in. Incoming Job Applications are being reviewed right away. The number of job applications can be anywhere from 0 to n.

Once the monitoring phase is complete (expiring timer), all active execution paths join in a parallel gateway, before getting to the next step of choosing a candidate. The parallel gateway is being used to ensure that all applications were reviewed (i.e. all execution paths have arrived in the parallel gateway).

This works fine, if I have at least two incoming applications. Only one application during the monitoring phase or no application (and just an expiring timer) will cause the execution to wait in the parallel gateway.

My question: is this a bug, or is there a better way to design/draft this in BPMN?

Thanks for your help!
Holger.


<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <signal id="applicationReceived" name="Application Received"></signal>
  <process id="hiringProcess" name="Hiring Process">
    <startEvent id="startevent1" name="Start"></startEvent>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="usertask2"></sequenceFlow>
    <userTask id="usertask2" name="Advertise Job Opening" activiti:assignee="auc"></userTask>
    <userTask id="usertask3" name="Monitor Incoming Applications" activiti:assignee="auc"></userTask>
    <boundaryEvent id="boundarytimer1" cancelActivity="true" attachedToRef="usertask3">
      <timerEventDefinition>
        <timeDuration>PT30S</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
    <boundaryEvent id="boundarysignal1" cancelActivity="false" attachedToRef="usertask3">
      <signalEventDefinition signalRef="applicationReceived"></signalEventDefinition>
    </boundaryEvent>
    <sequenceFlow id="flow2" name="" sourceRef="usertask2" targetRef="usertask3"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="usertask3" targetRef="noneintermediatethrowevent1"></sequenceFlow>
    <intermediateThrowEvent id="noneintermediatethrowevent1" name="NoneThrowEvent"></intermediateThrowEvent>
    <sequenceFlow id="flow4" name="" sourceRef="boundarytimer1" targetRef="noneintermediatethrowevent1"></sequenceFlow>
    <userTask id="usertask4" name="Review Application" activiti:assignee="auc"></userTask>
    <sequenceFlow id="flow5" name="" sourceRef="boundarysignal1" targetRef="usertask4"></sequenceFlow>
    <sequenceFlow id="flow6" name="" sourceRef="usertask4" targetRef="parallelgateway2"></sequenceFlow>
    <sequenceFlow id="flow7" name="" sourceRef="noneintermediatethrowevent1" targetRef="parallelgateway2"></sequenceFlow>
    <userTask id="usertask5" name="Choose Candidate" activiti:assignee="auc"></userTask>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow9" name="" sourceRef="usertask5" targetRef="endevent1"></sequenceFlow>
    <parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
    <sequenceFlow id="flow10" name="" sourceRef="parallelgateway2" targetRef="usertask5"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_hiringProcess">
    <bpmndi:BPMNPlane bpmnElement="hiringProcess" id="BPMNPlane_hiringProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="50" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
        <omgdc:Bounds height="55" width="105" x="130" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
        <omgdc:Bounds height="55" width="105" x="290" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="boundarytimer1" id="BPMNShape_boundarytimer1">
        <omgdc:Bounds height="30" width="30" x="380" y="277"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="boundarysignal1" id="BPMNShape_boundarysignal1">
        <omgdc:Bounds height="30" width="30" x="328" y="277"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="noneintermediatethrowevent1" id="BPMNShape_noneintermediatethrowevent1">
        <omgdc:Bounds height="35" width="35" x="460" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
        <omgdc:Bounds height="55" width="105" x="385" y="340"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask5" id="BPMNShape_usertask5">
        <omgdc:Bounds height="55" width="105" x="675" y="230"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
        <omgdc:Bounds height="35" width="35" x="835" y="240"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="parallelgateway2" id="BPMNShape_parallelgateway2">
        <omgdc:Bounds height="40" width="40" x="585" y="237"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="85" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="130" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="235" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="290" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="395" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="460" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
        <omgdi:waypoint x="395" y="307"></omgdi:waypoint>
        <omgdi:waypoint x="394" y="320"></omgdi:waypoint>
        <omgdi:waypoint x="477" y="320"></omgdi:waypoint>
        <omgdi:waypoint x="477" y="275"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="343" y="307"></omgdi:waypoint>
        <omgdi:waypoint x="342" y="365"></omgdi:waypoint>
        <omgdi:waypoint x="385" y="367"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="490" y="367"></omgdi:waypoint>
        <omgdi:waypoint x="605" y="367"></omgdi:waypoint>
        <omgdi:waypoint x="605" y="277"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="495" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="585" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="780" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="835" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="625" y="257"></omgdi:waypoint>
        <omgdi:waypoint x="675" y="257"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
4 REPLIES 4

riddhishah1604
Champ in-the-making
Champ in-the-making
Not sure, but I feel you should try with exclusive gateway instead of parallel gateway and see if that helps

hheckel
Champ in-the-making
Champ in-the-making
Thanks for your input.

What I am trying to achieve is for the process instance only to move past the gateway, once all execution paths (i.e. one "Monitoring Incoming Applications" and 0..n "Review Application") have arrived in the gateway. Or, in a "more real life description": only when the process instance is no longer accepting applications and only when all applications that were submitted have been reviewed, a candidate can be chosen.

Unfortunately, replacing the parallel gateway with an exclusive gateway won't do the trick.

Any other ideas?

Thanks!
Holger.

meyerd
Champ on-the-rise
Champ on-the-rise
Hi Holger,

the parallel gateway you are using in your example waits for one token on each incoming sequence flow. This means that if the user task is completed, it will wait for exactly one completion of "Review Application".

riddhishah1604
Champ in-the-making
Champ in-the-making
Hi Holger,

Try some logic using Multi Instance Parallel Subprocess as parallel subprocess will ensure that it will move ahead after subprocess only once all execution paths are completed. Try if you can build logic on this basis for your case.