Cancelling a process from another process

Certified Senior Developer

I have a process that includes a 'send message' node to cancel another active sub-process. The active sub-process gets cancelled and ends, with a receive message node. This process ends cleanly and also ends the parent process. I tried to change the process so that if the active sub-process needs to end - I use an Execute Process Report smart service to identify the subprocess's ID and then use a 'Cancel Process' smart service to cancel it. It does cancel it, but does not also end the parent process associated with the cancelled sub-process. Using the 'send message' to cancel the active process does - and cleans up these cancelled processes nicely - basically ends the active tasks and then ends the processes. Is the 'send message' the best way to go with this? I know that we should not use the 'send message' event to 'start' a process, but is it still acceptable (i.e. not soon to be deprecated) to end a process with a 'send message'? If I should be changing it - how to I configure the 'Cancel Process' smart service to cancel the associated parent process?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Stewart Burchell

    Stewart - I would say in my scenario - the parent process called the sub-process synchonously. It's actually calling an earlier executed version of the same process that has yet to be completed. 

    Here's the scenario I had: I had a situation where an accountant starts a process to edit an account. Once he enters the changes, it goes to someone else to review and certify the changes. Before being certified, the accountant (or another accountant) might need to make additional changes. So - if the first change hadn't been certified, it needed to be cancelled. So - I used an 'Execute Process Report' node to find find the previous review task(s) and captures those active process id(s). In the Data Outputs node for the 'Execute Process Report' - I save the process id(s) that need to be cancelled, which are then used in the Cancel Message. 

    Hope this helps!

Children