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!!

Regards,

Aniruddh Panvalkar

Rapid deployment in Websphere environment

Hi,

I am sure most of us have gone through this.

Consider the development environment or your local machine has WebSphere as the application server.

To rebuild and redeploy on WS environment takes up lot of time and effort.

Ofcourse the easiest and one of the faster ways to deploy is running sync-websphere-maximo.cmd.

What I use is an even faster approach. I just copy paste any files in maximouiweb.war directory in installedApps directory.

In case of business objects, I unzip businessobjects.jar in a folder by the same name “businessobjects.jar”, and then on just copy paste changed class files and restart Websphere.

Using this approach I do not have to redeploy, rebuild any jar or war. Just copy changed classes from Eclipse bin folder.

It saves lot of time and during the development phase you can focus more on coding rather than the tedious task of deployment.

 

Note: This approach is only recommended for dev environments and that too only for developers.

All about domains and Value Lists

Hi All,

Found this cool document on lookups, domains, valuelists from IBM.

Have a read below:

http://www-304.ibm.com/support/docview.wss?uid=swg21313517&tcss=Newsletter&product=Maximo%20Asset%20Management

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 + “rn”;

}

//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!!

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.

Regards,

Aniruddh Panvalkar

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!!