Designing a Fault Policy with Multiple Rejection Handlers

11-18 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite To invoke a Java class, you can provide a class that implements the IFaultRecoveryJavaClass interface. IFaultRecoveryJavaClass is included in the fabric-runtime.jar file. The package name is oracle.integration.platform.faultpolicy. The IFaultRecoveryJavaClass interface has two methods, as shown in Example 11–11 . Example 11–11 implementation of IFaultRecoveryJavaClass public interface IFaultRecoveryJavaClass { public void handleRetrySuccess IFaultRecoveryContext ctx ; public String handleFault IFaultRecoveryContext ctx ; } Note the following details: ■ handleRetrySuccess is invoked upon a successful retry attempt. The retry policy chains to a Java action on retrySuccessAction. ■ handleFault is invoked to execute a policy of type javaAction. Example 11–12 shows the data available with IFaultRecoveryContext: Example 11–12 Data Available with IFaultRecoveryContext public interface IFaultRecoveryContext { Gets implementation type of the fault. return public String getType; return Get property set of the fault policy action being executed. public Map getProperties; ReturnValue value=” ref=”ora-rethrow” Fails in validation. javaAction className=mypackage.myclass defaultAction=ora-human-intervention Execute ora-human-intervention after Java code execution. This attribute is used if the return from the method does not match any provided ReturnValue. ReturnValue value=RETRY ref=ora-retry ReturnValue value=” ref=”” Fails in validation. javaAction className=mypackage.myclass defaultAction= ora-human-intervention ReturnValueReturnValue Fails in validation. Table 11–3 Cont. System Interpretation of Java Action Fault Policy Code Description Using Fault Handling in a BPEL Process 11-19 return Get fault policy id of the fault policy being executed. public String getPolicyId; return Name of the faulted partner link. public String getReferenceName; return Port type of the faulted reference . public QName getPortType; } The service engine implementation of this interface provides more information for example, Oracle BPEL Process Manager. Example 11–13 provides details. Example 11–13 Service Engine Implementation of IFaultRecoveryContext public class BPELFaultRecoveryContextImpl extends BPELXExecLetUtil implements IBPELFaultRecoveryContext, IFaultRecoveryContext{ ... } Oracle BPEL Process Manager-specific data is available with IBPELFaultRecoveryContext, as shown in Example 11–14 . Example 11–14 Oracle BPEL Process Manager-Specific Data public interface IBPELFaultRecoveryContext { public void addAuditTrailEntryString message; public void addAuditTrailEntryString message, Object detail; public void addAuditTrailEntryThrowable t; return Get action id of the fault policy action being executed. public String getActionId; return Type of the faulted activity. public String getActivityId; return Name of the faulted activity. public String getActivityName; return Type of the faulted activity. public String getActivityType; return Correleation id of the faulted activity.