Recreate Workflow Assignments
Updated: Feb 25
Undoubtedly, Workflow Engine is Maximo silver bullet feature that sets Maximo apart from competitors. The powerful yet simple to use Workflow in Maximo has taken the workflow design and deployment into the next level.
The whole concept of Workflow and Workflow Assignments has revolutionized the computerized EAM landscape. Instead of generically filtering long lists of tasks and manually distributing work among team member, the Workflow assignments intelligently appoints specific names to assignments.
The fairly simple engine to use hides a great deal of complexity under the hood. To get the workflow up and running requires the organization to neatly design their process and responsibilities. Keeping the workflow running requires the team to keep the workflow in shape and maintain its prerequisite data sets.
Recreate Maximo Workflow Assignments
One of the challenges that you may face is “Empty” or “Ghost” workflow assignment. This odd anomaly happens if the workflow engine fails to assign any name to a newly generated workflow assignment. You will realize that you have this case in hand when you notice that:
The record has an active workflow process
Clicking on “View Process Map” shows process diagram with active node
Clicking on “View Assignments” shows an empty table
Traditionally, you obliged to Stop the workflow Process and start all over again. Although this option may not seem so expensive, but it does when the workflow process is overly complex and the document has progress enough through the workflow.
Luckily, you can “re-create” workflow assignments from the backend, however, you should be very cautious before and after you decide to go with this approach.
The following code is, fairly, generic code to recreate workflow assignments. It is configured to recreate Work Order workflow assignments but you can re purpose the code to serve any other workflow-enabled application.
INSERT INTO WFASSIGNMENT (ASSIGNID ,DESCRIPTION ,ASSIGNCODE ,APP ,TIMELIMIT ,STARTDATE ,DUEDATE ,EMAILNOTIFICATION ,ASSIGNSTATUS ,WFID ,NODEID ,PROCESSREV ,PROCESSNAME ,ROLEID ,ORIGPERSON ,WFASSIGNMENTID ,TEMPLATEID ,OWNERTABLE ,OWNERID ,LANGCODE ,CALENDARBASED ,HASLD ,SEPARATEGROUPS ) WITH RECORDS AS ( SELECT '1234567' RECORDID,'NEW ASSIGNEE ID' ASSIGNEEID, 7 PROCESSREV FROM DUAL) , NEWASSIGN AS ( SELECT RECORDS.* ,ROW_NUMBER() OVER (ORDER BY RECORDID) ASSIGNROW FROM RECORDS ) SELECT (SELECT MAX(ASSIGNID)+NWA.ASSIGNROW FROM WFASSIGNMENT) ,REPLACE(WFA.DESCRIPTION,':PRNUM',OWNER.PRNUM) --PR SPECIFIC ,NWA.ASSIGNEEID ,WFA.APP ,WFA.TIMELIMIT ,SYSDATE ,SYSDATE ,WFA.EMAILNOTIFICATION ,'ACTIVE' ,WFI.WFID ,WFA.NODEID ,WFA.PROCESSREV ,WFA.PROCESSNAME ,WFA.ROLEID ,NWA.ASSIGNEEID ,WFASSIGNMENTUSEQ.NEXTVAL ,WFA.TEMPLATEID ,WFA.OWNERTABLE ,NWA.RECORDID ,WFA.LANGCODE ,WFA.CALENDARBASED ,WFA.HASLD ,WFA.SEPARATEGROUPS FROM WFASSIGNMENT WFA ,WFCALLSTACK WFC ,WFINSTANCE WFI ,NEWASSIGN NWA ,PR OWNER --PR SPECIFIC WHERE NWA.RECORDID=OWNER.PRID--PR SPECIFIC AND NWA.RECORDID=WFI.OWNERID AND WFI.ACTIVE=1 AND WFI.WFID=WFC.WFID AND WFC.NODEID=WFA.NODEID AND WFC.PROCESSREV=WFA.PROCESSREV AND WFC.PROCESSNAME=WFA.PROCESSNAME AND WFA.OWNERID IS NULL AND WFA.ASSIGNCODE IS NULL