Tuesday, August 15, 2017

Maximo Integration Testing using SOAPUI Tool

In almost all the Maximo projects, we do have interfaces created to external systems by different protocols, we test them on regular basis after each fix or releases to ensure there is no failure on the integration.

SOAPUI is open source tool that is used to test WebService or WebAPI Testing. It can test protocols such as SOAP over http/jms, REST.

We can extend this tool to automate the Maximo Integrations. 
It offers components to send/receive messages, delays, transfer properties and groovy script [similar to python] knowledge is needed to get started.

A sample project for testing OOB Maximo scenario.
https://github.com/bysurendar/maximo_testing/tree/master/SOAPUI_MIF_Testing

References:
SOAPUI tutorials - https://www.soapui.org/getting-started/your-first-soapui-project.html

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.

Sunday, February 7, 2016

Maximo JMS Handler 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

Tuesday, November 17, 2015

Process JMS Recovery in Maximo



Objective:
Non – persistent data (GL transactions data) that are stuck / lost in JMS queues can be reprocessed using an existing API with Maximo automation script.

Pre-requisites:
1.       Create a folder jmsrecovery inside the Global Integration Directory specified in the System property mxe.int.globaldir
2.       Create a folder for a queue inside the Global Integration Directory. Replace backslash with dots in the folder name.
for example, for outbound sequential queue jms/maximo/int/queues/sqout, the folder name should be jms.maximo.int.queues.sqout

Automation Scripting:
Create an ACTION type script for any MBO object in Maximo.
https://github.com/bysurendar/maximo_processrecoveryapi/blob/master/automationscript_action.py


 

Launch Point of the script:

Input XML:

XMLs are automatically generated when there is an error on the JMS queue.

In case, we plan to resend records manually, then XML need to be created in the below specified format. 

 
XML tag and its values in Maximo application:
i)                     MSGPROP tag attribute values: MEAMessageID -> auto generated value ; destjndiname à same as queue name where the messages are stuck or need to be reprocessed ; interfacetype à External system name; SENDER à MX ; INTERFACE à Publish Channel name
ii)                   MSGDATA tag and its attributes: maximoVersion à Identified from System Help information ;
iii)                  Set and Data tag comprises of Object Structure name


The XMLs are placed in the queue folder inside Integration Global Directory à jmsrecovery à folder with queue name.

 
Write XML to JMS Queue:

The action of writing the XMLs to the queue can be done in 2 ways.
1.       Click on the Execute Script button in the Automation Script application for one time transfer.
2.       Create an escalation for a MBO with 1=1 condition and schedule the resend if required.

In this case, I created the ACTION in COMPANIES object. So, an escalation on COMPANIES object linked with the automation script ACTION can be used for automatic transfer of XML from the folder to the queue.