Monday, November 28, 2016

REST API POST method to update related objects in Maximo

REST API allows external applications to query & update application data.

I would like to explain the POST method to insert or update a resource (or record) in Maximo. 
The below example has a Object structure (mxworkperiod) with Calendar and work period objects. We are updating a work hours on a particular date.

https://<hostname>:<port>/maxrest/rest/os/mxworkperiod/<calendaruid>?_action=AddChange&_lid=maxadmin&_lpwd=maxadmin
&orgid=NON CO&workperiod.1.workdate=2016-09-27&workperiod.1.shiftnum=08-12&workperiod.1.starttime=08:00&workperiod.1.endtime=12:00&workperiod.1.workhours=10.0


<hostname>:<port>                      - application hostname
maxrest/rest/os/mxworkperiod     -  common url where mxworkperiod is object structure name with a sequence of Maximo objects.
<calendaruid>                               - The Unique ID from the table ( not the calendar name in UI)
_action                                           - parameter can be [Change or AddChange]
_lid & _lpwd                                 - Maximo application username and password
 workperiod.1.workdate                - workperiod is the object name in the object structure;1 - any unique id value to add a related record or existing uniqueid of the related record to update the related object; workdate - attribute in related object

provided all the mandatory fields are passed on the POST call , maximo will create/update a related object.

You can also refer to the below link on how we can update a PO, add 2 PO lines and each line has 2 POCOST values.
http://www.ibm.com/support/knowledgecenter/SSZRHJ/com.ibm.mif.doc/gp_intfrmwk/rest_api/r_rest_post_method.html

Sunday, February 7, 2016

Maximo end point providerURL setting to multiple servers

In the Maximo Integration -->  End point application, we can configure JMS Handlers.
The Java Messaging Service (JMS) handler is a Java component that consists of several properties.
The handler delivers XML data into a messaging system that is enabled through JMS. The system places messages in a virtual channel called a queue or topic, based on your defined messaging model.

In a single server environment, we can point the provider URL using the IIOP legacy format - iiop://localhost:1xxx . port is the BOOTSTRAP_ADDRESS of the application server.

In a clustered multiple server environment, we can set the provider url using flexible CORBA object URL - corbaloc::localhost:1xxx,:localhost:2xxx ; ports are the BOOTSTRAP_ADDRESSes of the individual application servers.

This information is not available in Maximo integration guide 7.1. Sometimes, pointing the provider URL to only one application server in clustered environment may lead to communication error when the configured single server is down or having issues.

We may get javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "iiop://localhost:xxxx".  Make sure that any bootstrap address information in the URL is correct and that the target name server is running.  

A bootstrap address with no port specification defaults to port xxxx.  Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. [Root exception is org.omg.CORBA.TRANSIENT: java.net.ConnectException: Connection refused:host=<IP>,port=XXXX  vmcid: IBM  minor code: E02  completed: No]

Referencehttps://goo.gl/zqioXd