Search in sources :

Example 1 with DynamicWorkflowClientExternalImpl

use of com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl 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 };
}
Also used : DynamicWorkflowClientExternalImpl(com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl) WorkflowType(com.amazonaws.services.simpleworkflow.model.WorkflowType) StartWorkflowOptions(com.amazonaws.services.simpleworkflow.flow.StartWorkflowOptions)

Example 2 with DynamicWorkflowClientExternalImpl

use of com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl in project camel by apache.

the class CamelSWFWorkflowClient method getDynamicWorkflowClient.

DynamicWorkflowClientExternal getDynamicWorkflowClient(String workflowId, String runId) {
    GenericWorkflowClientExternalImpl genericClient = new GenericWorkflowClientExternalImpl(endpoint.getSWClient(), configuration.getDomainName());
    WorkflowExecution workflowExecution = new WorkflowExecution();
    workflowExecution.setWorkflowId(workflowId != null ? workflowId : genericClient.generateUniqueId());
    workflowExecution.setRunId(runId);
    return new DynamicWorkflowClientExternalImpl(workflowExecution, null, endpoint.getStartWorkflowOptions(), configuration.getDataConverter(), genericClient);
}
Also used : DynamicWorkflowClientExternalImpl(com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl) GenericWorkflowClientExternalImpl(com.amazonaws.services.simpleworkflow.flow.worker.GenericWorkflowClientExternalImpl) WorkflowExecution(com.amazonaws.services.simpleworkflow.model.WorkflowExecution)

Aggregations

DynamicWorkflowClientExternalImpl (com.amazonaws.services.simpleworkflow.flow.DynamicWorkflowClientExternalImpl)2 StartWorkflowOptions (com.amazonaws.services.simpleworkflow.flow.StartWorkflowOptions)1 GenericWorkflowClientExternalImpl (com.amazonaws.services.simpleworkflow.flow.worker.GenericWorkflowClientExternalImpl)1 WorkflowExecution (com.amazonaws.services.simpleworkflow.model.WorkflowExecution)1 WorkflowType (com.amazonaws.services.simpleworkflow.model.WorkflowType)1