Showing posts with label Integration. Show all posts
Showing posts with label Integration. Show all posts

The curious case of the MIA work orders?

Working in IT, we deal with strange issues all the time. However, every once in a while, something would come up that leaves us scratching our heads for days. One such issue happened to us a few years back. It came back to me recently and this time, I thought to myself I should note it down.


The issue was first reported to us when users raised a ticket about missing work orders in TechnologyOne, the Finance Management System used by our client. Without work orders created in TechOne, the users won't be able to report actual labor time or other costs. Thus, this is considered a high priority issue.


Messaging engine cannot be started as there is no runtime initialized for it yet

I sometimes have issues with message engine not running. Usually I'll just try to restart the whole system and hope that it goes away.

If it doesn't work, in most cases, it is caused by a corrupted file store used by the message engine and the suggestion from the Internet is to delete these files, which seems to work fine.

Sometimes, with the message engine uses a database store, I had a very similar issue. I find it quite hard to find out the exact root cause. So I chose the easier path by simply deleting the whole message engine, create a new one, giving a new schema name for the data store. This ensures it creates new tables when message engine is initialized the first time. 

Creating a new message engine and re-assigning bus destinations usually take less than 5 minutes, and it seems a lot easier than troubleshooting and finding the root cause of the issue.


Post HTTP request using Automation script

I want to post a simple JSON message to an external system and do not want to add any external library to Maximo as it would require a restart. 

In the past, I used the java HTTPClient library that comes with Maximo, but it would require half a page of boilerplate Jython code. Recently, I found a simpler solution below.

  • First I use WebHook as a mock service for testing. Go to webhook.site, it will give us a unique URL to send request to:




Implement "Sleep" or "Wait" in WebMethods flow

I needed to send an external system a file import request. The external system would take some time to process the file before the import result can be queried. Making a status query immediately after the import request would always return an "import process is still running". It's best to wait for a few seconds before making the first attempt to query the import status.

It took quite a bit of time to look up the web for a "wait" or "sleep" function. Some posts suggested using Java flow, some recommended complex processes or involved an external library.

The easiest method I finally settled with is to use Repeat as follows:


Essentially, the flow would repeat 1 time in 5 seconds before getting to the next step (Main Mapping). The repeat loop does nothing other than just writing a line in the server log to make troubleshooting a bit easier.

The fun (and pain) of Kronos Integration

One of our clients undertook a massive IT transformation program which involved switching to a new financial management system, upgrading and rebuilding a plethora of interfaces among several systems, both internal and external to the business. Kronos was chosen to replace an old timesheet software and there was the need to integrate it with other systems such as Maximo and TechnologyOne. WebMethods was used as the integration tool for this IT ecosystem. This is my first experience with Kronos. The project took almost two years to finish. As always, when dealing with something new, I had quite a bit of fun (and pain) during this project. As it is approaching the final stage now, I think I should write down what I’ve learnt. Hopefully, it will be useful for people out there who’re doing a similar task.

REST API: Kronos provides a pretty good reference source for the REST API at this Link. REST API theoretically offers the advantage of supporting real-time integration and enables seamless workflow. However, we don’t have such a requirement in this project. On the other hand, this has two major limitations.


WebMethods: Evaluate String IN and CONTAINS operator

In WebMethods, the most basic way to write a string “IN” operator is to use Branch as follows:


Another way to reduce the number of lines of code is by combining the conditions using “OR”:


Troubleshoot integration issues when Maximo stops publishing data to external system.

I had to deal with this quite often. Most of the times, I got it right and able to identify the problem quickly. In a few cases, it took some time, and usually very stressful as it mostly occurs in Production. (It occurs in DEV and PRE-PROD all the time, it’s just that people usually don’t care, and it goes unnoticed)

Today I had to deal with it again and it took me some time. The cause was something I dealt with before, was told by a colleague on how to fix it (the easy way), but I forgot. This time around, under panic mode, I restarted a few JVMs before I remembered I should ask around and was reminded by my colleague again that it could be fixed with much less damage. I told myself I should write it down for the next time, so here is the sum of what I learned:


Setting up alarms for integration

 When writing a piece of software, we are in total control of the quality of the product. With integration, many elements are not under our control. Network and firewall are usually managed by IT. With external systems, we usually don’t know how they work, or many times, not given access. Yet, any changes to these elements can cause our interfaces to fail.

For synchronous interfaces, the user would receive instant feedback after each action is taken (e.g. Maximo - GIS integration), thus, we don’t usually need to setup alarms. For asynchronous interfaces, which usually run in the background, and don’t give instant feedback, when failure occurs, it usually goes unnoticed. In many cases, we only find out about failures after it has caused some major damage.

A good interface must provide adequate mechanism to handle failures, and in the case of async integration, proper alarms and reports should be setup so that failures are captured and handled proactively by IT and application administrators.


Avoiding recursion filter on Publish Channel

The standard way to send a message from Maximo to an external system is by setting up a Publish Channel and enabling Event Listener. By default, Integration Framework doesn’t re-publish a change if it comes from another inbound interface to prevent recursion on a bi-directional interface. Although I don’t agree with this logic as one-way integration is much more common, but anyway, IBM said it is easy to override that by extending the Event Filter javaclass.

The problem is, with the rise of automation script, no one wants java customization anymore. Of course, for massive systems where performance is critical, it is still the best choice. But, for most medium-sized clients I work with, they’re all moving away from java customization.

Anyway, an approach we can deal with this is not to use Event Listener at all. Instead, we can trigger a publish from an Object Save launch point from automation script using the example python code below:

from psdi.iface.mic import PublishChannelCache
PublishChannelCache.getInstance().getPublishChannel("PUBLISH_CHANNEL_NAME>").publish(mbo, True)
 

 Happy coding!


Check Network/Firewall Status using PowerShell

Working with Maximo, we have to deal with network/firewall all the time. I can spend a whole day telling you fun stories (or extremely frustrating experience) I had with IT/Network guys. But that's not the point. If you end up here, I guess you're having an issue with firewall. So below is a quick recap of my tricks:

- Ping: the first thing we try when we want to see if a server is accessible from our current machine. But don't jump to a conclusion too early if it shows the server is unreachable. Sometimes, the Network Admin has disabled ping response to enhance security. 

- Telnet: to check if a port is opened, we can use telnet from Windows Command console (e.g. telnet google.com 80). If it can be connected, means the target server is accessible on the specified port. But if it doesn't, first, make sure the server is listening on that port, before jumping to a conclusion that it's a Firewall issue. I made this mistake a few times, blaming the network, then it turned out it's Websphere/Maximo service is not running on the port that I assumed it should be running on

- PowerShell: in many cases, the server is not connected to the Internet, and Telnet is not installed, (and yes, you don't have permission to install new software either). We can use PowerShell to check network connectivity using the two commands below:

$connection = New-Object System.Net.Sockets.TcpClient("google.com", 80)
Write-Host $connection.Connected

The first line will return some errors if it cannot connect to the server, like the screenshot below: 


 If the server is accessible via the provided IP and port, the 2nd line will return the status = Connected




String Concatenation in WebMethods

Manipulating string is probably the most frequent operation we need to do when transforming data. Thus, I’d like to talk a bit about string concatenation in WebMethods. The most basic way to add two strings is to use the pub.string.concat service in the WmPublic package as shown below:

Image 01. pub.string.concat service

Implement If-Then-Else Logic in WebMethods

Conditional Logic is the most important building block of any software development tool. WebMethods is not a programming language, but since we use it to build integration interface, which is also software, it means we are also programming with it. Writing a simple “If-Then-Else” condition in WebMethod is way too verbose to me though. The official tutorial on SoftwareAG teaches us to implement an if-then-else logic using the BranchSequence, and Map nodes as depicted in the sample below:


Send email from automation script

Simple stuff but I got a few people asked me this same question, so here is how to create an automation script to send email from Maximo:

1 - Create a Communication Template:

  • Template ID: MY_COMM_TEMPLATE
  • Description: Test Communication Template
  • Applies To: ASSET

Process Inbound Twilio SMS message in Maximo

In the last post, I uploaded some demos on how we can process inbound text messages to create SR and route Workflow. There are a few people on LinkedIn asked me how to do it. I also like to explore the option of integrating Maximo with Twilio directly without the need for App Connect. With Maximo 7.6, we can create a simple API using automation script. So, the video below is how we can create a simple script API and direct Twilio HTTP requests to Maximo:



Interacting with Maximo via SMS

Voice call and SMS are being used as a user interaction interface in many systems and services provided by large organizations. However, in the past, this integration is quite complex and expensive, and thus, I never had a chance to play around with. Recently, I posted an article on how we can easily configure Maximo to send notification as SMS message. This is made easy and (free for developers) by using Twilio. 

Sending inbound command to a system from Twilio is more complex as it requires setting up of a Web Server and writing code to parse HTTP POST data and forward the message to an on-premise Maximo system. With App Connect, it becomes easy (and free for developers) to set up an API gateway on cloud and routing message to a system hosted in-house. So I decided to give it a try by imagine a two easy-to-achieve use cases as follow:
  • Field workers sending a text message to Maximo to create a new Work Request, report Incident, or Defect. This could be useful to quickly register an action item without having a smart device or 3G connection. Below is a quick demo of this scenario:


SMS Notification for Maximo using Twilio

Every once in a while, someone would ask me if we can configure Maximo to send notification via text messages? With Maximo, the answer to such questions is always Yes. However, with this one, it will cost some money, very cheap though.

Since it is not free, I would say for most Maximo notification scenarios, the user would be ok with email notification which is free. However, there are certain scenarios where SMS notification can add value such as:
  • Notify a field worker when a new high priority Work Order is assigned to him/her
  • Notify an asset owner when the asset deviates from normal operating parameter range or when downtime is reported
  • Notify Maximo admin when there are repeated login attempts from an uncommon IP address or when there is a major problem tracked by Escalation app.


IBM App Connect - Integrate Maximo with Google Sheet, SalesForce, and ServiceNow

While having a break between projects, I have some free time to play around with IBM’s new toy: App Connect. After several years working with Enterprise applications, I’ve got to a point where I can tell if a system is great or not after playing around with it for a short time.  Some examples of great systems or platforms I have experience with is Maximo (of course), React Native (for mobile development), and SAP. Some examples of *not so great* systems I played with include Oracle EBS, Infor SunSystems, Maximo Anywhere mobile platform.

With App Connect, I can tell this is an excellent tool after going through a few beginner tutorials. I can immediately come up with some useful use case using it to enhance Maximo by integrating it with other cloud applications. Below are two examples:

Basic steps integrating Maximo Spatial and ArcGIS

Due to many changes in different versions, documentation provided by IBM for Maximo Spatial integration is scattered and inconsistent. In this video, I’ll give a quick demo on how to carry out the most basic configuration to enable integration between Maximo Spatial version 7.6 and ArcGIS.



In the video, what we have is a sample non-secured ArcGIS online server. However, enterprise GIS map services are often provided via SSL layer and can use token-based authentication. So below are some of the common problems

Bulk upload images via Integration Framework



In the previous post, I have provided an example on how we can customize Object Structure to enable import/export binary data via MIF. In Maximo 7.6, the automation scripting framework has been greatly extended to support integration. With this update, we can enable import/export of binary data by adding a simple script without having to write and deploy custom java code. Below is an example how we can configure Maximo 7.6 to bulk upload images to Item Master application:

Step 1: Add an Object Structure integration script
  • Open System Configuration > Platform Configuration > Automation Script application
  • On Select Action menu, choose Create > Script for Integration
  • On the Create Script for Integration pop-up, enter the following details:
    • Select “Object Structure
    • Choose “MXITEM” for Object Structure
    • Select “Inbound Processing
    • Language: Python
    • Paste the following piece of code to the  Source Code text area:


    • Click on Create. Then save the script

Federated MBO – Filling the gap between Maximo and IOT


Recently I got some time to explore the new Federated MBO feature. I like it a lot because it is very 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 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.

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