Generate DBC Script for Maximo

This post includes some of my notes on using DBC for deployment of Maximo configuration. In case you wonder why using DBC, the short answer is, if you’re happy with whatever method you’re using to deploy configuration, whether it is manual or using Migration Manager, ignore this post. But if you’re looking for a way to streamline development process for a large team by collaborating and source controlling using GIT, or if you want to fully automate the deployment process, DBC is the way to go.

IBM has been using DBC script for a long time, but only recently, they published a reference guide so third 3rd party consultants like us can use. DBC Script can be used to automate most of the common configuration for Maximo. It has standard commands to create/modify common low-level objects like table, index, domains etc. For many other configurations which don’t have a specific DBC command, we still can handle the deployment using the <freeform> or <insert> statement to put in anything into Maximo DB. Below are some specific notes on certain type of changes:
  • DB Configuration and system objects: operations to add/modify many low-level objects like tables, views, maxvars… are available as DBC commands. However, to manually write all of the scripts can be laborious. We can instead make the changes from Maximo’s front-end, then generate DBC script for the changes by using the ScriptBuilder.bat tool (found under tools\maximo\internal). Simply add the objects you want to generate script, then choose File > Generate Script. The script file will be created in the same folder:
Figure 1: Script Builder UI Tool

  • App Design: the standard method to export/import XML file using App Designer is simple enough and suitable for version control. However, if we want to fully automate the deployment process (for CI/CD) we can export the changes to DBC script using the mxdiff.bat tool (found under \tools\maximo\screen-upgrade). For example, if we add a new column to the List tab of the Work Order Tracking app, we can export the xml files of the before and after version of the app. Copy the two files into \screen-upgrade folder and execute this command: mxdiff.bat -bWOTRACKOLD.XML -mWOTRACKNEW.XML -t001.mxs It will produce the script as shown in the image below. (Do note that extension for changes in app layout design should be .mxs instead of .dbc)


  • Other configurations: for many other configurations such as integration framework, escalation, messages, workflow etc., there is no standard DBC command to create or modify those objects. However, all such configurations are stored inside Maximo’s database and if we can export then import the correct data to the target environment, it would work well (some objects will require a Maximo restart to refresh data cache). The easiest method is to use the geninsertdbc.bat tool to export data you already configured to DBC script. This tool is better than using free SQL statement because it will handle data duplication and sequence ID automatically. To use the tool, we simply having to give it a table name and a where clause, it will generate the data found as DBC insert statements. For example, execute command: geninsertdbc.bat -tMAXINTOBJECT -w”INTOBJECTNAME=’ZZWO’” -fOUTPUT will export all  detailed rows of my custom ZZWO object structure into insert statement as below
  • The main tables that contain configuration for some common objects are listed below:

o   Integration Framework
§  Object Structure: MAXINTOBJECT, MAXINTOBJDETAIL, MAXINTOBJCOLS
§  Publish Channel: MAXIFACEOUT
§  Enterprise Service: MAXIFACEIN
§  End Points: MAXENDPOINT, MAXENDPOINTDTL
§  External System: MAXEXTSYSTEM, MAXEXTIFACEOUT, MAXEXTIFACEIN
o   Escalation: ESCALATION, ESCREFPOINT
o   Cron Task: CRONTASKDEF , CRONTASKINSTANCE,
o   Workflow: WFPROCESS, WFNODE, WFASSIGNMENT

2023 Updates:
  • Automation Script: we can use geninsertdbc.bat to generate DBC from auto script configuration. However, if the java/python script content contains illegal XML characters, it will break DBC format. For version control, we can simply manage the script content separately. And for deployment, it will involve a few manual steps to copy/paste the script to the target environment. If fully automated deployment process is what you’re after, the ICD product has an ImportObject and ExportObject tools (found under \com\ibm\ism\pmcom\tools) which can be used to export autoscript to DBC. We can use it directly or decompile the class to learn from it to build our own custom DBC java handler. UPDATE: in newer versions of Maximo, the Automation Script app now has the Import/Export function out-of-the-box which we can use to migrate scripts between environments. Permission to see the buttons is not granted by default. Thus you'll need to give yourself this access first before you can use the Import/Export function
  • Star Center and Saved Query: for migrating/deploying changes to this two items, I find the easiest way is to extract the data into DBC script using geninsertdbc.bat. The configuration for each object is stored in one table below. Please note that for Start Center and result sets to displayed correctly, there are other dependent objects that need to be migrated such as Object Structure, security permission etc. (See this post for more details)
    • Start Ceneter: SCTEMPLATE
    • Saved Query: QUERY
  • GenInsertDBC.bat tool generated Null value as an empty string. Thus, it can create bugs with certain logic that requires the value to be Null (e.g. when using mbo.isNull("FieldName") ). In such case, I had to use another update SQL statement to fix the data.

7 comments:

  1. Excellent work as usual Viet. DBC is certainly a great method to maintain consistency and if you ever run up a new Maximo, it easy to add them.

    ReplyDelete
  2. Does anyone know how to hide a specific Maximo security group from users

    ReplyDelete
  3. reference guide Link Mentioned in not opening. Any idea how can we open it or get the information present in the link

    ReplyDelete
    Replies
    1. IBM has the habit of changing its websites every year or two, breaking all the links. In this case, it looks like they’ve taken this down. I couldn’t google it anymore. The easiest way is to find similar syntax from existing scripts provided with Maximo, then copy/paste

      Delete
  4. Great Info Viet. How this will handle dependencies like in Migration when generating dbc scripts using main object for some configurations.

    ReplyDelete