How to restrict allowed status changes for workorders

Maximo has a predefined set of statuses for work orders that are defined in the WOSTATUS synonym domain. The values and their meaning are well documented in the official documentation.
Unfortunately the allowed state transitions are hardcoded in the psdi.app.workorder.WOStatusHandler class and cannot be easily changed since they are defined as private arrays.
Here is a brief summary of the allowed status changes.

WAPPR APPR WSCH WMATL INPRG COMP CANCEL CLOSE
WAPPR - Y Y Y Y Y Y Y
APPR Y - Y Y Y Y - Y
WSCH Y Y - Y Y Y - Y
WMATL Y Y Y - Y Y - Y
INPRG Y - Y - Y
COMP - - Y
CANCEL - Y
CLOSE -


From status APPR you can set any target status.


This allows too much freedom in some cases so we want to restrict the allowed state transitions.
For example you might want to prevent users from changing the status of work orders that are in APPR (Approved) status to CLOSE (Closed) or CAN (Canceled).

First, navigate to Condition Expression Manager and create the following conditional expression:


Open the the Domains application and bring up the WOSTATUS domain.
Select the CAN status row and click on the View/Modify Conditions button.
Select the "new row" button and select the new condition you created above, and click OK.



Do the same to COMP and CLOSE status if you wish.
If you now open any work order in APPR status you will notice that the list of allowed target statuses is shorter.




The good part is that the same rule applies also if you click on the quick actions.



References



Labels: , , ,