XSLT Data Transformation in Maximo

Are you in need of synchronizing to an external database with different column names and different data types? Do you have a requirement to integrate data from an external database that does not match your attributes?

XSLT may be just what you are looking for.

XSLT stands for extensible stylesheet language transformation, and it is backboned by XSL (Extensible Stylesheet Language). If you are new to this, you may say “what does that mean?” Think of XSL as a style sheet for XML, much like CSS is a style sheet for HTML. It is a set of order that allows you to form your XML. This can be something eye catching, such as displaying your XML with colors or fonts, or a full-fledged re-arranging of the way the XML data looked originally. Essentially, XSLT transforms XML from one document to another. It is created from different languages and will use them to retrieve the data you are requesting. Some parts of your document will rely on XPath to point to the data being retrieved. Some parts could use XQuery to query a database and bring back what you specifically need.

In this document, we’ll look at how XSLT is formed, how it retrieves data, how it re-formats data for transmission from one database to another, and how it is applied while the data is passing through a middleware system (e.g. WebSphere or Weblogic) into an external database from a Maximo database.

So, let’s get started. XML is the ultimate data transporting format. It is the backbone for the vast amount of data transmission that we do, and can be tweaked in many ways to pass data from one system to another. As mentioned above, knowing how to edit/write the additional languages (and apply them) will offer you boundless potential. In our scenario, we have an XML output from a Maximo database that has work order data.

This, unfortunately, is not going to work for our destination database, as it has different column names, attribute names, and data types that only allow so many characters to be in an attribute’s field. The destination database will render its XML output to look something like this:

At this point you may be thinking…”Whoa, how am I going to do anything with this?” WONUM is CUSTOMER. SITEID is LOCATION. PRODUCT is only the third section of my GLACCOUNT attribute, and why would you want two different descriptions with one of them obviously having been shortened? Enter XSLT.

With an XSLT document, we can re-construct the XML from what was originally produced by one database into a new “document” that relates the correct names and data that can be passed into the destination database. Let’s take a closer look at how this is done.

When setting up your document, of course you will need to make your opening declarations as done in the tag <xsl:stylesheet version=”1.0″ xmlns:xsl=http://www.w3.org/1999/XSL/Transform…………/>. The Transform section is indicating that this XSL sheet is actually an XSL(transformation). You can use transform instead of stylesheet at the beginning of the tag, but where the real work begins is at the <xsl:template match=”/”> tag. The element (match=”/”) is XPath and it points the XSLT file to the root of the results set that can be accessed.

You will also see that a match=”PublishMXWO_XSLT” as well as a few other match= elements are in place. Basically, the PublishMXWO_XSLT is our publish channel, which sends data out of a Maximo integration. We’ve got an XSLTSet (which is how Maximo can retrieve data in a dataset), and we’ve got WORKORDER, which is our actual object from the database. This lets the XSLT document know where we are retrieving our data from.

The next key element that is used is an XSL element that allows for the data to be “transformed” from one value to another. The XSLT element <xsl:value-of> is critical to extracting the value of a selected node from the source XML. Further down in your XSLT document, you will code for what you want to transform.

In this example of code, my matched value of SITEID is what we want to “transform” and, via the value-of element, we are telling the document to set it to LOCATION. Additionally, in XSLT, when using the select=”.” element, you will retrieve the current node. That node is LOCATION.

Further “drilling down” can be done via the <xsl: for-each/> element, however, we will only be transforming data in this document. More info on the for-each element can be studied here. There are many, many elements that can be used with XSL/XSLT that you may have a use for sometime down the line.

Now that you’ve seen how to transform an attribute, lets look at that tricky case of just needing the third section of the GL account; as that is all that is desired by the destination database.

Here, once our match has provided the dataset we want, we want to further “drill down” and pull back the number 2 section of the GL account as noticed in the select=”GLACCOUNT/GLCOMP[@glorder=’2′]”

In this code we simply want to transfer the third section of the GL Account. In Maximo, or more correctly the database, the GL Account sections are stored as section 1 (0 in the order), section 2 (1 in the order), and section 3 (2 in the order). We simply need to transfer the third (2) section in this integration. If we asked for the GLACCOUNT, the output would come back looking like this:

This is not the desired data, so the select=”GLACCOUNT/GLCOMP[@glorder=’2′]” statement will pull just the glorder 2.

We have one more tricky problem to deal with; our destination database has a description attribute that only allows 30 characters per field and a short description attribute that only allows 10 characters. We’ll set this on our match going into their database attributes.

Here we have the match element pulling description and our value-of element (going to our destination database) has attributes of DESCR and DESCRSHORT:

In our stylesheet, we are going to match the node, order, and length via the ., 1, and 30/10 substring values.

Once we have that done, we have our XSLT sheet set up and the complete document looks like this:

Now, we are done with our document and it needs to be added into your integration. Our Integration is outbound, so it is a Publish Channel, but an Enterprise Service can also be set up with an XSL transformation. In the XSL Map field, you will put the directory where your .xsl doc will exist (e.g. C:\TEMP\mycoolXSLTdoc.xsl).

A point of note for those who decide to use XSLT mapping in a multi-server (clustered) environment: if you have not built the XSL file into the EAR or cannot build the XSL into the EAR, you will need to put a copy of the XSL file into all of the servers that your integration can access in the directory path mentioned in the Publish Channel/External System.

Once the XSL Map is in place and the integration is turned on, Maximo will publish messages that get transformed into the external system format.

Go out there and give it a try, and the next time you’re in a meeting with one of your users and they say “how are we going to get the data from here to here”, you may just have the answer for them!

Feel free to leave any comments or questions below. For visual instruction of the previous steps, check out our video tutorial.

Related posts

4 comments

  • Hi ,

    Its a wonderful article , Please emphasize on the location of XSLT or where we should place the XSLT So that Maximo server could read it but restart is not required when we update it?
    This is super important to know because this avoids expensive downtime when change required.

    waiting for the reply

    Thanks!

    • A
      Alex Walter

      The value in the XSL Map field is a path to the file. This can either be an absolute path with a full drive letter to a valid file on the server, e.g. C:\Temp\myfile.xsl, or a relative path to a file built within the MAXIMO.EAR archive. In a development situation, it’s oftentimes easier to use the absolute path option. Simply change the file on the server and stop/start the Maximo application server to see your changes. There is no need to rebuild the MAXIMO.EAR archive in that case. In Production however, it’s often better to build the XSL file into the MAXIMO.EAR archive.

  • How do you process data into Multiple Maximo objects using XSL mapping? Can you share XSL file that insert data into multiple objects?

  • Anonymous

    Hi Alex,

    Thanks for this great article.

    Below, I am trying to convert STATUSDATE from format YYYY-MM-DDTHH:MM:SS.FFFFF to YYYY-MM-DD HH:MI:SS,
    but its not working as expected. Could you assist please?

    Completed

Shane

Maximo Analyst

As a recent graduate in computer science and cybersecurity with a CompTIA Sec+ certification, I thrive on learning and embracing emergent challenges head-on. Though new to Maximo, I approach the day to day with determination and enthusiasm. I have been known to be competitive while also being a strong team player. Beyond the realm of technology, I cherish spending time with loved ones, playing video games, doing exercise, and cooking. I am grateful to be where I am and around so many amazing people.

MAS 8

Time to Benefit
Lower Costs
Scalability and Integration
Continuous Upgrades
Easy of Use

Visual Inspection

Accelerate Defect Detection
Flexibility to Train and Deploy
Increase Uptime 24/7 Real Time Monitoring
Better Worker Safety

Monitor

Enterprise Level Data Aggregation
Scaled Operations
AI Deductions
Advanced Root Cause Analysis

Predict

Condition Based Maintenance
Lower Costs
Better Asset Availability
Reduced Risk

Manage

Comprehensive View of Assets
Understand Resource Attributes, Configuration and Relationships
Drill Down View

Health

Improve Reliability
Performance Insight
Better Planning
Clean Data
Optimization – Data, Costs, Risks

Mobility

Boost Productivity
Safer Workplace
Reduce Knowledge Gaps
Avoid Downtime

Digital Twin

Integrate with IoT for Intelligent Asset Management
Measure Health and Performance
Meet Sustainability Goals
Write Your Digital Story – Learn from Data

Dexter

Maximo Analyst

Dexter began his career in the warehouse field. Developing his skills in inventory control, accounts payable, shipping, and receiving, and procurement. While working at Apex he was learning the Maximo system in and out. Eventually learning it so well he taught everyone how to use it. Eventually becoming a system administrator for the Apex site.

A fun fact about Dexter is that he was an Elvis impersonator for 24 years. He enjoys singing, fishing, golf, and playing pool. He's an avid movie buff, most likely you'll find him watching the latest movie.

Chip

Client Relations Specialist

Chip is new to Maximo but has worked for various software companies through his career in both a sales and client relations role. In his spare time, Chip likes to golf, travel and work on projects around the house, especially those with an artistic touch. He is also up for any type of competition whether that be playing cards, board games or recreational sports.

Sarah

Maximo Analyst

Sarah is a recent graduate starting her asset management career. She counts fast learning and determination as key skills that she’s applying to become an Maximo pro! Sarah’s background in IT Services and studies in computer science have strengthened her natural problem-solving skills and desire to help others through technology. In her free time, Sarah enjoys baking, sewing, reading comic books, and building her own video game.

Derrick

Maximo Analyst

Derrick is someone who lives for mental exercise. New challenges spin his problem solving wheels. Defeat is not an option and challenges make him smile. His catch phrase is “I’m an Engineer”. Derrick takes pride in his work. He is a highly self-driven talent when it comes to his interests and programming couldn’t be any higher on this list.

Outside of the office Derricks interests includes cars, motorcycles, and anything generally fast and loud. He stays in the loop on latest in tech, loves gaming and most of all is a die-hard anime fan. Outside of bike night, you are most likely to catch him relaxing in the glow of lights from his PC.

Xavier Galarza

Maximo Analyst

I am a recent graduate who is motivated to learn and develop new skills. I like to challenge myself every day. I want to learn all about Maximo in order to teach others how effective Maximo can be for them. I have a good understanding of the development side and work well with problem solving. I am grateful for the position I am in, I love surrounding myself with great people that are more knowledgeable than me who will help me grow as a person. In my free time I love to play videos games, watch/ play sports and spend time with family. I am a competitive person and believe I am pretty good at all sports.

My other passion is to stream video games I play and connect with others online, I love showing others how to play a certain game or even show them a skill didn’t know existed. I love entertaining others and creating content for others to watch and enjoy.

Courtney LeBlanc

Business Analyst

Courtney is a polished Maximo consultant with over 10 years working in the industry. She has worn many hats including QA Specialist, Trainer, Functional Lead, Project Lead and Business Analyst. A point of great professional pride for Courtney is helping clients meet their needs and realize the power of their investment. Being a part of the process that helps clients learn how to use their system and get the most out of it is a great feeling at the end of the day.

Bob Richardson

Director of Managed Services and Senior Analyst

Bob has led more than 50 (but less than ∞) Maximo projects with top notch client satisfaction – so he must be doing something right. He is a seasoned veteran who heads our operational & managed services team. He is instrumental in developing many of our solutions and holds Maximo certifications in both functional and technical disciplines up to version 7.

Bob might or might not like squirrels. He enjoys traveling with his wife and outdoor activities. He has also been known to spend long hours in his garage contemplating life.

Kelly Nimmo

Director of Products and Senior Analyst

Kelly heads up our product development team and is a senior analyst with more than 11 years EAM/Maximo experience. She is the architect behind our flagship product offering MxMobile. She holds Maximo certifications in both functional and technical disciplines up to Maximo version 7.

In her free time if you don't find her on her boat, fishing and enjoying the beautiful Florida outdoors, then she's probably on the soccer field teaching her nieces and nephews how to do the around the world.

Kim Walter

COO

Kim began her career in Investment Banking in the Biotech and Tech sectors. After leaving banking, she focused on executive strategic development evolving her business building skills. Co-founding A3J Group was a natural fit with the idea of creating a fierce ninja style unit that outperforms all others. In her free time, she is training for her next eventing competition or studying to become a Master of Wine or practicing her tornado kick. She could be with her family hiking or surfing or cooking. But she’s definitely not sitting around doing nothing.

Alex Walter

CIO

Alex brings 18 years of Maximo/EAM consulting experience in Life Sciences, Oil & Gas, Water/Waste Management, Government facilities, and much more. He has been awarded the honor of IBM Champion from 2018-2021, and is the brainchild behind our revolutionary mobile solution MxMobile.

In his free time he buys camping gear, enjoys a good circular saw and spends time with his family hiking, surfing and being outdoors.

Enhancement

• Configuration
• Integration & data loading
• Report improvement
• Screen view & workflow changes

Sustainability

• Report
• Troubleshoot
• Learn
• Teach
• Lead

Change Management

• Advanced systematic improvements
• Tailored procedure implementation
• Script-, report-, and application-level source and document control through Git repository software
• Training on how to document and deploy changes

Monitoring

• Active monitoring of your IBM Maximo system’s heartbeat
• Triggered notifications and support tickets when Maximo is not responding
• Automated Escalations based on the health of various critical background processes.
• Periodic and quarterly scheduled system health checks

System Support & Trouble Shooting

•On Demand Support
•Advanced Troubleshooting
•Access to A3J Group’s Maximo Support Environment to submit trouble tickets
•Directly report bugs, request fixes and enhancements

System Patching & Environment Refreshes

• Tentative, bi-annual feature pack releases from IBM
• Minor patches (defined by the last number in the version model)
,• Quarterly lower environment refreshes

Admin

MxAsk

Create new self-service requests in a wizard-style format, and view the details of their open service requests.

MxApprove

Accept, reject, and reassign assignments, review assigned records, and view your workflow inbox.

MxMobile

A suite of mobile applications designed to integrate with IBM Maximo Asset Management. These apps modernize workflow, expedite inventory processes, reduce time spent on data entry, and more.

Workflow

MxMeter

View and enter meter readings, view trends in graphical format, and create readings while in offline mode.

MxAsset

Scan barcodes and view maintenance facts. Create meter readings, work orders or service requests. Toggle asset downtime.

MxWork

Create new work orders on the go, view existing work orders and attachments, and capture fingertip electronic signatures.
0