Follow-Up Work Orders
Updated: Feb 25
Maximo allow you to create Follow up Work Orders which is an excellent feature given that you can nest as many “Follow up Work Orders” as needed. With this flexibility comes the complexity of analyzing the resulting structure of Work Orders.
When creating “Follow up Work Orders”, Maximo stores the relationship between the “Originator” and the “Follow Up” Work Orders in the “Related Records” table. This can be seen in the “Related Records” of the Work Order Tracking application.
When using this feature extensively, a complex structure of nested Work Orders may be created. The Originator and the follow up work orders are loosely coupled, giving the organization the flexibility to decide the best approach to apply controls.
Maximo Follow up Work Orders
We can conceptually think of Follow up Work Orders as a tree that branches away from the Originator Work Order and constructing a hierarchical query will help us visualize this. The following list are data that can be obtained when constructing Follow up Work Orders hierarchy query and they primarily gives a great details about the hierarchy levels:
LEVEL: The tree branch level, this should start from “1” and increment as far as the trees depth. This is especially useful if you are to implement a logic that depends on the hierarchy level.
PATH: Just like the site Bread Crumbs component, this piece of information is able to describe all the tree nodes starting from the Root (the very first node) all the down to the current node. The number of node comprising the PATH should be equal to the LEVEL value.
CONNECT_BY_ROOT: The root node which the current note belongs to. You can safely assume that you could possible have multiple ROOTs because it depends on your START WITH clause.
It is important to note that the cost of the follow up work orders are not rolled up the hierarchy to the same parent.
If you are in a situation where you need to analyze the resulting structure of creating follow up work orders alongside their status, the following code will be handy:
WITH FOLLOWUP_RELATEDRECRODS AS ( SELECT * FROM RELATEDRECORD WHERE CLASS IN ('ACTIVITY','WORKORDER') AND RELATETYPE='FOLLOWUP' ) , WO_RELATEDRECORDS AS ( SELECT W.WONUM ,W.SITEID ,W.PARENT ,W.WORKTYPE ,W.REPORTDATE ,W.WOCLASS ,W.STATUS ,RR.RECORDKEY ,RR.CLASS ,RR.RELATEDRECKEY ,RR.RELATEDRECCLASS ,RR.RELATETYPE FROM WORKORDER W ,FOLLOWUP_RELATEDRECRODS RR WHERE W.WONUM=RR.RECORDKEY(+) AND W.REPORTDATE >= TRUNC(SYSDATE,'YEAR') ) , WOREKATEDRECORDS_HIERARCHY AS ( SELECT RR.* ,LEVEL WORRLEVEL ,CONNECT_BY_ROOT RR.WONUM AS TOPLEVELWO ,SUBSTR(SYS_CONNECT_BY_PATH(RR.WONUM||'('||RR.WORKTYPE||','||RR.STATUS||')', '->'), 3) AS WORELATEPATH ,SUBSTR(SYS_CONNECT_BY_PATH(RR.WORKTYPE, '->'), 3) AS WTRELATEPATH ,CONNECT_BY_ISLEAF AS WOLEAF FROM WO_RELATEDRECORDS RR CONNECT BY RR.WONUM = PRIOR RR.RELATEDRECKEY ) SELECT DISTINCT WTRELATEPATH ,WORELATEPATH ,SITEID FROM WOREKATEDRECORDS_HIERARCHY WHERE WORRLEVEL > 1