Get WF Assignment Site ID
Updated: Feb 25
There is no doubt that Maximo Workflow engine is an outstanding feature that sets Maximo apart. As the record progresses through the workflow, assignments are created and delivered to participants. It is a convenient way to organize work and keep jobs on track.
Maximo Workflow Assignments
One of the advantages of having a workflow-driven system is the ability to manage workflow-specific assignments using “inbox” concept. But as the workflow is deployed and used by many objects, the workflow assignments must be designed in a generic way to accept input from many object types.
One of the challenges that you may face is to be able to provide SITEID information against workflow assignments. This is comes in handy when you are required to segregate assignments per Site and report progress for each Site.
It makes sense for the Workflow assignments not to reference the SITEID as not all objects in Maximo are Site-level objects. There are objects which reside at the Organization-level and hence will not have a Site information.
If you determined that the Site information are required, then this post will help you build a query that makes use of Oracle-specific features to reflect and obtain additional information from the Database based on the Owner Table and the Owner ID. Those two pieces of information shall allows us to uniquely reference a specific record in a specific table and obtain the SITEID information if available.
Of course, this is only the query part, enhancing the Inbox Portlet is something else. The below query does this with the support of Oracle XMLType.
SELECT DESCRIPTION ,APP ,DUEDATE ,TO_CHAR(EXTRACTVALUE(XMLTYPE(DBMS_XMLGEN.GETXML('SELECT SITEID FROM ' || OWNERTABLE ||' WHERE '|| OWNERTABLE||'ID'|| ' = '''|| OWNERID ||'''')),'ROWSET/ROW/SITEID')) SITEID FROM WFASSIGNMENT WHERE 1=1 AND ASSIGNSTATUS='ACTIVE' AND ASSIGNCODE='MY ASSIGNEE CODE' ORDER BY APP