What's the best practice to cancel an specific process instance?

whenever, we need to cancel a process instance based on a decision made in some other process. I see we have some options like Send/Receive message, Cancel Process, Set external P Vs Activity but not sure which is the best practice to use?. Can you please suggest on which option too choose and if there's any differences.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • Certified Senior Developer

    In all of the cases you would need instance Id of the process you want to terminate. Here is the pros and cons of each approach:

    1. Cancel Process: The decision logic to cancel a process instance lies within the parent process. Child process status is changed to Cancel.

    PROS:

    • Requires less configuration. Bcoz one node is enough to do the job
    • Sail component is available, so you can call it from an interface and cancel a process instance

    CONS:

    • User requires admin access of child process to cancel it
    • Parent process might not have all decision parameters
    • Does not show dependent/Precedent relationship

     

    2. Send/Receive Message: The decision logic can be distributed between parent and child process instances. Process status is changed to completed

    PROS:

    • Decision to terminate lies with child process. So doesn't require additional permission
    • Child process will have better exposure to processes current state. Hence best candidate to take termination decision. Ex. There is some change in business logic of child process. It is easy to notice termination logic, rather then it residing in parent.

    CONS:

    • Receiver is always in active state, always waiting to listen from Sender, until terminated. Consumes more resources
    • Configuration needs to be made in both processes, Sender in parent and Receiver in child
    • Cannot be called directly from Interface. However you can place this Send message node in a process and trigger PM from interface.

     

    Hope this helps to decide which approach you want to take as per requirement.

Reply
  • Certified Senior Developer

    In all of the cases you would need instance Id of the process you want to terminate. Here is the pros and cons of each approach:

    1. Cancel Process: The decision logic to cancel a process instance lies within the parent process. Child process status is changed to Cancel.

    PROS:

    • Requires less configuration. Bcoz one node is enough to do the job
    • Sail component is available, so you can call it from an interface and cancel a process instance

    CONS:

    • User requires admin access of child process to cancel it
    • Parent process might not have all decision parameters
    • Does not show dependent/Precedent relationship

     

    2. Send/Receive Message: The decision logic can be distributed between parent and child process instances. Process status is changed to completed

    PROS:

    • Decision to terminate lies with child process. So doesn't require additional permission
    • Child process will have better exposure to processes current state. Hence best candidate to take termination decision. Ex. There is some change in business logic of child process. It is easy to notice termination logic, rather then it residing in parent.

    CONS:

    • Receiver is always in active state, always waiting to listen from Sender, until terminated. Consumes more resources
    • Configuration needs to be made in both processes, Sender in parent and Receiver in child
    • Cannot be called directly from Interface. However you can place this Send message node in a process and trigger PM from interface.

     

    Hope this helps to decide which approach you want to take as per requirement.

Children