Contact Us

Contact Us

How To Change Status Of Work Orders In Maximo Using MBOs

🚀 Quick Technical Summary

To programmatically change a Work Order status in IBM Maximo using Java MBOs, follow this execution logic:

MXServer
➔
UserInfo
➔
WOSet
➔
changeStatus()
➔
Save()
  • Requirement: Include BusinessObjects.jar in your classpath.
  • Critical Step: You must call set.save() to commit changes to the database.

To change the status of work orders in Maximo using MBOs, you must:

  • Reference the BusinessObjects.jar
  • Get an instance of MXServer.
  • Access the WOSet via the UserInfo profile.
  • Call the changeStatus() method on the specific MBO
  • Save the change and close the connection. This process ensures data integrity across the Maximo Asset Management system

How To Change the Status Of Work Orders In Maximo Using MBOs?

The process of changing the status of work orders in Maximo requires writing your code, packaging it into a WAR file, and placing that WAR file into the MAXIMO.ear. This is followed by redeploying the Maximo Asset Management System on the BEA Weblogic Server. If you’re wondering how to change the status of work orders in Maximo using MBOs, this guide will provide the necessary steps and details.

Maximo MBO Java logic flow for work order status change.
Figure 1: Programmatic sequence for updating Maximo Work Order records via the Business Objects layer.

1. Writing code and creating a WAR file

Before writing the code, you will need to include the library “BusinessObjects.jar” in your project. This jar file is available in the Maximo installation folder.

Import required packages
import psdi.server.MXServer;
import psdi.security.UserInfo;
import psdi.app.workorder.WOSet;
import psdi.app.workorder.WO;
Get instance of MXServer class
MXServer mxServer = MXServer.getMXServer();            
Get UserInfo of any authorized Maximo user
UserInfo userInfo = mxServer.getUserInfo(“maxadmin”);                                                      
Get WOSet object by passing UserInfo as parameter. If we pass userInfo here of some user lacking required privileges then returned WOSet will be empty.
WOSet woSet = (WOSet)mxServer.getMboSet(“WORKORDER”, userInfo);                                                         
Set your where clause for filtering records in woSet
woSet.setUserWhere(“WONUM = ‘1045’ “);
Get first WO object from WOSet
WO wo = (WO)woSet.getMbo(0);                                                                   
Initialize variable with desired Work Order status
String desiredStatus = “COMP”;
Initialize memo variable which can be used for adding comment like reasons/details of changing status
String memo = “”;                                   
This method changes Word Oder status by updating rows in MAXIMO tables WORKORDER, WOSTATUS etc
wo.changeMaxStatus(desiredStatus, mxServer.getDate(), memo);
Ask Maximo to persist your changes
 woSet.save();
Close WOSet so that memory resources are freed.
woSet.close();

2. Deploying your WAR file

To deploy your WAR file, you must place it in the MAXIMO.ear file. To do that, extract the MAXIMO.ear file and copy your WAR file to the root directory. You also need to make changes in the application.xml file in MAXIMO.ear located at MAXIMO.ear\META-INF.

Right above <!– List of EJB modules –> line in application.xml insert description of your web module as under:
               <module id=”WebModule_SomeUniqueNumbericID“>
                              <web>
                                             <web-uri>YourWar.war</web-uri>
                                             <context-root>/YourWebModuleName</context-root>
                              </web>
               </module>

After making these changes, recreate the MAXIMO.ear file and redeploy it on the BEA WebLogic server.

Maximo EAR and WAR deployment architecture on WebLogic server.
Figure 2: The end-to-end deployment architecture from local Java development to the production WebLogic Server environment.

Frequently Asked Questions

  1. Where is the BusinessObjects.jar located in Maximo?

    You can find the BusinessObjects.jar within the maximo/applications/maximo/lib folder of your Maximo installation directory. This is the primary library required for any MBO-based Java development.

  2. Why is my Maximo status change not reflecting in the database?

    The most common reason is failing to call the .save() method WOSet after invoking it changeStatus(). In Maximo MBO development, changes stay in the memory buffer until a formal commit is triggered via the parent set’s save method.

Struggling with complex Maximo Integrations?

Our team handles everything from MBO customization to large-scale WebLogic deployments.

 

 

Healthcare software development, HL7 Interface, EMR/EHR integration, mHealth, HIPAA compliant