Oracle BPM故障恢复通过java API



有人用java API恢复Oracle BPM故障吗?我使用以下代码来恢复BPM故障代码成功运行,但实例故障上没有更改,甚至故障修改日期也没有更改,不像使用em单击故障本身的重试按钮。

package oracle.bpm.example;
import java.util.Hashtable;
import java.util.List;
import javax.naming.Context;
import oracle.soa.management.facade.Fault;
import oracle.soa.management.facade.FaultRecoveryActionTypeConstants;
import oracle.soa.management.facade.Locator;
import oracle.soa.management.facade.LocatorFactory;
import oracle.soa.management.facade.bpmn.BPMNServiceEngine;
import oracle.soa.management.util.FaultFilter;
/**
* Note: the classes in oracle.soa.management.facade.bpmn and subpackages are
* not part of the public API and are provided as part of an as-is example 
* for use in solving data issues in the current release.  This example 
* is provided only to illustrate an approach for batch recover of instances
* and should be modified to meet environment specific requirments and 
* thoroughly tested, including removal of userid and passwords.
*/
public class BatchFaultRecovery {

public BatchFaultRecovery() {
}
public static void main(String[] args) {
Locator locator = getLocator("t3://mydev:7001/soa-infra", "username", "password");
doRecovery(locator,"FaultHandlingExample", "Client", "ServiceTask");
}

public static void doRecovery(Locator locator, String compositeName, String componentName, String activityName) {
try {
BPMNServiceEngine svcEngine = (BPMNServiceEngine)locator.getServiceEngine(Locator.SE_BPMN);
FaultFilter faultFilter = new FaultFilter();
faultFilter.setCompositeName(compositeName);
faultFilter.setComponentName(componentName);
recoverFaults(svcEngine, faultFilter,activityName);
} catch (Exception e) {
e.printStackTrace();
}               
}
public static Locator getLocator(String url, String user, String password) {
try {
Hashtable jndiProps = new Hashtable();
jndiProps.put(Context.PROVIDER_URL,url);
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
jndiProps.put(Context.SECURITY_PRINCIPAL, user);
jndiProps.put(Context.SECURITY_CREDENTIALS, password);
jndiProps.put("dedicated.connection", "true");
return LocatorFactory.createLocator(jndiProps);
} catch(Exception e) {
e.printStackTrace();
throw new RuntimeException("Error getting Locator",e);
}
}
public static void recoverFaults(BPMNServiceEngine svcEngine, FaultFilter faultFilter, String activityName) {
System.out.println("Get Recoverable Faults");
try {
faultFilter.setRecoverable(true);
//Get faults using defined filter
List<Fault> recoverableFaults = svcEngine.getFaults(faultFilter);
for (Fault fault : recoverableFaults) {
System.out.println(">>>>>>>>>");
System.out.println("Composite         :"+fault.getCompositeDN().getCompositeName());
System.out.println("Composite Instance:"+fault.getCompositeInstanceId());
System.out.println("Component         :"+fault.getComponentName());
System.out.println("Component Instance:"+fault.getComponentInstanceId());
System.out.println("Reference         :"+fault.getReferenceName());
System.out.println("Service           :"+fault.getServiceName());
System.out.println("Label             :"+fault.getLabel());
System.out.println("Fault Id          :"+fault.getId());
System.out.println("Fault Name        :"+fault.getName());
System.out.println("isRecoverable     :"+fault.isRecoverable());
System.out.println("Message           :"+fault.getMessage());

//Retry  fault
System.out.println("Start recovery ...");
svcEngine.recoverFault(fault,FaultRecoveryActionTypeConstants.ACTION_RETRY,null);
System.out.println("Finish recovery");
System.out.println("<<<<<<<<<");

}
} catch (Exception e) {
e.printStackTrace();
}
}
}
有谁能帮我追踪或找到解决这个问题的方法吗?

使用以下方法解决此问题,其工作正常且实例恢复:

bpmnServiceEngine.recoverCallbackMessages(BPMCallbackMessage);

但我仍然需要知道的区别bpmnServiceEngine.recoverCallbackMessages(BPMCallbackMessage)bpmnServiceEngine.recoverFault(断层)! ! .

我在文档中没有看到它:https://docs.oracle.com/middleware/1213/soasuite/api-reference-soa/toc.htm

查看"bpmnserviceengine"的文档类。通过[Ctrl + Click]在相同的类名。分析两种方法,或者粘贴到这里。另外请不要加上感叹号,我们在这里合作,没有要求。最好的。

最新更新