use of com.netflix.conductor.common.metadata.workflow.StartWorkflowRequest in project conductor by Netflix.
the class ExclusiveJoinEndToEndTest method testDecision1TrueAndDecision2True.
@Test
public void testDecision1TrueAndDecision2True() {
workflowInput.put("decision_1", "true");
workflowInput.put("decision_2", "true");
StartWorkflowRequest startWorkflowRequest = new StartWorkflowRequest().withName(CONDUCTOR_WORKFLOW_DEF_NAME).withCorrelationId("").withInput(workflowInput).withVersion(1);
String wfInstanceId = workflowClient.startWorkflow(startWorkflowRequest);
String taskId = taskClient.getPendingTaskForWorkflow(wfInstanceId, "task1").getTaskId();
taskOutput.put("taskReferenceName", "task1");
TaskResult taskResult = setTaskResult(wfInstanceId, taskId, TaskResult.Status.COMPLETED, taskOutput);
taskClient.updateTask(taskResult);
taskId = taskClient.getPendingTaskForWorkflow(wfInstanceId, "task2").getTaskId();
taskOutput.put("taskReferenceName", "task2");
taskResult = setTaskResult(wfInstanceId, taskId, TaskResult.Status.COMPLETED, taskOutput);
taskClient.updateTask(taskResult);
taskId = taskClient.getPendingTaskForWorkflow(wfInstanceId, "task3").getTaskId();
taskOutput.put("taskReferenceName", "task3");
taskResult = setTaskResult(wfInstanceId, taskId, TaskResult.Status.COMPLETED, taskOutput);
taskClient.updateTask(taskResult);
Workflow workflow = workflowClient.getWorkflow(wfInstanceId, true);
String taskReferenceName = workflow.getTaskByRefName("exclusiveJoin").getOutputData().get("taskReferenceName").toString();
assertEquals("task3", taskReferenceName);
assertEquals(Workflow.WorkflowStatus.COMPLETED, workflow.getStatus());
}
Aggregations