Search This Blog

Wednesday, October 16, 2019

MAXIMO Bean Class : Reference Info

IBM Maximo :  Bean Class reference information

In this post I will provide some reference information about methods in Maximo bean classes and typical use.

Methods in Bean Class:

1. RESET method:
     This method is called when a new filter is applied for the dialog's MboSet. 
              @see psdi.webclient.system.beans.DataBean#reset()
              @Override
              public void reset() throws MXException
               {   
                 try
                   {   
                     //saveCurrentSelection();
                   }
                 catch (RemoteException e)
                   {
                     //handleRemoteException(e);
                   }
                 super.reset();
                }


2. CALL method:

     /* 
     * This method is called whenever an event is generated in the dialog (e.g. OK button is pressed). 
     */
    @Override
    public int callMethod(WebClientEvent event) throws MXException {
        //ToDo Custom logic here
        return super.callMethod(event);
    }

3. INITIALIZE method:
     This method is used to initialize values on dialog. 
              @Override
    protected void initialize() throws MXException, RemoteException
    {
        //ToDo custom logic here;
        super.initialize();
    }






Wednesday, August 21, 2019

MAXIMO: Upload attachments using REST API

IBM Maximo :  Upload  docklinks attachments using REST API


In this post I will explain in details how to upload attachments to Maximo record using REST API.


I will be using Work Order to explain this use case.

First step is to configure Object Strcture having required objects as in this case WorkOrder and DOCLINK

I have created Object Strcture as below :

Object Structure : RESTWODOCLINKS
Description : Upload WO Attachment using REST API

Its consumed by Integration and includes Workorder and DOCLINKS objects.















Next step is to configure security for Object Structure to grant access to specific groups which is being used by REST API call user. 
You can refer my other post IBM Maximo REST API Example - Change Person/User/Labor status for the same.
maximo REST api













maximo rest api











If you miss to configure object structure for respective group you might get error like below :




Next we are going to submit REST request , I will be using Postman client for the same and detailed explanation of postman parameters and rest/oslc URLs is explained in my post here @  IBM Maximo REST API Example - Change Person/User/Labor status .

I have  created sample RESTTEST Workorder to be used in this example.
This record can be fetched with REST URI as below  sample URI format is
http://host:port/maximo/oslc/os/RESTWODOCLINKS/_QkVERk9SRC9SRVNUVEVTVA--?lean=1
maximo rest api













Now I am going POST REST call using Postman client.

I am using sample JSON paylod as below to upload attachment against Workorder :

Postman sample POST request URL is  http://host:port/maximo/oslc/os/RESTWODOCLINKS/_QkVERk9SRC9SRVNUVEVTVA--?lean=1

{
"wonum": "RESTTEST",
"siteid": "BEDFORD",
"orgid": "EAGLENA",

"doclinks":[
{
    "ADDINFO": "1",
    "COPYLINKTOWO": "0",
    "DESCRIPTION": "Example Attachment via REST API",
"DOCUMENT": "Test via Rest API",
"OWNERTABLE": "WORKORDER",
"UPLOAD": "1",
"NEWURLNAME": "www.ibm.com",
    "urltype":"FILE",
    "documentdata":"aGV5IGhvdyBhcmUgeW91",
    "doctype":"Attachments",
    "urlname":"SampleREST-Upload.txt",
    "OWNERID" : "133634"
}
]
}

maximo rest api










This POST request then successfully adds Attachment against workorder :

maximo rest api










If you want to achieve same thing using Web Service you can refer IBM blog @ IBM Maximo: Iimport attachments into MAXIMO using MIF Web Services.

Additionally IBM REST API Guide can be referred @ IBM Maximo REST API Guide

Tuesday, August 20, 2019

MAXIMO: create KPI

IBM Maximo :  Create KPI:



In this post I will explain in details how to create KPI ,  we can use the same on Start Center.

Lets being by opening KPI Manager Application , Go To -> Administration -> Reporting -> KPI Manager

maximo KPI












Now I am going to create new KPI record , below are values supplied :

KPI Name : Test-KPI

Description :  Number of Users currently logged in

Select :  select currentcount from logintracking

Targe : 500

Caution at : 550

Alert at : 750

Is Public : Yes.

maximo KPI




MAXIMO: Creating ResultSet Query , used in Start Center

IBM Maximo :   - Create Result Set Query to be used in Start Center Portlet:



In this post I will explain in details how to create public query and how we can use the same on Start Center Resultset portlet.

I am going to explain using Work Order Tracking Application.

Lets open Work Order Tracking Application by Go To -> Work Orders -> Work Order Tracking.

Then to have subset of data I am using "More Search Fields" dialog from Advanced Search.
Refer below screenshot :

maximo resultset start center











Now I am going to apply some filters to prepare resultset query :
Status : =INPRG,=WAPPR
Class : =WORKORDER , =ACTIVITY
Site : =BEDFORD
History? : N
maximo resultset start center














After clicking find button on More Search Fields dialog , it displays the records which qualified the filters applied.


maximo resultset start center











Now I am going to add additional criteria like qualified records to be ordered by workorders priority.

I am using Advanced Search -> Where Clause and then added " order by WOPRIORITY" at the end of displayed current query.
maximo resultset start center















Now I am going to save this current query to be used as ResultSet , by clicking "Save Query -> Save Current Query".
Query Name : WORESULT
Description : UnApproved  , InProgress Work Orders
Public ? : Yes
maximo resultset start center











In another blog post I will show how I am going to use this saved ResultSet query on Start Center result set portlet.

Wednesday, August 14, 2019

MAXIMO: REST API Example - Change Person/User/Labor status

IBM Maximo REST API Example  - Change Person , User , Labor Status via REST call


 In this post I will explain in details how to use Maximo's REST API framework to update data in   Maximo with the example of changing Person status and status of associated User and Labor   records.


Object Structure setup :


 I am duplicating OOB MXPERSON object structure. I have removed related children objects , verified NP_STATUSIFACE and NP_STATUSMEMO fields included , STATUS and STATUSDATE fields had inbound restrictions applied etc.

maximo REST api













Next we have to configure Object Structure Security , starting version 7.6.0.5 IBM introduced capacity to grant access at Object Structure level. Refer below screenshot.

maximo REST api















Additionally we need to grant Object Structure access to group /User which is being used by REST to update the records. Example screenshot :

maximo REST api














Automation Scripts :


 In this use case I am going to use newly enabled capability of Integration Launch Points.
 I am going to create two Object Structure based Action Processing launch points for Activation   and Deactivation of Person/User/Labor records using REST calls.

a) Activation Script :
    Crete Integration Launch Point with details as below :
  • Type of Integration : Object Structure
  • Object Structure : Select Object created earlier in step above , RESPERSON
  • select "Action Processing" and provide Action name e.g. "ACTIVATE" to be called as REST
  • Maximo will automatically create script name as "OSACTION.RESTPERSON.ACTIVATE"
  • Provide description for script e.g. Activate Person and related associated Labor and User via REST
  • Follow remaining areas and add automation script logic.
       Refer below screen shots :
   
maximo REST api
   
maximo REST api














 b) Deactivation Script :
Follow similar steps as above and create script for Deactivation
Crete Integration Launch Point with details as below :

  • Type of Integration : Object Structure
  • Object Structure : Select Object created earlier in step above , RESPERSON
  • select "Action Processing" and provide Action name e.g. "INACTIVATE" to be called as REST
  • Maximo will automatically create script name as "OSACTION.RESTPERSON.INACTIVATE"
  • Provide description for script e.g. Activate Person and related associated Labor and User via REST
  • Follow remaining areas and add automation script logic.
       Refer below screen shot:
maximo REST api













Associating Action Definitions with Object Structure : 

 Now as we have defined Activate and Inactivate action processing automation scripts , these actions 
 needs to be associated with Object Strcture/s.
 Using select action "Action Definition"  as below :
  Name : ACTIVATE
  Description : Activate Person/User/Labor via REST call
  Implementation Type : script
  Script : OSACTION.RESTPERSON.ACTIVATE

  Name : INACTIVATE
  Description : De-Activate Person/User/Labor via REST call
  Implementation Type : script
  Script : OSACTION.RESTPERSON.INACTIVATE
maximo REST api

maximo REST api














Testing using REST client : 


  Now we will need to test and I will be using postman as rest client to send Activation and      
  Deactivation requests.
  I have created "TESTUSR" person record and associated Labor and User records for testing      purpose.
maximo REST api


















Also now we have to get REST URI for this person record using object structures apimeta information, verify your system properties for rest webapp url etc.
Sample url can be :https://host:port/maxrest/oslc

Here is my TESTUSR URI to be accessed over REST:

maximo REST api












Now I am going to use this REST URI for person "TESTUSR" and call Activate and Inactivate actions via postman REST client.
Postman needs to set up with parameters like x-method-override , patchtype , contenttype etc.
You can refer below URLs for IBMs JSON/REST API documentation :

Below are screenshots from postman POST request to call INACTIVATE and ACTIVATE actions for TESTUSR Person/User/Labor records.

a) Deactivation REST call via Postman client :
maximo rest api











Maximo result screenshot having records inactivated :
maximo rest api
maximo rest api

maximo rest api













b) Activation REST call via Postman client :

maximo rest api

Similarly associated User and Labor record got activated via this request , I have added below automation script for the same.

Launch Point Type : Object Launch Point
Object : PERSONSTATUS
Events : Save , Add , After Save

maximo rest api
maximo rest api
maximo rest api