Sun Identity Manager Service Provider 8.1 Deployment

Workflow Callouts

Service Provider does not support workflows. However, workflow callouts can be implemented.

Workflow callouts enable the execution of custom code before and/or after a Service Provider transaction is processed. A pre-operation callout is executed before, while the post-operation callout is executed after a transaction is processed.

Callouts are registered with the Service Provider main configuration object in the workflowCallout.callouts attribute. The key in the workflowCallout.callouts map must be the name of the registered callout, while the value is the class implementing the callout. Registered callouts can be selected on the Service Provider configuration page of the Administrator interface for invocation in both the pre- and post-operation stages and for each transaction type.

Use the IDMXUserViewer to override the system-wide callout settings. By setting the preOpCallout or postOpCallout view options to the name of the callout, the system-wide callout settings can be overridden.

Callouts return any of the following values: success, failure or pending. The pending result is returned if the callout requires more time to process the transaction, such as a manual interaction. Callouts returning a pending result can resume transactions later. The following table summarizes how Service Provider proceeds in each of the possible scenarios.

 

Success 

Failure 

Pending 

Pre-operation callout 

The transaction processing resumes. 

The transaction is aborted. 

The transaction is in a waiting for a response. 

Post-operation callout 

The transaction completes with success state and may be removed from the store. 

The transaction completes with failure state and may be removed from the store. 

If “wait for post-operation callout” configuration option is enabled, then transaction remains parked. Otherwise, the transaction completes and may be removed from the store 

Asynchronous transaction processing must be enabled if any callout may return a pending result. Otherwise, the transaction will always fail.

Callouts must implement the WorkflowCallout interface. Service Provider wraps relevant information about the transaction into a WorkflowAction object. Callouts return an ActionResult object with success, failure or pending enumerated values.

Callouts invoke the resumeWorkflowCallback method in order to resume a transaction that have been parked after returning a pending result. The com.sun.idm.idmx.txn.CalloutManager implements this interface.

Sample code that resumes a transaction:

WorkflowCallback callback = CalloutManager.getInstance();
   callback.resume(transactionId, ActionResult.SUCCESS);

The above mentioned interfaces are in the com.sun.idm.idmx.api package. Javadocs are provided in the Service Provider reference kit. The interfaces are still evolving, and future changes are possible.