DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • Transactional Outbox Patterns Step by Step With Spring and Kotlin
  • Comparing Cloud Hosting vs. Self Hosting
  • What Is Envoy Proxy?
  • Operator Overloading in Java

Trending

  • Transactional Outbox Patterns Step by Step With Spring and Kotlin
  • Comparing Cloud Hosting vs. Self Hosting
  • What Is Envoy Proxy?
  • Operator Overloading in Java

How to Change Status of Work Orders in Maximo Using MBOs

Want to learn more about how to change the status of a work order in Maximo? Check out this tutorial demonstrating how to change its status using MBOs.

Kayleigh Davis user avatar by
Kayleigh Davis
·
Aug. 09, 18 · Tutorial
Like (3)
Save
Tweet
Share
14.16K Views

Join the DZone community and get the full member experience.

Join For Free

The process of changing work orders status in Maximo involves writing your code and packaging it in a WAR file and then placing that WAR file in the MAXIMO.ear and redeployment of Maximo Asset Management System on BEA Weblogic Server.

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 Maximo installation folder. Now, we can import the required packages. 

List of the importrequired packages mentioned below:

import psdi.server.MXServer;
import psdi.security.UserInfo;
import psdi.app.workorder.WOSet;
import psdi.app.workorder.WO;


Get an instance of the MXServer class:

MXServer mxServer = MXServer.getMXServer();            
Get UserInfo of any authorized Maximo user
UserInfo userInfo = mxServer.getUserInfo("maxadmin");


Next, you will need to get the WOSet object by passing UserInfoas the parameter. If we pass the userInfo here, some of the users lacking required privileges that 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); 


Next, you will need to initialize the variable with the desired work order status

String desiredStatus = "COMP";


Now, you will need to initialize the memo variable, which can be used for adding comments, like the reasons or details of changing the status.

String memo = "";


This method changes the Work Oder status by updating rows in the MAXIMO tables WORKORDER , WOSTATUS , etc.

wo.changeMaxStatus(desiredStatus, mxServer.getDate(), memo);


Next, you will need to ask Maximo to persist your changes:

 woSet.save();


Now, close WOSet  so that memory resources are freed:

woSet.close();


Deploying Your WAR File

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

Right above <!-- List of EJB modules --> line in the application.xml,  insert the description of your web module as the following:

<module id="WebModule_SomeUniqueNumbericID">
       <web>
                <web-uri>YourWar.war</web-uri>
                <context-root>/YourWebModuleName</context-root>
       </web>
</module>


After making these changes, you will recreate the MAXIMO.ear file and redeploy it on BEA Weblogic server. These are the methods that we can follow to change the status of the work orders in Maximo using MBOs. 

Conclusion

We can change the status of work orders in Maximo using MBOs by, firstly, writing the code and creating the war file in Maximo.ear. Then, we can employ the Maximo Asset Management System on the BEA Weblogic Server. This is the best solution to solving this problem.

Published at DZone with permission of Kayleigh Davis. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Transactional Outbox Patterns Step by Step With Spring and Kotlin
  • Comparing Cloud Hosting vs. Self Hosting
  • What Is Envoy Proxy?
  • Operator Overloading in Java

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: