- Please select -

Stuck tasks in Enterprise PDM

Tips and Tricks Peter 20 March 2015

Note, The script below does update the vault database, so I would recommend ensuring you have up-to-date backups before running the script as a precaution. Please check with your IT department and contact Intercad support for help.

On occasion, tasks being run by Enterprise PDM can get stuck. For instance below you will see a task I have in the ‘waiting for host’ state. I will use this as an example to show how to use a SQL query to clear it.

Stuck tasks in enterprise pdm

TaskStatus

The tasks displayed in the Task list are found in the database table “TaskInstances” where “TaskStatus” has a numeric value of 1 to 11.

Our above example is ‘Waiting for host’, which equates to status 1. The full list of possible statuses is below.

1 [Waiting for host]
2 [Starting up]
3 [In process]
4 [Retrying]
5 [Suspended]
6 [Cancelling]
7 [OK]
8 [Cancelled]
9 [Failed]
10 [Suspending]
11 [Resuming]

If there is a task that is stuck in any state, you can modify the below SQL query using the above values. My version below will move a task from ‘1’ [Waiting for host] to ‘8’ [Cancelled]

UPDATE TaskInstances
SET TaskStatus = 8
WHERE TaskStatus = 1

This needs to be run in the SQL management studio.

To do this, open up SQL management studio (probably only on the database server)

Expand databases, right click on the vault in question, and select ‘new query’

Paste the command in there, updating the status number to the point at which your tasks are stuck.

Execute the task. You will see the result state how many rows have been affected.

SQL management studio

As a result the task is now cancelled.

TaskStatus

Stuck tasks in enterprise pdm

 

 

Back to Tips and Tricks