Using Commtemplate to send out email in custom Java Code

Hi Friends,

Consider the following scenario, you want to send out an email whenever the Owner Group field is changed on a workorder to everyone in the new owner group.

One option is to use MXServer.sendEMail with some hardcoded content or with just a few lines without any kind of formatting.

Better option is to design a Commtemplate and send out a very well formatted email with dynamic content.

There are just a few additional steps in code if you want to do that.

Step 1: Get the CommTemplate Mbo from MXserver

MboSetRemote commSetRemote = getMboSet(“$anylogicalnae”, “COMMTEMPLATE”, ” templateid=’YOUR_TEMPLATE’ “);

Step 2: Get the content:

if(commTemplateRemote.count() > 0)

{

CommTemplate commRemote = (CommTemplate)commTemplateRemote.getMbo(0);

// mboRemote should be that object whose content wil be replaced in commtemplate. So, if your commtemplate sends out workorder information nand you have used :wonum in your template make sure mboRemote is that object whose information will be resolved/replaced

SqlFormat sqf = new SqlFormat(mboRemote, commRemote.getString(“subject”));

//Set IgnoreUnresolved to true if you want to ignore any errors in commtemplate, errors for stuff like if you have used :wonum and it cannot resolve this attribute.

sqf.setIgnoreUnresolved(true);

//Resolve Content method below converts template in to the dynamic content, by resolving I mean instead of :wonum it will put the current records wonum.

String subject = sqf.resolveContent();

//Similarly do it for the message cotent
sqf = new SqlFormat(mboRemote, commRemote.getString(“message”));

sqf.setIgnoreUnresolved(true);

String message = sqf.resolveContent();

if (message.length() > 0)

{

                message = message + “\r\n”;

}

//Once you have resolved From, to everything else send out the email

MXServer.sendEMail(sendTO, null, null, sendFrom,subject, message, sendFrom, null, null);

}

A good combination can be if you also attach a report of the workorder with this email. For that you can read my post on attaching a birt report dynamically in java code.

Enjoy!!

Posted in Maximo tech tips | 9 Comments

New Applications in Maximo 7.5

New applications

Maximo® Asset Management 7.5 has many new applications which work, along with existing applications, to make the user experience easier and more efficient than ever.

Asset Templates

Use the Asset Templates applicationto specify common asset information that you can then apply to multiple assets.

  • Create multiple assets.
  • Update multiple existing assets.

Automation Scripts

Use the new Automation Scripts applicationto create and configure scripts that automate routine tasks, without deploying Java files or restarting the server.

  • Wizards guide you through configuring scripts that run based on different launch points. The launch points include object events or attributes, actions, or custom conditions.
  • Declare variables for the script in the application instead of in the source code. With variables, the code is simpler and easier to reuse in different launch contexts.

Inventory Usage

The new Inventory Usage applicationreplaces the Issues and Transfers application.

  • Create inventory usage records to track the issue, transfer, and return of inventory items within and across organizations.
  • Monitor the balances of inventory items and tools in storerooms and bins.
  • Transfer inventory items or tools between storerooms within an organization by creating shipment records.

Migration Collections

Use the new Migration Collections applicationto simplify the migration of configuration content.

  • Import or export the information in migration collections for management in external systems, such as version control systems.

Report Viewer

With the Report Viewer application, you can email a report to a URL instead of receiving the file.

  • Click the URL in the email attachment to see the individual report.
  • Regularly clear out the reports by using the new cron task.

Service Groups

Use the Service Groups applicationto define all the services that you provide or procure. You create a service group for each type of service that you define.

  • Group tickets, work orders, and contracts by service group or individual service.
  • Create service level agreements for a service group or for a combination of service group and service.
  • Associate a specific asset, asset type, or location with a service or service group.

Service Level Agreements

Use the Service Level Agreements applicationand escalation functionality to manage and meet the commitments in a service level agreement.

  • An escalation is a function that automatically monitors critical processes.
  • A service level agreement can have multiple commitments, each with its own escalation points.

Shipment Receiving

The new Shipment Receiving applicationis in the Inventory module and the Purchasing module.

  • Create shipment receipt records to log the receipt of transferred inventory items at the destination storeroom.
  • Monitor the balance of received items and adjust the totals and status in inventory usage records.
  • Specify that an inspection is required when inventory items are received. You can specify an inspection status for shipment receipt records.
  • Void shipment receipt records.
Posted in Maximo 7.5 | Leave a comment

Maximo Performance Tuning and Best Practices

Hi,

There is a very useful presentation on performance tuning and overall best practices.

Have a look at below:

https://de202.centra.com:443/GP/main/000001e226320000012b471af7638ce2

Event Password = tiv0li (0 is a zero).

Enjoy!!

Posted in Uncategorized | 2 Comments

Conditional Domains explained………

Hi,

Consider the following scenario:

You want to add a new status for Workorder which is a Synonym for an existing one. This status is only visible based on a certain Work Type.

This looks very simple but there is just one small trick we need to achieve this.

First create the condition in Conditional Expression application as below:

:WORKTYPE = ‘ABC’

Go to Domains application and add the new status in WOSTATUS domain. Lets call this as “REVW”.

In View Modify conditions select the condition which checks the worktype as per below screenshot. When you test you will get an error “WorkType” attribute not found. The trick is to add a field WORKTYPE to WOCHANGESTATUS table. Because, when this condition is used on selecting the status ABC it also tries to validate on the dialog table which in this case is a non-persistent table called WOCHANGESTATUS. Let me know if you have any questions.

Cheers!!


 

Posted in Maximo tech tips, MAXIMO UI, Uncategorized | 1 Comment

Field Validation Classes in Maximo

Hi,

In maximo there are three types of field validation classes which you can write depending on your circumstances:

1) Field validation class for a persistent field (normal field) in maximo

2) Field validation class for a persistent field (normal field) in maximo which needs to also have a lookup

3) Field validation class for a NON persistent field (normal field) in maximo

In this case lets consider the field we want to write a field validation class on is “LEADCRAFT” (some dummy name) and for scenario one its a persistent field.

Scenario 1) In this case we will write a java class which extends “psdi.mbo.MboValueAdapter” core maximo class. You will need to have a constructor of type below:

public FldValidationClass(MboValue mbv) {
super(mbv);

}

There are three important methods:

INIT: This method you can write code to setup the field whenever it is displayed on the UI

VALIDATE: This method will be called whenever this field is modified. So, like if someone types something from the frontend and tabs out this class is called. Even if someone in some other class sets value to “LEADCRAFT” field and does not set the flag to not call validation (MboConstants.NOVALIDATION), then also the field validation class is called.

ACTION: You should use this method if based on this field you want to set values on some other fields. One thing to note is ACTION is only called if VALIDATE is successful.

Scenario 2) In this scenario you want to write a field validation class on a field which also has a look up attached to it. If you specify DOMAINID and CLASSNAME both in MAXATTRIBUTE table, the custom class or field validation class is never invoked.

So, if you want a lookup as well as some custom validation and action. You should write a field validation class which extends psdi.mbo.MAXTableDomain.

Apart from the three methods listed above, the other important method in this scenario which become3s available is:

public MboSetRemote getList()
        throws MXException, RemoteException

You should override this method and return the MboSet with the values which will be displayed in the lookup.

Scenario 3) This scenario is mostly same as scrnario No. 1 the only difference being, when you want to setup a non-persistent field to display on UI use the INITVALUE method instead of INIT in case of non-persistent fields.

Hope this helps, Enjoy!!

 

Posted in Maximo tech tips, MAXIMO UI | 4 Comments

A very useful maximo utility class

MXFormat is a very useful class when you want to convert data between various MAXTYPES.

This class can be found in the package psdi.util.

There are many many many methods which can be used so you need not re-invent the wheel for some small stuff like conversion.

Have a look, Enjoy!!

 

Posted in Maximo tech tips | Leave a comment

Using debug properties to monitor and troubleshoot performance

How can mxe.db.LogSQLTimeLimit, mxe.db.FetchResultLogLimit, MBOCount, mxe.db.logSQLPlan, and mxe.db.sqlTableScanExclude properties be set to troubleshoot or monitor performance and memory usage in Maximo and TPAE applications

This will be very helpful, have a read below:

IBM Support

https://www-304.ibm.com/support/docview.wss?rs=3214&uid=swg21291250&context=SSLKT6&loc=en_US

 

 

Posted in Maximo tech tips | Leave a comment

Maximo Upgrade Resources

On April 29th, 2011, IBM released Maximo Asset Management 7.5. IBM Support strongly recommends that you thoroughly review the Maximo 7.1 to 7.5 Upgrade Guide below for complete upgrade details and instructions prior to starting any 7.5 upgrade effort. This upgrade information is provided for upgrading from Maximo Asset Management 7.1 deployments that include Maximo Base Services fix pack 7.1.1.7 and fix pack 7.1.1.8.

When upgrading to 7.1.1.8, Maximo Support recommends that you review the Maximo 6 to 7 Upgrade Guide prior to attempting your upgrade. Your Maximo 6 system must be at 6.2.7 Fix Pack level prior to upgrading to version 7. If you have an Industry Solution(s) installed to your system, use the Product Upgrade Requirements link below to determine your upgrade requirements.

Customers starting at Maximo versions 4 or 5 should ensure they have the latest Maximo 5 to IBM Maximo 6 upgrade program, version 6.5.1.1. If you have not requested this latest version of the Maximo 6 upgrade, you can order this new Maximo 6 upgrade media by completing the Maximo Product Request Form below.

Note the Maximo 6 to 7.1 and the 7.1 to 7.5 upgrades are components of the 7.1 or 7.5 product installation included when you download the product from Passport Advantage. There is no separate Upgrade media required for this part of the upgrade process. You use the Product Request Form to request upgrade media for Maximo upgrades 3-4, 4-5, or 5-6.

Upgrade Considerations

Effective April 23, 2011, IBM no longer provides the Oracle WebLogic Application Server media to existing and upgrading customers. Those customers that have deployed their existing system to Oracle WebLogic Server and are evaluating an upgrade to 7.5 may deploy to IBM WebSphere (provided at no additional cost) or obtain the WebLogic media from Oracle or an approved Oracle software vendor. Note that previous versions of WebLogic Application Server provided with Maximo Asset Management 5, 6, or 7.1 will not function and are not support for use with Maximo Asset Management 7.5. For additional information, please click here.

Reporting options change in v7.5. Existing users of Actuate Reporting and Business Objects Crystal Reports need to evaluate their reporting options in the 7.5 release. v7.5 does not include the reporting integration code specific to Actuate and Crystal Reports and existing 5/6/7.1 report delivery and configuration options must be reviewed. For additional information, please click here.

The following 7.1 products do not currently have a 7.5 version equivalent. At this time, you cannot upgrade to 7.5 if you have any of the following 7.1 products:

  • Maximo for Government
  • Maximo Integration Adapter for SAP
  • Maximo Integration Adapter for Oracle Applications
  • Tivoli Asset Management for IT
  • Tivoli Service Request Manager
  • Tivoli Change and Configuration Management Database
  • Tivoli Provisioning Manager
  • Tivoli Service Automation Manager

Product Upgrade Requirements

Maximo 6.2 to 7.1

If your system is currently Maximo 6.2, please note that Maximo 6.2.7 is the prerequisite/minimum version and patch you need to have applied prior to upgrading to 7.1. To upgrade from 6.2 to 7.1, you will follow this process:

  • Apply Maximo 6.2.7 Fix Pack
  • Install 7.1 which includes the 6-7 upgrade program
  • Apply Maximo Base Services 7.1.1.8 Fix Pack
  • Upgrade v6 to 7.1.1.8

Maximo 6.0/6.1 to v7.1

If your system is currently Maximo 6.0 or 6.1, please note that Maximo 6.2.7 is the prerequisite/minimum version and patch you need to have applied prior to upgrading to 7.1. To upgrade from 6.0/6.1 to 7.1, you will follow this process:

  • Install the 6.5.1.1 Upgrade Utilities
  • Install (unzip) the Maximo Upgrade 6.5.1.1 latest hotfix
  • Apply Maximo 6.2.7 Fix Pack
  • Install 7.1 which includes the 6-7 upgrade program
  • Apply Maximo Base Services 7.1.1.8 Fix Pack
  • Upgrade v6 to 7.1.1.8

 

Maximo 5 to 7.1

If your system is at Maximo 5.0, 5.1 or 5.2 Patch 04 (or lower), please note that 5.1 Patch 05 or 5.2 Patch 05 is the prerequisite/minimum version and patch you need to have applied prior to upgrading to 7.1. Many Maximo 5 customers can benefit from alternative upgrade options and are urged to contact their IBM Business Solutions Manager to discuss their specific upgrade options. To upgrade from v5 to 7.1, you will follow this process:

  • If Maximo 5.0, upgrade to 5.2 Patch 09 (5.2.9.1)
  • If Maximo 5.1.0, run upgrade
  • If Maximo 5.1.1 (or higher), upgrade to 5.1 Patch 05
  • If 5.2 Patch 04 or lower, apply 5.2 Patch 09 (5.2.9.1)
  • Install the 6.5.1.1 Upgrade Utilities
  • Install (unzip) the Maximo Upgrade 6.5.1.1 latest hotfix
  • Apply Maximo 6.2.7 Fix Pack
  • Using the 5-6 upgrade utility, version 6.5.1.1, upgrade Maximo v5 to v6
  • Install 7.1 which includes the 6-7 upgrade program
  • Apply Maximo Base Services 7.1.1.8 Fix Pack
  • Upgrade v6 to 7.1.1.8

Maximo 4.1.1 to 7.1

If your system is at a lower version/patch level than 4.1.1, note that 4.1.1 Patch 08 is the prerequisite/minimum version and patch you need to have applied prior to upgrading to 7.1. Many Maximo 3 and 4 customers can benefit from alternative upgrade options and are urged to contact their IBM Business Solutions Manager to discuss their specific upgrade options. To upgrade from 4.1.1 to 7.1, you will follow this process:

  • Minimum requirement is Maximo 4.1.1 Patch 08
  • Utilizing the 4-5 upgrade utilities, upgrade 4.1.1 to 5.1
  • If 5.2 Patch 04 or lower, apply 5.2 Patch 09 (5.2.9.1)
  • Install the 6.5.1.1 Upgrade Utilities
  • Install (unzip) the Maximo Upgrade 6.5.1.1 latest hotfix
  • Apply Maximo 6.2.7 Fix Pack
  • Using the 5-6 upgrade utility, version 6.5.1.1, upgrade Maximo v5 to v6
  • Install 7.1 which includes the 6-7 upgrade program
  • Apply Maximo Base Services 7.1.1.8 Fix Pack
  • Upgrade v6 to 7.1.1.8

When requesting the appropriate upgrade via the Maximo Product Request Form, please denote that you are upgrading from Maximo 4.1.1 to 7.1. This will ensure we provide you with the proper media and materials.
As the Maximo 5 patches are no longer available online, please indicate which v5 patches you require when you request the appropriate upgrade utilities.

Click here to view the requirements for upgrading to version 7.1 from v6 for various Maximo products including industry solutions. Please review all of the considerations and prerequisites that must be in place before upgrading.

7.5 Product Upgrade
If you are planning to upgrade to 7.5, your Maximo 7.1 will need to be at the Maximo Base Services fix pack 7.1.1.7 or fix pack 7.1.1.8 level before upgrading to version 7.5. There is no direct upgrade from earlier versions of Maximo v6 to Maximo 7.5 .

If your deployment of Maximo has more than one product , Industry Solution, or add on installed, all must be upgraded to 7.5 before the deployment of Maximo 7.5 can be completed.

Although Maximo Support strongly recommends you review the entire 7.5 Upgrade Guide, a high level overview of the 7.1 to 7.5 upgrade process is:

  • Apply Maximo Base Services Fix Pack 7.1.1.7 or 7.1.1.8
  • Complete the Maximo 7.5 pre-upgrade tasks
  • Run the Maximo 7.5 product installation program to upgrade from 7.1 to 7.5
  • Run the corresponding 7.1 to 7.5 upgrade for each of the Industry Solution or add-on that is installed in the same Maximo deployment
  • Restart the product installation program to perform database update operations
  • Complete post-upgrade tasks

Ordering Previous Maximo Upgrade Utilities
To order the Maximo 4-5, 5-6 upgrade packages, please complete the attached Maximo Upgrade Request Document and email to mxprdreq@us.ibm.com.

Posted in Maximo tech tips | Leave a comment

Identifying properties which can be controlled using Conditional UI

Hi,

Lets say you want to change the default behavior of a control used in Maximo UI using conditional UI, how do you identify which property is supported by which control?

Lets say which properties can be controlled for a textbox?

The answer to this question is very simple. Just go to the following xml file:

IBM/SMP/maximo/applications/maximo/properties/control-registry.xml

Find whichever control you want to manage using Conditional UI, search by term name=”textbox” for a textbox and so on and so forth and you will come across all the properties supported by this control and use them on your conditional ui screen like inputmode=readonly.

Thats it, so easy and we do not have to remember anything :) everything’s there in that control-registry.xml file.

Enjoy!!

Posted in Uncategorized | Leave a comment

Invoking a webservice from MBo Classes WITHOUT MIF

Hi,

Sometimes there can be a situation when you want to invoke a webservice on Mbo Save or delete or from a WorkFlow action class and do not want to go through building the integration components.

So, you straight away want to call this webservice from your custom code. One of the option in that case would be to use “WSCallClient”.

This class can be found in psdi.iface.webservices package.

OMElement respOME = callClient.invokeWebService(servicename,endPointUrl, omeObject, null, null, null, action, null, soapVersion, null, mxUsername,mxPassword, null);

The omeObject above is the service payload object.

In WebServicesUtil there are some utility methods like “convertToOMElement” where you can pass raw xml and it will give back an OMElement payload object.

Checkout maximo java docs for details on all the methods in WSCallClient and WebServicesUtil classes.

Enjoy!!

Posted in Uncategorized | Leave a comment