You are on page 1of 9

Understanding Action Types

http://publib.boulder.ibm.com/tividd/td/ITMax/621_mx_wkfl_imp/en_US/PDF/621_mx
_wkfl_imp.pdf

APPACTION : Used to specify that Maximo should initiate an application action.


Maximo requires a value in the Object and Value field for this type of action. When
creating an APPACTION type action, you can specify one of the following actions if it
is available for the specified object:

Apply SLA : Apply the specified service level agreement. ! Create Change :
Create a change work order.
Create Incident : Create an incident ticket.
Create Problem : Create a problem ticket.
Create Release : Create a release work order.
Create SR : Create a service request ticket.
Create WO : Create a work order.
WF Accept : Workflow auto-accept. Accepts the record and routes it to the
positive path in the Workflow process.
WF Escalate : Escalate the record in the Workflow process and reassigns the
assignment to its escalation role.
WF Initiate : Initiate a Workflow process. This option requires a value in the
Parameter/Attribute field.
WF Reject : Workflow auto-reject. Rejects the record and routes it to the
negative path in the Workflow process.

protected void setup()


throws MXException, RemoteException
{
MboValue value = getMboValue();
MboRemote mbo = value.getMbo();
String type = ((ActionRemote)mbo).getType();
if (type.equalsIgnoreCase("appaction"))
{
setRelationship("SYNONYMDOMAIN", "value=:dispvalue");
setListCriteria("domainid='APPACTION'");
}
else if (type.equalsIgnoreCase("changestatus"))
{
setRelationship("SYNONYMDOMAIN", "value=:dispvalue");
String objectName = mbo.getString("OBJECTNAME");
MboSetRemote ms = MXServer.getMXServer().getMboSet(objectName,
mbo.getUserInfo());
MboRemote zombie = ms.getZombie();
setListCriteria("domainid='" + ((StatefulMbo)zombie).getStatusListName()
+ "'");
}
else
{
setRelationship(null, null);
setListCriteria(null);
}
setLookupKeyMapInOrder(new String[] { "dispvalue" }, new String[] {
"value" });
}

public class Action extends Mbo


implements ActionRemote
{
static String[][] appActionMethods = { { "CREATECHANGE", "createChange" }, {
"CREATESR", "createServiceRequest" }, { "CREATEINCIDENT", "createIncident" }, {
"CREATEPROBLEM", "createProblem" }, { "CREATERELEASE", "createRelease" }, {
"CREATEWORKORDER", "createWorkorder" }, { "GENERATEFORECAST", "generateForecast" },
{ "DELETEFORECAST", "deleteForecast" }, { "REFORECAST", "reforecastSubsequentDates" },
{ "GENERATEWORKORDER", "generateWork" }, { "REVERSEINVOICE", "createReverseInvoice"
}, { "COPYDOCLINKTOWO", "copyDoclinksToWO" } };
protected void executeAppAction(MboRemote mbo, String value, String parameter)
throws MXException, RemoteException
{
try
{
String resolvedParam = null;
try
{
ParserServiceRemote parserService =
(ParserServiceRemote)MXServer.getMXServer().lookup("PARSER");
resolvedParam = parserService.getString(parameter, mbo);
}
catch (Throwable t)
{
}
if (resolvedParam == null) {
resolvedParam = parameter;
}
if (value.equalsIgnoreCase("WFESCALATE"))
{
executeWFEscalate(mbo, value);
}
else if (value.equalsIgnoreCase("WFINITIATE"))
{
executeWFInitiate(mbo, parameter);

}
else if (value.equalsIgnoreCase("WFACCEPT"))
{
executeWFAccept(mbo, value);
}
else if (value.equalsIgnoreCase("WFREJECT"))
{
executeWFReject(mbo, value);
}
else if (!(value.equalsIgnoreCase("UpdateCommLog")))
{
if (value.equalsIgnoreCase("ApplySLA"))
{
executeApplySLA(mbo);
}
else
{
executeWOTktAppAction(value, mbo, resolvedParam);
}
}
}
catch (InvocationTargetException e) {
Throwable t = e.getTargetException();
if ((t != null) && (t instanceof MXException)) {
throw ((MXException)t);
}
throw new MXApplicationException("action", "AppActionError", new Object[] { value },
e);
}
catch (Throwable t)
{
throw new MXApplicationException("action", "AppActionError", new Object[] { value },
t);
}
}

protected void executeWOTktAppAction(String appAction, MboRemote mbo, String param)


throws Throwable
{
if (appActionMethodMap == null)
return;
String methodName = (String)appActionMethodMap.get(appAction);
if (methodName == null)
return;
try
{
if (appAction.equals("COPYDOCLINKTOWO"))
{
Method m = mbo.getClass().getMethod(methodName, new Class[0]);
m.invoke(mbo, new Object[0]);
}

else
{
Method m = mbo.getClass().getMethod(methodName, new Class[] { String.class });
m.invoke(mbo, new Object[] { param });
}
}
catch (NoSuchMethodException e)
{
throw new MXApplicationException("action", "notAppActionInterface", e);
}
return;
}

https://www.ibm.com/developerworks/community/blogs/e25892f0-20f7-46ff-bbe9c7c03fb3036f/entry/useful_tiny_little_things_adding_an_action_to_an_application59?
lang=en

This week I'll explain how to create your own entry on a select action menu and apply an action to it.

Ok, ready to go. Open your TPAE based system, click on Go To > System Configuration > Platform Configuration
> Application Designer (you must have permissions to do the next actions).
As usual lets use the Work Order Tracking application as a sample. Search for WOTRACK and enter the Work Order
Tracking.
At this point a editable version of the application shows up, but we want to click on the Select Actionand
select Add/Modify Signature Options.
Next step is to click on new row, and edit the as follows (don't forget to expand the Advanced Signature Options;
there are changes there as well):

Of course you can use another name and description for your Signature Option. Signature options specify privileges
for using applications, menu options, and toolbar items.
Notice that the Advanced Signature Options has "This is an action that must be invoked by user in the UI" which is
essential for this tip to work, so don't forget selecting the right option here.
Click Ok.
Once again, click on Select Action, but this time select Add/Modify Select Action Menu. It is time to create your
entry on the Application (on this example Work Order Tracking) Select Action menu.

Notice that
I'm using the Element Type OPTION. This means it is an option on the Select Action menu.
Also the Key Value is CALLACTION. The Key Value field relates to the signature option ID that is associated with this
menu item, which we just created.

I used the Position 1 and Subposition 1 to put our Select Action option as the first entry. But feel free to play around
with this; the position and subposition are responsible for the order and subitem definition. If you want the menu item
to appear under a header menu, enter a numerical value in the Subposition field, to indicate its position within the
header menu.

Last but not least, in the Tabs field define where you want your entry to be available (to be visible), and MAIN in this
scenario is the right one.

Very good! We are all done with the Application Designer. Now the most interesting piece of this post: The action!
Move to Go To > System Configuration > Platform Configuration > Actions. Create a new Action.

Name your new Action CALLACTION (otherwise TPAE won't be able to find it when you select the item on the
Select Action), also choose the WORKORDER Object in this scenario because we did changes for the Work Order
Track application, if yours differ select the appropriate Object.
In my case I'm selecting the Type as Application Action, which means I'm going to call an existing action from the
Work Order Application, but there are other options you can use. Refer to the Infocenter for more on that right here.
Since I chose Application Action, the Values are restricted to the application actions. I selected CREATECHANGE,
which means every time I click on the Select Action created, a new related Change record is created.

The screenshot here shows what I selected to sample this feature, but you can select whatever is useful for you.
All set, now save the action and restart the MXServer (restart only the MAXIMO application works fine as well) to

apply the changes.


As soon as your MXServer is back, Go To > Work Orders > Work Order Tracking, click on new.
Save the record.
Now click on the Select Action, confirm you have your new entry there and click on Call Custom Action.
And check the Related Records tab (Depending on the action you set, you might need to save the record again to
refresh the MBO and see the changes made).
And here it is:

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

You might also like