Maximo’s Integration Framework (MIF) does not natively support the HTTP PATCH verb. This can be a challenge when integrating with modern REST APIs such as Microsoft Dynamics 365 or other line of business systems that expect partial updates via PATCH rather than full replacements using PUT.
The Integration Framework includes support for scripted endpoints, which provide a programmable extension point within MIF. By leveraging a scripted endpoint, custom logic can be introduced to handle outbound HTTP PATCH requests while still using MIF for orchestration, security, error tracking, and logging.
Why use a scripted endpoint?
Using a scripted endpoint allows you to retain the benefits of MIF while extending its capabilities:
- MIF continues to manage
- Object structures and JSON mapping
- Processing rules
- Error logging through Message Tracking
- Message reprocessing and retries
- Security and configuration using standard Maximo tools
- The script acts as a thin adapter layer
- Accepts the JSON payload generated by Maximo
- Adds necessary HTTP headers
- URL formatting (eg. Adding additional entities to URL)
Steps to Implement a PATCH Call via Scripted Endpoint
- Create an Automation Script without a Launch Point
Here’s a sample script:
# requestDataS contains the JSON payload from MIF
# token contains a valid bearer token string
# targetUrl is the external API endpoint
# Build HTTP parameters (HTTP/1.1, UTF-8, expect-continue)
params = BasicHttpParams()
paramsBean = HttpProtocolParamBean(params)
paramsBean.setVersion(HttpVersion.HTTP_1_1)
paramsBean.setContentCharset("UTF-8")
paramsBean.setUseExpectContinue(True)
# Wrap the incoming JSON as the HTTP body
entity = StringEntity(requestDataS, "UTF-8")
# Create HTTP client and PATCH request
client = DefaultHttpClient()
request = HttpPatch(targetUrl)
request.setParams(params)
request.addHeader(HttpHeaders.CONTENT_TYPE, "application/json")
request.setEntity(entity)
# Execute PATCH and log status
response = client.execute(request)
statusCode = response.getStatusLine().getStatusCode()
logger.info("PATCH call status: " + str(statusCode))
- Create an Endpoint in Maximo
- Navigate to Integration End Points
- Click New End Point
- Set Handler to SCRIPT
- Enter the Script Name created in step 1 as the value
End point is now ready to be attached to a Publish Channel in External Systems.
Additional Takeaways
- The JSON payload (requestDataS) can be modified within the script to meet the requirements of the target system.
- URL can be amended with the data for patching. E.g. PONUM can be added to the URL for updating/patching the record.
- Authentication tokens (e.g. OAuth tokens generated by Maximo) can be added as headers directly in the script.
- Precise error handling can be implemented to provide actionable failure information for a Maximo administrator.
By leveraging Maximo’s scripting capabilities and scripted endpoints, you can extend the Integration Framework to support HTTP PATCH operations in a maintainable and fully supported manner, while retaining the security, logging, and error-handling features of MIF.