Cancel Process Smart Service

We have a request I am working on and can not figure out.  A user does something in the system adding records to a table, a process task is started so another person can verify and if approved it goes ahead and approves it, if they reject it with a comment it is sent back to the original person to look at.

They now want the ability so the original request can be deleted if put in in error, we have that part working.  But we are wanting to use the Cancel Process Smart Service to cancel the process task.  It is wanting a process id and can not figure out how to get the process id for the first entry when the user inputs the data.

So the user inputs the data and the process is created for the task.   But then a little bit later the user goes back in and deletes the data they input, it will only allow them to do this if it has not been approved yet.  The process task that was created is still there and now need to cancel it.

Any idea on how to get or find the process id for the task that was created so when the user deletes what they did it can cancel the process task also?

Thank you

  Discussion posts and replies are publicly visible