By David J Payne (IBM Business Process Manager Level 2 Support)
The term “Stuck Token” is used to describe when tokens are on a task that has been completed but is still marked as active. When a token is active and the task where the token is located becomes marked complete, the token should move onto the next task. The status of tokens are found by searching on the LSW_TASK and LSW_BPD_INSTANCE tables for the business process definition (BPD) instance IDs of the tokens in question. Active instances have their EXECUTION_STATUS set as 1 and closed instances have their STATUS set as 32; this is viewed in the LSW_TASK table.
The previous definition and characteristics are important to remember when you monitor the status of running applications because tokens also stop moving for other reasons. Tokens stop moving when application errors occur; with this there are usually error messages that display. Another situation where tokens do not move is when they become "orphaned." This situation typically only happens during the migration of in-flight instances and is easily identified by the token showing up as "Unknown." When process execution halts due to an error in the application and the token is on a failed task, the following solutions will likely not work.
When tokens become stuck during process execution there are several possible methods that will get them moving again. The following possibilities are not guaranteed to resolve stuck tokens on all systems because tokens become stuck for a variety of reasons.
- Restart the steps where processing halted through the Process Admin Console.
- Have a database administrator check the database for locks or connectivity problems. Examples of items database administrators should look for are spid -2 or state deadlocks.
- In IBM Business Process Manager Versions 7.5.1 and later, you can use the REST API to move tokens. The move token command is only available through the REST user interface (<server name>:<port>/bpmrest-ui) in IBM Business Process Manager V8.0. You can also use the move token feature through a REST API client; full instructions are found in the IBM Business Process Manager Information Center under the Managing Tokens topic.
Usually this process is used to push the token forward to the next activity. This process is useful when you are sure that all processing has completed at the task where the stuck token is located. If all processing has not completed, moving a token’s position can possibly cause data loss.
- If the volume of new application instances is very high and a large portion of these applications become stuck, tuning performance settings can resolve these problems. Due to the differences in users’ environments, there are no clear cut values, beyond the default, we can suggest the following documents:.
- Bulk processing might also require some tuning of the event manager. The event manager controls the connection pools and the available number of threads.
- Restart your servers and database. Restarting the database and servers clears out any locks, provides a fresh Java virtual machine (JVM), cleans up threads, and closes all connections.
If you have any questions or comments about this blog article, we welcome your feedback below this entry.