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 CAN 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
CAN
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:

  • Condition: WONOTAPPR
  • Description: Work Order is not in APPR status
  • Type: Expression
  • Expression: :status not in (‘APPR’)
  • Always Evaluate: false

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

How to restrict allowed status changes for workorders

6 thoughts on “How to restrict allowed status changes for workorders

  1. We have rather complex business rules about who can change what type of work order from a specific status to another so we created a new object to house the rules and built conditions to point to the rule object to determine what status' were allowed. This object was given a new custom app so the rules can be set quickly and updated whenever necessary without having to alter conditions.

  2. Hi!
    There is a bug in Change Status table. From CAN it can’t go to the CLOSE.
    Thank you very much for your work. I like your blog.

  3. I’m trying to update the condition of Conditional Expression Manager by running a update query in oracle. The condition changes successfully but it doesn’t reflect the changes in the application based on the updated condition.
    Can you please tell me if I need to update anything else as well along with the condition.

    1. FYI – I always avoid, unless absolutely necessary, updating anything in the DB rather than using the front end. There lots of caching going and it does actually invalidate your license agreement with IBM. Chnaging it in the UI or using the MBOs such as with MxLoader, Migration Manager, etc ensures that all the necessary places are updated,

  4. Hi,

    I recently added a new Work Order Status to the WOSTATUS domain. Here are the details of this new status:
    – Internal Value: APPR
    – Value: PNDCOMP
    – Description: Pending Completion.

    I am able to set WOs to this status, but any user that does not have a Maxadmin security group cannot complete any WOs with this WO status. The system gives this error: BMXAA4042E – The status cannot be changed for the selected records. I have checked if our Security Groups have any restrictions that would not allow users to complete a PNDCOMP WO, but I can’t find anything. Has anyone seen this before?
    Thanks!

Leave a Reply to oddaljen Cancel reply

Your email address will not be published. Required fields are marked *

Scroll to top