Sometimes you need to do lot of processing or execute some logic during the execution of a workflow.
In that case adding a Custom Action with a Java class may be one of the options.
Go to the Actions application and add a new action with Type as CUSTOM and value as the fully qualified class name for the action class.
Lets assume the class name is com.custom.action.NewCustomProcessiingAction
This class should extend psdi.common.action.ActionCustomClass and we need to override the below method:
public void applyCustomAction(MboRemote mbo, Object arg1)
throws MXException, RemoteException
In this method the MBO is available so we can manipulate that if required or get related MBO’s to manipulate.
We can also get the workflow service:
WorkFlowService wfService = (WorkFlowService)MXServer.getMXServer().lookup(“WORKFLOW”);
And, use that to interact with the workflow.
Once this action class is ready, assign it to any positive or negative action on the workflow and its done.