3

We are building a work order management integration layer on top of the base Maximo, communicating via provided REST/OSLC API, but we are stuck when it comes to finding all possible statuses a work order could transition to for a given work order.

Is there a REST/OSLC API, or some way to expose it externally (ex. some kind of one-time config export), the possible status transitions for a given work order?

This should consider all the customizations we've made to Maximo including additional statuses, extra conditions, etc. We are targeting version 7.6.1.

Max Seo
  • 196
  • 6

2 Answers2

5

IBM seems to have dropped some things from the new NextGen REST/JSON API documentation. There is almost no mention of the "getlist" action anymore, something I have really enjoyed using for domain controlled fields. This should give you exactly what you are looking for, a list of the possible statuses that a given work order could go into. I was unable to verify this call today, but I remember it working as desired when I last used it (many months ago).

<hostname>/maximo/oslc/os/mxwo/<href_value_of_a_specific_wo>?action=getlist&attribute=status

Dex
  • 1,241
  • 6
  • 13
  • 1
    Thanks DEX! This got me like 99% there! The exact API you mentioned did NOT work. It returned a (somewhat) random list of synonym domain statuses. BUT this information got me a lead to dig through Maxiom docs, and found this https://developer.ibm.com/static/site-id/155/maximodev/restguide/Maximo_Nextgen_REST_API.html#_json_schema. It mentions the getlist API you posted. Using the documented format GET /oslc/os/mxwo/{{workorderid}}/getlist~status?oslc.select=value&lean=1 Got me exactly what I needed! THANK YOU AGAIN! – Max Seo Nov 22 '19 at 22:53
  • 1
    Hmm. I guess I never noticed just how accurate it is. In my tests just a bit ago, it _did_ return a filtered list of valid statuses, it just wasn't filtered as much as my conditional expressions said it should be. WAPPR work orders returned other WAPPR statuses in their service call, and APPR work orders properly did _not_ return the WAPPR statuses in their service call, but in both cases more synonyms were returned that I expected. Also, CLOSEd work orders still returned the full list of APPR statuses, which I would not call correct. – Dex Nov 25 '19 at 15:16
3

The method you're looking for is psdi.mbo.StatefulMbo.getValidStatusList

See details here: https://developer.ibm.com/assetmanagement/7609-maximo-javadoc/

Now, you want to expose the result to a REST API. You could create an automation script that given the WONUM would return the allowed status list. You can leverage the new REST API to achieve that quite easily.

See how you can call an automation script with a REST call here: https://developer.ibm.com/static/site-id/155/maximodev/restguide/Maximo_Nextgen_REST_API.html#_automation_scripts

Last part: you will need to create a request response based on the mboset returned from getValidStatusList.

JPTremblay
  • 900
  • 5
  • 8
  • I have not accepted this answer because Dex's response mostly covers exactly what I needed, but upvoting this anyways because this is a GOOD way of doing this programmatically from a script. It will be very useful in the future if the need arises. Thank you! – Max Seo Nov 22 '19 at 22:54
  • I agree, much better if you don't have to write a single line of code! – JPTremblay Nov 25 '19 at 14:55