Skip to main content
April 21, 2022
Question

How to cancel a specific task process

  • April 21, 2022
  • 9 replies
  • 0 views

Hi,

I need to cancel a specific task process (from another process), and to do this I've found the "Cancel Process" Smart Service.

I'm a little sceptic with that SmartService because in the documentation I can read "It allows you to halt all process flow and cancel all tasks associated with a process".

I'm afraid I don't want to kill all the tasks associated with a process, but only one specific task.

So how may I do that please (and how to get this task id) ?

9 replies

April 21, 2022

Hi,

You need to save your process instance ID in one of your DB column and using that process instance id you can cancel that particular process using cancel smart service or sending a message to that process

April 21, 2022

Thank you Naresh. And before saving that process instance ID to a DB field, how I can get that instance Id ?

Once a process is launched, an ID is returned ?

April 21, 2022

Yes, you can get process instance ID using pp!id (from expression editor you can type it will auto prompt for your selection if you are using latest version Appian)  

stefanhelzle0001
April 21, 2022

If this is a business requirement, I would add a receive message event to the model and then react accordingly to an incoming message sent from the other process. Just cancelling other processes or tasks is typically not a good idea.

April 21, 2022

Yes stefan, it is a business requirement.

I'm not sure to understand your solution. Would you have any documentation or tutorial that shows how it works?

(or an example)

stefanhelzle0001
April 21, 2022

What I mean is, by cancelling another process, you interrupt the business process. If this behaviour is required, then you should design this into the process instead of just killing it from the outside.

docs.appian.com/.../Receive_Message_Event.html