use of com.amazonaws.services.simpleworkflow.flow.StartWorkflowOptions in project camel by apache.
the class CamelSWFWorkflowClient method startWorkflowExecution.
public String[] startWorkflowExecution(String workflowId, String runId, String eventName, String version, Object arguments, List<String> tags) {
DynamicWorkflowClientExternalImpl dynamicWorkflowClientExternal = (DynamicWorkflowClientExternalImpl) getDynamicWorkflowClient(workflowId, runId);
WorkflowType workflowType = new WorkflowType();
workflowType.setName(eventName);
workflowType.setVersion(version);
dynamicWorkflowClientExternal.setWorkflowType(workflowType);
StartWorkflowOptions startWorkflowOptions = new StartWorkflowOptions();
startWorkflowOptions.setTaskStartToCloseTimeoutSeconds(FlowHelpers.durationToSeconds(configuration.getTaskStartToCloseTimeout()));
startWorkflowOptions.setExecutionStartToCloseTimeoutSeconds(FlowHelpers.durationToSeconds(configuration.getExecutionStartToCloseTimeout()));
startWorkflowOptions.setTagList(tags);
dynamicWorkflowClientExternal.setSchedulingOptions(startWorkflowOptions);
dynamicWorkflowClientExternal.startWorkflowExecution(toArray(arguments));
String newWorkflowId = dynamicWorkflowClientExternal.getWorkflowExecution().getWorkflowId();
String newRunId = dynamicWorkflowClientExternal.getWorkflowExecution().getRunId();
return new String[] { newWorkflowId, newRunId };
}
use of com.amazonaws.services.simpleworkflow.flow.StartWorkflowOptions in project camel by apache.
the class SWFEndpoint method getStartWorkflowOptions.
public StartWorkflowOptions getStartWorkflowOptions() {
StartWorkflowOptions startWorkflowOptions = new StartWorkflowOptions();
try {
EndpointHelper.setReferenceProperties(getCamelContext(), startWorkflowOptions, configuration.getStartWorkflowOptionsParameters());
EndpointHelper.setProperties(getCamelContext(), startWorkflowOptions, configuration.getStartWorkflowOptionsParameters());
} catch (Exception e) {
throw new RuntimeException(e);
}
return startWorkflowOptions;
}
Aggregations