this.domain = domain;
}
@Override
public WorkflowExecution startWorkflow(StartWorkflowExecutionParameters startParameters) {
StartWorkflowExecutionRequest request = new StartWorkflowExecutionRequest();
request.setDomain(domain);
request.setInput(startParameters.getInput());
request.setExecutionStartToCloseTimeout(FlowHelpers.secondsToDuration(startParameters.getExecutionStartToCloseTimeout()));
request.setTaskStartToCloseTimeout(FlowHelpers.secondsToDuration(startParameters.getTaskStartToCloseTimeoutSeconds()));
request.setTagList(startParameters.getTagList());
String taskList = startParameters.getTaskList();
if (taskList != null && !taskList.isEmpty()) {
request.setTaskList(new TaskList().withName(taskList));
}
request.setWorkflowId(startParameters.getWorkflowId());
request.setWorkflowType(startParameters.getWorkflowType());
Run result = service.startWorkflowExecution(request);
WorkflowExecution execution = new WorkflowExecution().withRunId(result.getRunId()).withWorkflowId(request.getWorkflowId());
return execution;
}