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?
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.
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.
There is a dedicated Smart Service (also available as an a!function) for cancelling Process Instances:
Thanks Stewart - that's the smart service I was trying to use. I got it to work for cancelling the 'subprocess' but I couldn't get it to cancel the parent process so I went back to using the 'send message' to cancel both. That works well.
Hi Judy - if you're sending messages at both Parent and Child then why not use the Cancel Process Smart service in the same way to cancel both? (i.e. get the ProcessIds of both Parent and Child and execute the Smart Service twice, once for each instance id.)
I have heard there are performance/scalability issues with Send Message (cool though it is!)
Could you please tell me how you had done the above scenario.
Hi Satish - you need to do the following:
Hope this helps
I am able to send a message and receive message events to subprocesses but after I am unable to close Parent Processes.I want to kill parent processes as well. Could please guide on that.
Is the parent calling the sub-process synchronously or asynchronously?
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!
Hi Judy - I got your use case and solution, I was trying to help Satish with his :-)
Thanks for responding to me Judy and Stewart.....
But I had used complete task smart service it worked by choosing the canceling path Action IDs in UI. But in our requirement Action IDs shouldn't be displayed in UI. Is it possible to get an automatic canceling path action ID based on open tasks in Processes Model?
You should be able to capture the Action IDs in the data output (not something you'd have to display in the UI) and use that to cancel. Did you look at this related discussion? This may help. https://community.appian.com/discussions/f/process/9693/cancelling-specific-tasks-from-a-separate-process
I approached in the above way also but I hadn't got it Judy
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.