简单地说Unhandled exception: java.lang.Exception
。尝试捕捉没有帮助。工作流的@WorkflowMethod 是否允许抛出任何异常?
public class ChildWorkflowWorker {
public interface ChildWorkflow {
@WorkflowMethod
String run(String s) throws Exception;
}
public static class ChildWorkflowImpl implements ChildWorkflow {
@Override
public String run(String s) throws Exception {
return "";
}
}
}
父工作流代码
public class ParentWorkflowWorker {
public interface ParentWorkflow {
@WorkflowMethod
void run();
}
public static class ParentWorkflowImpl implements ParentWorkflow {
@Override
public void run() {
ChildWorkflowWorker.ChildWorkflow childWorkflow = Workflow.newChildWorkflowStub(ChildWorkflowWorker.ChildWorkflow.class);
try {
Promise<String> childPromise = Async.function(childWorkflow::run, "");
childPromise.get();
}
catch (Exception e) {
}
}
}
}
谢谢