Hey everyone,
I have got an issue in cancelling a Human task which is located inside a BPM Process. Assume we have a Human Task (HT) in a BPM process (P1). This Human Task can be assigned to a user based on his role and he can see that in his inbox. But, sometimes we need to cancel the assigned Human Task so that an external process (P2) can interrupt an instance of P1 and cancel (or in another word "Withdraw") the Human Task. In this case, the HT will be disappeared from user's inbox.
To do that, I have used "Event SubProcess" activity (SP1). A correlation is defined in start node of P1 (Message Start) to initiatialise the correlation key (correlaion mode is "Initialise") and the other one is defined in Start Node of "Event Subprocess", SP1, but set as "Uses" mode.
The normal flow works abosolutely fine here, so that if P1 process kicked off from Main Node, the process stops at Human Task and wait for the user's action. And also, if external process, P2, send cancellation message (using Send Activity) it withdraws the Human Task as well and Human Task will pulled out of user inbox. Perfect!
But, the problem starts if we reverse the events order. If the Cancel message happens first, the message will be waiting untill the new process comes in, them it interrupts and cancels its task. So, if a new P1 created through main node after cancel message, it will be automatically go through Event Subprocess path and therefore the Human Task will be cancelled without going to user's inbox!
As said, the way to send the cancel message is implemented using Send Activity. Not sure why it keeps cancel message, I want it to be ignored if there is not any process instance created before.
This approach has been re-implemented using Events (throw signal to send cancel, and start Node in SP1 changed to signal).
Any idea to ignore these kind of messages/events?
Thanks,
Nasser