Delete/Cancel Active Tasks in the Process

Hi Team,

We Often get the requirements from the business to Skip the flow and to complete the case. so we are cancelling the tasks and making the backend database changes when the user is unable to complete the task.

Does it has Impact on the performance on the environment and what is the best way to handle this kind of Changes.

Thanks In Advance

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello ,

    You can use the exception tab in the user input task which will wait for the user to complete the task within the time defined by you, in case of failure by the user to complete the task it will either go to the next node or you can simply terminate the process.

    or

    you can fetch all your process using the query process analytics and filter out the active processes and collect the process ids and then use the function a!cancelProcess() in a loop.

    But i would not recommend cancelling the process in such a way because you might not have a context. In case you have a context let's say you filter out based on the timeline then it might work fine. 

    My recommendation would be use the record centric task management approach for a better performance and audit. 

    If you have a record centric approach for your tasks you can run a process to turn all the active tasks to inactive when the deadline is reached. this will reduce your manual work and also help in maintaining better performance.

    Here is something which might be useful for you to understand better

    discussion

  • Hi Chaitanya,

    can you please help me the way to implement this record centric approach? Do you mean instead of active tasks we can use record related actions?

    Any documentation link on record centric approach will be really helpful to understand more on the approach

Reply Children
  • 0
    Certified Senior Developer
    in reply to testbasicu8831

    Lets say you have a leave application process "Apply Leave" in which you need approvals from one or more persons.

    you will need to create a DB table for your tasks with the below field

    1.taskId(Primary)

    2. leaveApplicationId(FK option)

    3. createdOn

    4.createdBy

    5.assignedTo

    6.deadLine/endDate

    7. isActive

    create a record using this db as your source.

    The main process would have the normal user input task where the data is collected from the user who is applying for loan.

    In the same process after your write records/ write to datastore entity you will have a script task which will collect the PK of the loan details and will write the deadline i.e time stamp of when it was created and when it has to be completed, the username or group who has to approve and write record using this details.

    In the approvers site you will show the above details in a grid and have a related action for the active tasks with a process model which will fetch the details of the leave application and lets the approver to take action on it. for this you will need a interface which fill display the leave details and in the button action you can save the status as inactive and the leave status as the choice and submit. this will update the status in the leave details record.

    once the action is completed the status of the task will turn inactive and will be not shown in the grid.

    You can create another process model which will run everyday and check for the deadLines in the task data and turn all the active tasks to inactive if the date is exceeded.

    This will create the instances only when the user wants to take action on something. It will avoid keeping your instances active for a long time and will also let you keep a record of when the task was assigned and when it has been completed.

    I hope this is clear to understand. I am not sure about the documentation.