November 13, 2015

Avoiding Java classes conflicts using a_customer.xml file

Consider this scenario (which I came across). You have extended out of the box MBO class with your own class to implement you own business logic for work orders. After a while you install the Maximo Scheduler extension and you soon discover that all your custom logic has gone because the WORKORDER object handler in Database Configuration is now instead of your custom class. This is because the Maximo Scheduler installation has overwritten your custom handler.

Lesson learned: If you have custom classes and extend the same classes which other products also are extending, then those classes will get overwritten when other products are installed and your customizations will be lost.

In order to maintain the customizations, you must define a_customer.xml file in the applications\maximo\properties\product folder. The following example shows a sample a_customer.xml file.

<?xml version="1.0" encoding="UTF-8" ?>
  <name>My custom classes</name>
    <mbo objectname='WORKORDER' extends=''></mbo>
    <mboset objectname='WORKORDER' extends=''></mboset>

Also, you need to create a directory called "a_customer" inside your tools\maximo\en directory. This directory can be left empty.

This will tell the Maximo installer to merge your custom code with the add-ons code.

For more details refer to the following articles:


  1. What does it mean it will merge custom code?

    1. Merge what?
      It will update the object's mbo class with your custom class in the db, that was overwritten by the new product installation.
      The same works for field classes.

    2. This comment has been removed by the author.

    3. This comment has been removed by the author.

  2. As far as I know, the "merge" concept does not exist in Java. Am I wrong ?
    What I do (since Maximo 5.0...) :
    I edit my sources (import section and extend key word) :
    Then I compile them
    Then I rebuild EAR and redeploy
    Then I check the ClassName in MaxObject, MaxObjectCfg, MaxAttribute, MaxAttributeCfg tables (and update them if something was going wrong).
    Then I restart MXServer.

    I would be VERY interested in the way to install SEVERAL industry solution (i.e Oil a Gas plus Transportation plus Nuclear). How to do in such case ? What to do in a_customer.xml? In what way should I edit the respective XML of Oil and Gas, Transportation ant Nuclear products ?