How to cancel tasks in progress directly from database

Document ID : KB000030407
Last Modified Date : 14/02/2018
Show Technical Document Details

Below is a procedure that will allow you to locate and cancel in progress tasks directly on the database:

 

You do need to find a way to locate the ‘tasksessionid’ of the tasks you need to delete. Then, you need to update the tasksession12_5 table and change the state of these tasks to be CANCELLED state (256). To locate the tasksessionid, you need to carefully go to your View Submitted Tasks and use the ‘Description’ and the ‘Submitted Time’ to help you filter out these objects from this tasksession12_5 table.

 

Basically you should do this:

1. Go to VST – find your task

2. Use the suggested question below to select that task from tasksession12_5 table and find its tasksessionid.

3. Update the task entry of this tasksessionid state = ‘256’

4. Repeat this for all tasks you need to delete.

 

See below:

 

/**

BEGIN_STATE = 0x00; 0 In Progress

PRE_STATE = 0x01; 1

PENDING_STATE = 0x04; 4

EXECUTING_STATE = 0x08 8

APPROVED_STATE = 0x10; 16

POST_STATE = 0x40; 64

INITIAL_STATE = 0x400 1024

PRIMARY_PENDING_STATE = 0x800 2048

PRIMARY_COMPLETE_STATE = 0x1000 4096

SECONDARY_PENDING_STATE = 0x2000 8192

MARK_FOR_DELETION_STATE = 0x200 512 Completed

COMPLETED_STATE = 0x80; 128

AUDIT_STATE = 0x4000 16384 Audited

INVALID_STATE = 0x02; 2 Failed

REJECTED_STATE = 0x20; 32 Rejected

CANCELLED_STATE = 0x100; 256

UNKNOWN_STATE = 0x300 768 Unknown

**/

 

SELECT [tasksessionid]

,[state]

,[created_time]

,[last_access_time]

,[user_dn]

,[org_dn]

,[environmentid]

,[name]

,[description]

,[acknowledged]

,[parent_of_wf_id]

,[action_type]

,[priority]

,[initiatorid]

,[nesting_type]

,[next_state]

FROM [IM_TPSTORE].[dbo].[tasksession12_5]

WHERE [BUILD A FILTER BASED ON DESCRIPTION AND/OR SUBMITTED TIME YOU GET FROM VIEW SUBMITTED TASKS]

GO

 

UPDATE [dbo].tasksession12_5

set [state] = 256

WHERE [tasksessionid] = ‘THE ID YOU FOUND’

 

GO