Minggu, 27 April 2014

Sample Action Class

This entry is part of the Maximo Java Development series.

Sometimes you have to implement some complex logic in workflows or escalation and you feel limited by the out-of-the-box Maximo actions. In these cases you can unleash the Java power and code your algorithm in a custom action class.
In order to create a custom action class, you must extend the  psdi.common.action.ActionCustomClass class.

package cust.actions;

import java.rmi.RemoteException;
import psdi.common.action.ActionCustomClass;
import psdi.mbo.MboRemote;
import psdi.util.MXException;

public class SampleAction implements ActionCustomClass
{
public SampleAction()
{
super();
}

public void applyCustomAction(MboRemote mbo, Object[] params)
throws MXException, RemoteException
{
// Write custom code here
}
}

As usual... compile, rebuild EAR and redeploy. For a full example of a custom action class look here.

To call this action from a workflow or escalation you have to register the new Maximo action. Go in System Configuration - Platform Configuration - Actions and create a new action. Choose Custom Class as Type, select the object for which the custom applies and provide the full class name (cust.actions.SampleAction) in the value field. Here is how the new Action should look.



Source:http://maximodev.blogspot.com/2012/06/sample-action-class-java-maximo.html

Tidak ada komentar:

Posting Komentar