我正在尝试使用适用于AWS的Java流程框架从amazon简单工作流服务中的工作流运行子工作流。以下是主要的工作流程实现代码:
package SWF.ChildWorkFlow;
import org.springframework.core.annotation.Order;
import com.amazonaws.services.simpleworkflow.flow.core.Promise;
public class OrderWorkflowImpl implements OrderWorkflow {
private OrderActivitiesClient client = new OrderActivitiesClientImpl();
ProcessPaymentWorkflowClientFactory factory = new ProcessPaymentWorkflowClientFactoryImpl();
@Override
public void getCustomerOrder() {
Promise<String> a = client.getOrder();
ProcessPaymentWorkflowClient childWorkflowClient = factory.getClient("ChildWorkflow");
childWorkflowClient.paymentProcessor(a);
}
}
主要工作流程的活动正在运行,但来自childorkflow(paymentProcessor)的活动在抛出一些错误后正在运行。
下面是错误消息 -
Dec 08, 2014 3:11:21 PM com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler createDecider
SEVERE: Received decision task for workflow type not configured with a worker: workflowType={Name: OrderWorkflow.getCustomerOrder,Version: 1.1}, taskToken=AAAAKgAAAAIAAAAAAAAAAjtd06ct8IXpzt5gbkfiKHXQbZci9kmJuSq1rKtpPVW+l+7hhLESuQDt5e3oVobCfbjEhfrRae26bnGLV3Kz2zsOUDBxpMGlFGReCBKeUc9BNGzKyOj4uiX5bPMdvez6zn8/Xfy69KTARDWvy15EsoP/4fp/9z3t4XJkzuk/Ks857gvtfNEZ1RfnlBqaqv2i9hpVBgHQXeoly0soewELhUxdOWHhYOxsGnGnM/MsEPFaXwKgzqwddXfuco7Pho0qle2xViYudOs7wcEECfi2Tgw=, workflowExecution={WorkflowId: workflow,RunId: 22fW/b5Qf+8M5AYj7S2PHY9N74LQGlouoWwszAFXH8VFI=}
Dec 08, 2014 3:11:21 PM com.amazonaws.services.simpleworkflow.flow.worker.DecisionTaskPoller pollAndProcessSingleTask
WARNING: DecisionTask failure: taskId= 9, workflowExecution={WorkflowId: workflow,RunId: 22fW/b5Qf+8M5AYj7S2PHY9N74LQGlouoWwszAFXH8VFI=}
java.lang.IllegalArgumentException: No implementation was found for {Name: OrderWorkflow.getCustomerOrder,Version: 1.1}
at com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler.createDecider(AsyncDecisionTaskHandler.java:111)
at com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler.handleDecisionTask(AsyncDecisionTaskHandler.java:49)
at com.amazonaws.services.simpleworkflow.flow.worker.DecisionTaskPoller.pollAndProcessSingleTask(DecisionTaskPoller.java:201)
at com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker$PollServiceTask.run(GenericWorker.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Dec 08, 2014 3:11:21 PM com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker uncaughtException
SEVERE: Failure in thread SWF Decider HelloWorldListParallel 1
java.lang.IllegalArgumentException: No implementation was found for {Name: OrderWorkflow.getCustomerOrder,Version: 1.1}
at com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler.createDecider(AsyncDecisionTaskHandler.java:111)
at com.amazonaws.services.simpleworkflow.flow.worker.AsyncDecisionTaskHandler.handleDecisionTask(AsyncDecisionTaskHandler.java:49)
at com.amazonaws.services.simpleworkflow.flow.worker.DecisionTaskPoller.pollAndProcessSingleTask(DecisionTaskPoller.java:201)
at com.amazonaws.services.simpleworkflow.flow.worker.GenericWorker$PollServiceTask.run(GenericWorker.java:94)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
有谁可以帮我解决这个问题。而且我也无法在互联网上的AWS SWF服务中找到有关子工作流的任何适当文档。提前谢谢。
答案 0 :(得分:3)
该异常意味着WorkflowWorker(决策者)接收未配置为运行的工作流的决策任务。我的猜测是,您有两个WorkflowWorkers,一个用于父级,另一个用于子工作流,共享相同的任务列表名称。并且由于任务列表名称相同,因此任何一个都可以从另一个获取任务。因此,解决方案是使用单个WorkflowWorker注册两个工作流,或者为每个工作者使用不同的任务列表。请注意,如果更改了任务列表名称,则应该使工作流程版本受到影响,因为一旦注册,工作流程类型属