Application extension methods

The application can contain whatever processing is required to accomplish the task. An extension can contain any number of methods that can be exposed to the workflow.

The following example is a code snippet of a method that is available in the workflow for the extension node. For a complete example, see the information in the extensions directory.

From the Appliance Dashboard on the IBM® Security Identity Manager virtual appliance console, click Configure > Advanced Configuration > Custom File Management. From the All Files tab, go to directories/utilities and download the extensions.zip file and extract it.

/**
* Method sendMailByProperty.
* This method is called to send an e-mail to an e-mail address specified by
the
* "recipient" property in the specified property file.
* @param person - the requestee's person object
* @param mailTag - the mailtag for this message. Used to look up properties
* @param propertyFileName - the name of the property file that contains
* this message's data
* @param attrList - an optional list of tag/value pairs
* @return ActivityResult - a workflow activity result object
*/
public ActivityResult sendMailByProperty(Person person,
String mailTag,
String propertyFileName,
String attrs) {
String recipient_email = "";
try {
processSendMail(person,mailTag,propertyFileName,recipient_email,
attrs);
return new ActivityResult(ActivityResult.STATUS_COMPLETE,
ActivityResult.SUCCESS,
"Sent Mail",
null);
} catch (CustomEMailDataException e) {
return new ActivityResult(ActivityResult.STATUS_COMPLETE,
ActivityResult.FAILED,
e.getMessage(),
null);
}
}

Application Extension methods can receive inputs from the workflow. The inputs defined in the workflow extension window maps to the method arguments (ensure that the types match). The sendMailByProperty method returns an ActivityResult object. This method allows the application to communicate back to the caller a status and a return value, if necessary. The ActivityResult object has member variables for status (int), summary, (String), detail (List), and description (String). Return values are in the detail list. The order of the values in the list must correspond to the order of the output parameters as defined in the extension window. See the IBM Security Identity Manager API documentation for a complete description of the ActivityResult class.