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.