Showing posts with label Workflow StatusBar missing. Show all posts
Showing posts with label Workflow StatusBar missing. Show all posts

Sunday, November 19, 2017

Cannot create a record in Workflow tracking status table (WorkflowTrackingStatusTable). Correlation ID: {70B17AE2-AF1A-47A9-937F-39F206AF91DE}, Pending. The record already exists.

Encountered this issue once the system recovered from the RecId max out in the workflow tables. There were certain transactions that were submitted and updated as In-review however the workflow was not triggered for them. The workflow bar was missing and on trying to Re-Submit the workflows the error was received.

Solution :

  1. Shutdown all the AOS instance
  2. Bring up any one AOS, synchronize the database.
  3. Re-Submit the workflow for the failed records.
e.g: 

    TSTimesheetTable    timesheets;
    WorkflowTrackingStatusTable  trackingstatus;

    while select timesheets
    where 1==1
        && timesheets.ApprovalStatus == TSAppStatus::Pending
        //&& timesheets.TimesheetNbr == 'CCM-175040'
    notexists join trackingstatus
    where trackingstatus.ContextTableID == 4627
    && trackingstatus.ContextRecId == timesheets.RecId
    {
        /*
        ttsBegin;
        timesheets.ApprovalStatus = TSAppStatus::Create;
        timesheets.update();
        ttsCommit;
        */
    Workflow::activateFromWorkflowType("TSDocumentTemplate",
                                       timesheets.RecID,
                                       "Resubmitted due to error",
                                       false,
                                       timesheets.createdBy );

    info( timesheets.TimesheetNbr );