Federated MBO / JSON Resource – Filling the gap between Maximo and IoT

What is a Federated MBO?

Recently I got some time to explore the new Federated MBO feature. I like it a lot because it is simple to configure and quite powerful. Of course, prior to Maximo 7.6, the same functionality can be done with Java programming, but with this new feature, it is so easy to incorporate data from external systems into Maximo business logic and make a seamless experience to the end-users.

Basically, Federated MBO allows you to link an API from an external system and make it looks like a standard object in Maximo and treat it like other standard Maximo objects such as displaying data on GUI or setting up workflow conditions or writing automation script against it. The key difference here is that data is not stored inside Maximo database but queried from the API on-the-fly when the object is accessed.

Use Cases

I can immediately think of several applications that are enabled by this feature:

  • Integrate with Data Historian/SCADA: to display real-time operation conditions of assets. It is always beneficial for the asset managers to know the current conditions of the assets when planning works. Traditionally, operation conditions of critical assets can be imported/synchronized into asset meters for conditional monitoring PM or analytical reports. But it is not real time data. Generally, we don’t import every meter reading collected into Maximo. It will fill-up the database and consume valuable system resource. With this capability, we will only query data of a specific asset or location directly from an external system and don’t store it in the DB. However, we still can interact with the data as part of Maximo functionality which is a distinct advantage over other methods such as embedding the web page of an external system inside Maximo or directing user to a different web application
  • Integrate with security access systems: to display in real-time the current whereabouts of a worker. This could help with work planning and coordination activities.
  • Integrate with external service: to verify ID, Certificates etc. for the labour self-registration process.
  • Integrate with weather service to assist work planning process. For example, Maximo will warn the planner when planning to work if extreme heat, high UV, or heavy rain is forecasted. This allows them to plan the work on a different date or prepare proper PPE equipment to the workers. The same can be done if we deploy sensors to report temperature, noise level, humidity etc. on certain work locations.

Implementation

To demonstrate how the Federated MBO feature works, below is an exercise I did with OpenWeatherMap API. This API provides free access to 5-day weather forecast, UV Index forecast, and Air Pollution. In this example, I will link the UV Index forecast API and make it available as an MBO. When the user set a Scheduled Start Date, if UV Index is forecasted to be higher than 7, Maximo will display a warning message to remind the planner.

Step 1: Register OpenWeatherMap API account, and retrieve data on browser

  • Go to OpenWeatherMap.org to register a free account.
  • Sign-in with your new account, go to Account home page, open the “API keys” tab and copy your API key to use it to access the API.
  • Paste the following link into a new browser tab, replace the XXX with your API key, you should be able to retrieve JSON data of the UV Index forecast for the next 8 days as shown in the image below 
http://api.openweathermap.org/data/2.5/uvi/forecast?lat=-33.8688&lon=151.2093&cnt=7&appid=XXX
Test the OpenWeatherMap URL in browser
  • If you couldn’t retrieve the data, go to the site’s API document to read the instructions. It might have been updated. The OpenWeatherMap’s API syntax is very simple.

Step 2: Create a JSON Resource in Maximo

  • In Maximo, go to the Integration \ JSON Resource application. Under the More Actions menu, click Create JSON resource to start the wizard
  • Create a new Resource
    • Resource: OW_UVI
    • Resource Usage: OBJECT
    • Resource Type: REST
    • URL: <copy/paste the URL in the previous step above>
  • Note: for simplicity, we hardcode the latitude/longitude of the location in the URL. Once it works, you can dynamically populate the values from the main object by putting the field name inside a bracket such as:
    lat={LOCATIONS.LATITUDE}&lon={LOCATIONS.LONGITUDE}
  • Click Next 
  • Copy/Paste the sample JSON data we retrieved in previous step from OpenWeatherMap into the JSON Data text area. This allows Maximo to parse the data structure returned from the API for the next step
  • For Parent Object, enter “WORKORDER”. This will create a relationship on the “WORKORDER” object to point to the new JSON object “OW_UVI” we are creating
  • Click Next to proceed to the next screen. This screen summarizes how Maximo parsed and construct new MBO structure from the sample data provided.
  • Leave the default value, click Process to finish.

Step 3: Test the new JSON Resource

  • In the Database Configuration application, open the new OW_UVI object it just created for us. It also added a relationship OW_UVI in the WORKORDER object to link to this new mbo.
  • To check if our JSON resource can query data from the API correctly, use Application Designer, add a Table to anywhere, such as the “Map” tab. Open properties of the table, put OW_UVI as the relationship of the table. Add two columns and assign the DATE_ISO and VALUE field to the two columns. 
  • Open the Work Order Tracking app, open any work order, the table will display some UV forecast data:

Step 4: Create a warning using Automation Script

  • Open the Database Configuration app, choose Action > Messages to open the Message dialog. Create a new Warning Message:
    • Message Group: WOTRACK
    • Message Key: HighUVI
    • Value: High UV Index is forecasted for the scheduled date. Ensure proper sun protection PPE has been planned.
  • Note: the Message Group and Message Key fields are case-sensitive. Thus, in automation script, we should use the exact case in order for the message to be displayed
  • Open Automation Script app, Create an Attribute Launch Point:
    • Launch Point: SCHEDSTART
    • Object: WORKORDER
    • Attribute: SCHEDSTART
    • Event: Validate 
  • Click Next to the next screen, give the script a name such as Check_UVI choose Python as language
  • Click Next. Copy/Paste the following source into the Source code text area, then click Create to finish creating the script
  • In this script, I compare and identify if the Scheduled Start Date is in the next 8 days, and if the UV Index is higher than 7. If this condition is met, Maximo will display the warning we created above.

Extras

With Maximo 7.6, we can setup to assign Service Address to Location with coordinate of the location. When a Work Order is created against a location, it will inherit the coordinate of the location. We can use it to fill into the parameter of the API request, and retrieve the actual forecast of the Work Order’s location.  If you’ve read my previous post on creating custom chart control, we can also modify the app to display UV Index forecast in a chart for visualization. A planner after receiving the warning can then open the “Map” tab to see the location of the work, and see the UV Index forecast on a chart to determine what day is better to carry out the work.

I hope you have fun with this new Maximo feature. If you can think of any creative application using this feature to make Maximo better, please suggest by leaving me a comment. I would love to try it out

4 Comments

  1. Unknown

    This comment has been removed by the author.

  2. Lohit Pant

    Hi Viet,
    I am using warngroup and warnkey to show a warning to user when a Date in a field is below today's date. However, the warning message is not showing as soon as user tabs out from the field but is showing when user change some data in other fields. Can you help here?

  3. Unknown

    Hi Viet,
    I have tried using {LOCATIONS.LONGITUDE} to create a dinamic query but it doesn't work. Our latitude/longitude have "," instead of "." as separating symbol and i saw OpenWeather doesn't work with ",". Is there a way to convert "," to "." during the dynamic get of data?
    Does it need a different relationship to work and get the right values?
    Regards
    Carmine

  4. Lakshman

    After reading tech note , I felt how easy to use Jason Resources to integrate with real time system . Great job VIET

Leave a Reply