September 29, 2012

Let's celebrate the 100th post!!!

MaximoDev has now reached 100 posts of useful tips, tutorials and small guides to help the Maximo technical community.
After more than 2 years of MaximoDev activity, I have achieved an incredible success becoming the most followed and visited free and ads-free web site about IBM Maximo features, configuration, customization and development topics.
To explain you the success of this blog I will show the historical trend of the website's monthly page views.

Apart from the short fall during this summertime, the number of monthly contacts has reached an incredible value of 13.000 and is still growing at an incredible pace.

Stay tuned... and don't forget to give me a

September 27, 2012

How to check for null values

This entry is part of the Maximo Java Development series.

A very common doubt when extending MBOs is what value returns the Mbo.getString() method when the target field has a null value. The answer is: It returns an empty string "".
Thus to check if the DESCRIPTION of an Mbo is empty or null you can use two basic approaches.

If you need do distinguish between null values and empty string you can use the Mbo.getMboValueData() method.
Thus to check if the DESCRIPTION of an Mbo is null use this code snippet.

If you are in an Mbo class you can perform the same check as follows:

September 26, 2012

What's new in Maximo Asset Management

Maximo Asset Management version incorporates several new features, such as the ability to link Maximo Asset Management applications to external applications and the option to configure high availability for your environment. also introduces email interaction, which enables a user to change the status of an object or workflow assignment by email. In addition to these enhancements, version provides improved documentation in areas such as installation and automation scripting.

You can now access the installation information for the most common middleware combinations in a convenient PDF document. Installation guides are available for three sample middleware groupings. Learn more...

You can configure the components of your environment to provide high availability of your system and data. By implementing high availability for your environment, hardware and software services can be restored when a failure occurs, often in less than a minute. Learn more...
With email interaction, a user who does not have access to a desktop computer can change the status of an object or workflow assignment. The email interaction speeds up the response and action times for users who are working off site. Learn more...
All system properties are now available with a description and the default information in the Information Center. The system properties are grouped in categories such as OSLC (Open Services for Lifecycle Collaboration), REST API, and security. You can view all related properties together in one location. Learn more...
When you need to create an object, you might duplicate an existing object to reduce the time that is required to complete this task. You can now exclude user-defined attributes that should not be copied to the new object.
Detailed end-to-end instructions are available for creating and deploying clusters. Clusters are an advanced configuration option. Clusters group similar functions on two or more Java virtual machines (JVMs) to process a single function, such as scheduled cron tasks. Learn more...
New instructions are provided for optimizing system performance. You can learn how to find the optimal heap setting in WebSphere® Application Server and how to configure performance-related settings in DB2®. You can also learn database optimization methods that you can apply to any database, including managing indexes, customizing queries, and setting sequence caches. Learn more...
You can set a system property to allow status inheritance for work items that are under process flow control. You can now control whether status inheritance applies when process flow control is switched on. Learn more...

Integrating with external applications
Maximo Asset Management applications and some external applications can link and share data by using OSLC integration. You use the new OSLC Providers application to integrate a Maximo Asset Management application, such as Service Requests, with an external provider application, such as Rational Team Concert™. Learn more...
A new logger is available for using new OSLC capabilities. The integration provides logging for the design process, when an OSLC interaction is created, and for the execution process, when an OSLC interaction is executed by the user. With the OSLC logger, you can identify any OSLC-based processing errors that are reported.

Work and asset management
You can create conditions and apply them to job plans to specify that work can begin only when certain conditions are satisfied. Job plan conditions automate the creation of new work items on a work order and improve the flow of work in your organization. Learn more...
You can add the last memo from the most recent workflow assignment action to a communication template. This enhancement ensures that memos created for communication templates in a workflow process are immediately available to the user. Learn more...

Application configuration
You add the allowqualifiedrestriction property to the XML for an application to restrict the data that is returned from the database. Learn more...

User assistance
A new section of the information center provides information about the messages that you see while installing or using the product. These messages might appear in the user interface or log files and are categorized by prefix. You can use the search function in the information center to find the messages. Learn more...

Automation scripting
The automation script content in the information center includes new information about variables and data retrieval. A detailed end-to-end example of the implementation of an automation script with an action launch point is also provided. The example shows how to use an automation script to automate assigning service requests to service groups. Learn more...

Version includes new versions of the business intelligence and reporting tool (BIRT) and Cognos Reporting. The new versions are BIRT 3.7.1 and Cognos 10.1.1. Learn more...

The logging content in the information center includes new information about log correlation and escalation logs. Other new information includes automation script logging, integration framework logging, and cron task logging. Learn more...

Source: IBM Maximo Asset Management 7.5 InfoCenter

September 21, 2012

Using Maximo email listener with GMail

An outstanding set of articles about how to configure and use the Maximo Email Listener with GMail are available on IBM Asset Management blog.
Here are the links:
  1. Importing the SSL Certificate
  2. Configuring SMTP Over SSL
  3. Sending Service Requests

September 18, 2012

Find large Maximo tables and indexes on Oracle

When you have to assess the system performance of a Maximo server it may be useful to have a quickly see what are the larger database tables and indexes. This can quickly spot some performance issues in your system.
Large tables generates heavy database I/O workloads when are nor accesses through an index. Large indexes are also inefficient. Creating indexes with too many columns is a very common mistake. Dropping complex indexes and creating two or three smaller ones can improve query times in many cases.

Here is a useful SQL query (for Oracle) to list the larger database tables and indexes together with their size in MBytes.

SELECT segment_name, segment_type, tablespace_name, SUM(bytes)/1048576 megs
FROM user_extents
GROUP BY segment_name, segment_type, tablespace_name

Maximo Health Check report

There is now a better and easier way to have the same information and much more details about potential performance issues in Maximo just by running a BIRT report.
Check out the Maximo Health Check report on developerWorks.

September 11, 2012

Navigating object relationship in MBO code

This entry is part of the Maximo Java Development series.

When you are in an Mbo class or you already have a reference to an Mbo object is it possible to retrieve the related records using Maximo object relationships as defined in the Database Configuration application.
For example the ASSET object has a relationship called ACTIVEASSETMETER to the ASSETMETER object. This relationship allows to find all active asset meters for the current asset. The resulting set will contain zero or more objects.

If you are in a class that extend the this object already provides a reference to the current Mbo. Use the Mbo.getMboSet(String mboSetName) method to retrieve a related MboSet.
The following snippet prints to the system logs the list of the active meters for the current asset. You can extend the asset Mbo and try to put this code in the init() method to test it.

MboSetRemote meterSet = this.getMboSet("ACTIVEASSETMETER");
MboRemote meter;
for(int j=0; ((meter = meterSet.getMbo(j)) != null); j++)
  String name = meter.getString("METERNAME");
  String desc = meter.getString("METER.DESCRIPTION");
  System.out.println(name + " - " + desc);

In the example I have also used the ASSETMETER.METER relationship in the getString method to directly retrieve the description of the each meter.

Note that Mbos obtained via relationship are included in the same transaction as the parent MBO set so you don't have to explicitly call the save() method.

September 10, 2012

What Mbo/MboSet/MboValueAdapter method should I override?

This entry is part of the Maximo Java Development series.

One of the biggest issues when implementing Java customizations in the Maximo Business Objects layer is to know what is the best method to override to achieve a specific goal.
Here I have listed the most common usages of the the main methods in Mbo, MboSet and MboValueAdapter classes.

  • init(): Called by the framework when the Mbo has been constructed and the MboValues have been initialized.
    • Custom initialization
    • Set field access
  • add(): This is called when a new Mbo is added to the MboSet. It is called after user defaults have been set from the data dictionary.
    • Set field defaults
  • save(): Save the object and other linked objects.
    • Update linked/child objects
  • delete(long accessModifier): Mark the object to be deleted depending on the access modifier. Object is not actually deleted in the database until save() is called.
    • Delete child objects

  • canAdd(): Can an object be added to the collection ?
    • Custom rules to avoid the addition of new records to the MboSet

  • initValue(): The first method executed after the constructor. Values are already loaded from the database
    • Initialize attributes on new records
  • init(): Called after initValue()
    • Set current attribute as read-only based on some condition
    • Set related attributes access flags
  • validate(): Called when field value is changed (tab-out)
    • Verify whether the value for the attribute is valid
  • action(): Called when field value is changed after validate()
    • Update to other fields and related objects

Note: Be careful when extending Maximo Business Objects and don't forget to follow the Java MBO performance optimization golden rules.

September 6, 2012

Analyze and troubleshoot Maximo performances with Maximo Activity Dashboard (MAD)

Maximo Activity Dashboard (also known as MAD or PerfMon) is a useful tool to analyze and troubleshoot Maximo performances and is available starting from TPAE This great tool tracks execution times for each browser request (user-click) including the time spent querying DB with a great detail about executed queries and time spent for each sub-step execution.

Instructions are different based on the version of TPAE you are running on:

Note that enabling PerfMon will significantly degrade server performance and so it should be used carefully, especially on production servers.

September 5, 2012

How to debug Maximo/TPAE

This entry is part of the Maximo Java Development series.

Debugging is a great aid in developing Maximo/TPAE customizations in Java. This powerful technique, albeit simple, is too often ignored or neglected by less experienced developers. In this tutorial I will show how to connect Eclipse to a remote Maximo server in debug mode.
Here we go.

Enable debug mode in WebSphere

First thing to do is to enable debugging of the MXServer application server in WebSphere.
Open WAS console and find the MXServer application server under 'Servers' group.

Click on the MXServer link and search for the 'Process Definition' under the 'Java and Process Management' group on the right side.

Now click on 'Java Virtual Machine' on the right and search the 'Debug Mode' checkbox. Check the 'Debug Mode' flag and take note of the debug port on the text box below (7777).

Now restart MXServer and you are ready to debug.

Attach the Eclipse debugger to MXServer

Launch Eclipse and open your Maximo Java project. I hope you have one:-)
Click on the drop-down arrow next to the Debug Menu button and select Debug Configurations.

Select 'Remote Java Application' then click on the 'Add' button on the upper-left and fill the Connection properties with the hostname of the Maximo application server and the debug port as configured in WebSphere.

Click on Debug button.
Now the Debug perspective should open automatically. If not, select Window > Open Perspective > Other > Debug. You should see something like this in the Debug view.

Now you are ready to debug. Try to put a breakpoint in your custom code and see what happens.
A mayor advantage of debugging is that you can hot-swap your code changes into the application server. All you have to do is to save the Java class and Eclipse will automatically compile and replace it in Maximo as long as you are connected.
Unfortunately this not always work and sometimes you get the following error.

In such cases, you have to stop the application server, replace the class tree and start over.

This technique, paired with the Rapid Java class deployment on WebSphere, can greatly speedup your job leaving some free time to go on Facebook :-)

An Open Letter to the Project Management Community

Today's post is very different from a typical MaximoDev technical article. Nevertheless I want to share with my little community my thoughts as a consultant and developer who strongly believes in the Agile Software Development values and principles.

Dear Project Managers everywhere,

I hear you have mixed views about the recent, er, “developments”, in the field of Software Development, commonly referred-to as “Agile Software Development practices”. I won’t call them “advances” as we may not be able to agree that they have, in fact, advanced anything.

I am writing to you today to share some opinions and observations about the changes in the software development field. Whilst patchy in their uptake, changes are afoot and we cannot stop them.

The Agile Software Development has brought tensions and misunderstandings between developers and project managers. Nowhere have these been more evident, perhaps, than between ‘traditional’ project managers and the Agile crowd.

I find it helpful to characterise this conflict as a clash of world-views. In a nutshell, a clash between what McGregor has called “Theory X” and “Theory Y”. A clash between a  positivist view of the world that believes in knowledge as a finite and achievable objective, and a postmodernist thinking of uncertainty and unpredictability.

I hope I’m right in thinking that we all share a common objective – a desire to see better outcomes for our customers, delivered within timescales and at a cost that delights everyone involved. Oh, and maybe improving effectiveness of the organisations within which we work, too.

Whilst it may appear the arguments and contentions arise from our different ways and means for achieving this objective, I’d like to suggest that the conflict – as a product of conflicting world-views – is more deep-seated, and thus more inestricable.

And given the fundamental differences between these world-views, it seems overly optimistic to expect these world-views even to coexist peacefully and productively.

All we might hope for is a little more understanding, a little less fractiousness, and a future where we can all at least agree to disagree.

Thanks for listening,
  an Agile thinker

Inspired (and partially copied) from a Bob Marshall's post.

September 4, 2012

Maximo Web Services tutorial

This entry is part of the Maximo Integration Framework series.

This article explains how to setup and use Web Services capabilities of the Maximo Integration Framework (MIF/MEA).
In Maximo there are three different types of services that can be invoked from Web Services: Object Structure, Enterprise and Standard Services. This article will focus on Object Structure Services for simplicity of discussion but is generally useful to understand how to interact with Maximo through Web Services.

Test tool setup

To play with Web Services you need a client to generate test calls to Maximo. I strongly suggest to use soapUI. It may seems complex at the beginning but is a very powerful and easy tool in the real world. You can download soapUI from here.

Create the Web Service

The first step is to define the Object Structure.
In this example we will create a person record using the out-of-the-box MXPERSON object structure so we don't need to create a new one. In real world scenarios, you typically clone an existing Object Structure to simplify or enrich it. To see the list of object structures defined or to create new object structure, use the Object Structures application under the Integration module.

Now it's time to create the Web Service. To create a new Web Service from the MXPERSON object structure go to Integration - Web Services Library - Create WS from Object Structure and select the MXPERSON object structure.

Deploy the Web Service

Now that we have defined the MXPERSON Web Service it's time to generate the XSD files that describes the service. Open the MXPERSON service in the Web Services Library application and click on the 'Generate schema/View XML' button.

The schema files are generated under the directory defined in the system property (e.g. C:\MIF\schema\service).

The last step is to deploy the Web Service and generate the Web Service Definition Language (WSDL) file. The WSDL file provides a description of how the service can be called, what parameters it expects, and what data structures it returns.
To deploy the Web Service, select the Deploy Web Service menu option of the Web Services Library application. If you are on TPAE 7.5 choose Deploy to Product Web Service Container - Deploy Web Service. If you get a BMXAA7755E error follow this technote to fix it.
On successful deployment the "Is Deployed?" check box should be checked.

To retrieve the WSDL file you have two options:

  • On the local filesystem in the directory
  • With the web browser at address http://[MXHOST]/meaweb/wsdl/[OSNAME].wsdl

Test the Web Service

Open soapUI and create a new project importing the WSDL files generated in the previous steps.

I started from QueryMXPERSON sample request, removing most of the optional elements. With the following request I was able to retrieve a PERSON record from Maximo.

    <max:QueryMXPERSON rsStart="0">
      <max:MXPERSONQuery operandMode="AND">
          <max:DISPLAYNAME operator="=">Tom Revis</max:DISPLAYNAME>

This is the result in soapUI.

With a similar approach is possible to use the other interfaces to create, delete and update records in the Maximo database.


If security is enabled you will get an 'Unauthorized error'. To solve this problem you must add the MAXAUTH HTTP header.
First of all you have to encode username and password to be sent. The MAXAUTH should be formatted like this [USERNAME]:[PASSWORD] and encoded in Base 64. Here is a free Base64 online encoder.
Now you can add the encoded string to the HTTP header. In the request page where you can see your XML request on the left and response on the right, click Headers tab under the window where you can see the XML request text. Then click Add a custom HTTP header icon, specify MAXAUTH as the header name, and the value should be the encoded string.


September 3, 2012

MBO Performance Tip N.8 - If there is no other way... use JDBC

This entry is part of the Java MBO performance optimization golden rules series.

Sometimes you have to perform some complex logic or you have to join several tables to retrieve a piece of data. In other cases there is a piece of code where performance is critical. In such cases it may be hard to achieve good performances accessing and fetching large MBO sets. Now it may be better to directly access the Maximo database to issue a well-tuned SQL query.

The DBShortcut or DBManager() classes allow to directly access the database. Look at this post that describes the different techniques to retrieve a JDBC connection to the Maximo database.

When using this technique be aware of any security or other business logic that you may be bypassing by not using MBOs. Ensure that you are not bypassing any important logic, such as security logic which restricts users from seeing certain sets of data.

I strongly suggest to use this technique only when data reading data. When modifying and saving data, it is better to use the MBOs to leverage security and validation checks provided by business objects.

September 2, 2012

MBO Performance Tip N.7 - Use efficient SQL

This entry is part of the Java MBO performance optimization golden rules series.

A not well tuned SQL query is often the biggest contributor to elapsed time taken by Maximo Business Objects (MBO) logic.

A general example of this is the use of IN or NOT IN in SQL where clauses. Avoid IN or NOT IN but use EXISTS instead in order to increase SQL performance.

The two examples below will look for employees that are not managers.

SELECT name FROM employee
WHERE id NOT IN (SELECT id FROM managers)

SELECT name FROM employee

The second one typically runs much faster than the first.

The use of  the EXISTS statement should generally preferred both in terms of performance and expected functional behavior.

Generally speaking a badly designed SQL query, especially when it runs on large tables, can generate a lot of performance issues in Maximo.

September 1, 2012

MBO Performance Tip N.6 - Free resources as soon as possible

This entry is part of the Java MBO performance optimization golden rules series.

It is important to know the difference between close(), cleanup(), and clear() methods and use them to free up resources as soon as possible.
  • close(): Close the cursor, release the database resources (result set),  SQL statement, and connection key. Does not release MBO objects. You can still work with MBOs already retrieved from the MboSet. Close the set as soon as possible if reusing the set is not needed in following logic.
  • cleanup(): Reset the MboSet, and clear its current transaction. Clears any filters.
  • clear(): Removes all the objects from the collection as well as all related objects.