cancel
Showing results for 
Search instead for 
Did you mean: 

start task with signal

micharg
Champ in-the-making
Champ in-the-making
Hello,

I have to tasks that are active at the same time, lets call them R and O. R is required and O is optional.
How can I model this? I want when R is finished also O be finished. If O is finished R should be finished
also.

I don't want to finish task O manually after I finish R. I have tried messages and signals (R triggering them
on finish) but without success. Is this the recommended way? Should I insist?

Actually using signals when R finishes O is still active (and waiting to be finished); but I want it to auto-finish.

Thank you,
Mike
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Mike.

If finished = completed
one option could be to complete tasks automatically by service task after the user task. (TaskService API call)

May be you can find better solution.

Regards
Martin

micharg
Champ in-the-making
Champ in-the-making
Hello Martin,

Thanks for your recommendation. I will try this. By the way signals should be caught? I was thinking an Signal Intermediate Throw Event
and catching it (with cancel activity = true) but the signal is never caught (I use a signal boundary event)

Regards,
Mike

martin_grofcik
Confirmed Champ
Confirmed Champ
In that case you should have a look on org.activiti.engine.test.bpmn.event.signal.SignalEventTest#testSignalCatchBoundary in the activiti sources.

<signal id="alertSignal" name="alert" />

<process id="catchSignal">

  <startEvent id="start" />

  <sequenceFlow sourceRef="start" targetRef="task" />

  <userTask id="task" activiti:assignee="kermit" />  
 
  <boundaryEvent id="boundary" attachedToRef="task" cancelActivity="true">      
          <signalEventDefinition signalRef="alertSignal"/>
       </boundaryEvent>

  <sequenceFlow sourceRef="task" targetRef="end" />
  <sequenceFlow sourceRef="boundary" targetRef="end" />

  <endEvent id="end" />

</process>