0

我正在尝试使用 AWS 的 java 流框架从亚马逊简单工作流服务中的工作流运行子工作流。下面是主要的工作流实现代码:

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 服务中子工作流的任何适当文档。提前致谢。

4

1 回答 1

3

异常意味着 WorkflowWorker(决策者)接收到未配置为运行的工作流的决策任务。我的猜测是,您有两个 WorkflowWorker,一个用于父工作流,一个用于共享相同任务列表名称的子工作流。并且由于任务列表名称相同,它们中的任何一个都可以从另一个获取任务。因此,解决方案是使用单个 WorkflowWorker 注册两个工作流,或者为每个工作人员使用不同的任务列表。请注意,如果更改了任务列表名称,则应提高工作流版本,因为工作流类型属性在注册后是不可变的。

于 2014-12-08T19:55:34.197 回答