[PROCESS MODELS] Cancelling a request after it is submitted and before it is approved

Suppose we have a simple process model with a process start form.

The start node leads to an approval user input task assigned to a group, which then either leads to the end node if it is rejected, or leads to a write to data store entity smart service if it is approved. 

I need to make it possible for the process initiator to cancel their request after submitting (i.e. when we have moved on from the start node) and before it is approved (before a user accepts the approval task, AND approves the request).

On cancelling, the process flow should skip the approval user input task (and also it should be deleted from the list of tasks in tempo if possible. At least, it needs to be made redundant, so if anyone tries to approve the request, they can't). The process flow should go immediately to the end and the process instance should terminate at this point.

Is there any way I can achieve this?

After interacting with the process start form and closing it, how can the process initiator interact with the process instance again?

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    The simplest way to accomplish this in my opinion would be to create a secondary task that gets assigned to the original initiator - which on the task form could just say something arbitrary like "waiting on approval user", but also containing a control for them to cancel the request.  The rub here is, I don't know of any way to make this task go away easily when someone *accepts* the group-assigned task without using various potentially-sloppy workarounds.  But otherwise this would be a pretty straightforward way to do basically what you need.

  • Hi Danny - 

    Another thing you could try is to leverage the power of records to gain better control over the process.

    Create a record type in which each record entry corresponds to an instance of this request.
    You can write a row to the db right after the form is submitted but before flowing into the user task.  Each new row represents a record.  you can write the process id to the record and reference it to terminate the process via a related action on the record.

    This is a high level overview of high I might do it.
    This approach gives you the added benefit of having a list of these approval workflows that you can review on demand.  You can included statuses and user based permissions as well.

    Good luck!

  • You can simply create a process backed record and add a quick task to your process which will show up as a related action allowing the requester to cancel the process.