Sunday, May 08, 2016

AX2012 Deleting a workflow instance

Had this strange issue where we found that the RECID got maxed out for certain tables in the systemsequences table. This caused the system to turn unusable and the logins into the system got disabled unless the NEXTVAL was correct set again using SQL.

On investigation and careful monitoring we found that the workflow engine has lots of instances where the workflow was in pending status. We realized that this was a developer issue where the business record was getting approved on the first work item approval on the attached workflow. As a result the user was able to post the data without completing the workflow.

Another issue we found was that there were multiple instances created for the same record this happened as the system dialog for workflow comments was not modal and went in the background and the user was able to submit twice.

Due to the above issues we landed in a situation where we have lots of workflow instance to get rid of and hence this post.

The workflow instance related tables are identified as follows
  • SysWorkflowInstanceTable
  • SysWorkflowTable
  • WorkflowQueueDocumentCommonFlds
  • WorkflowTrackingArgumentTable
  • WorkflowTrackingCommentTable
  • WorkflowTrackingStatusTable
  • WorkflowTrackingTable
  • WorkflowTrackingWorkItem
  • WorkflowWorkItemTable

I have already created a class to save some of the work

No comments: