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
  • 0
    Certified Lead Developer

    A few questions:

    Is the child process configured to run synchronously or asynchronously?  If it's asynch then the parent theoretically could have already finished, but what happens to the child process will in no way affect how the parent closes or fails to close.

    Does the child process have a terminate node?

    Could the send message be configured to activate a flow that leads to the terminate node?

    Is the terminate node activity chained?  The activity chaining usually results in unexpected behavior with ending the parent process not properly canceling its child processes.

    Does the child process you're attempting to cancel have children of it's own that might not be ending properly?

    Have you made sure to configure Cancel Process smart service to run as Process Model Designer?  It could be an issue with permissions, because process model viewers (the person using this in the field) don't have permission to cancel processes.

  • 0
    Certified Senior Developer
    in reply to Dave Lewis

    I'm sticking with the 'send message' option to cancel the subprocess and associated parent process. Evidently, this is still acceptable and it works. I did have the 'Cancel Process' smart service configured to run as the Process Model Designer - so permissions were not the issue. The sub-process I was trying to cancel did not have any other subprocesses - just the parent one to cancel. 

    Thanks for responding and while I'd like to resolve it - I need to move on so I'm going to cancel with the send message option.

Reply
  • 0
    Certified Senior Developer
    in reply to Dave Lewis

    I'm sticking with the 'send message' option to cancel the subprocess and associated parent process. Evidently, this is still acceptable and it works. I did have the 'Cancel Process' smart service configured to run as the Process Model Designer - so permissions were not the issue. The sub-process I was trying to cancel did not have any other subprocesses - just the parent one to cancel. 

    Thanks for responding and while I'd like to resolve it - I need to move on so I'm going to cancel with the send message option.

Children
No Data