List of usage examples for com.amazonaws.services.simpleworkflow.model WorkflowType WorkflowType
WorkflowType
From source file:aws.example.helloswf.WorkflowStarter.java
License:Apache License
public static void main(String[] args) { String workflow_input = "Amazon SWF"; if (args.length > 0) { workflow_input = args[0];/*from ww w . jav a 2 s . c o m*/ } System.out.println("Starting the workflow execution '" + WORKFLOW_EXECUTION + "' with input '" + workflow_input + "'."); WorkflowType wf_type = new WorkflowType().withName(HelloTypes.WORKFLOW) .withVersion(HelloTypes.WORKFLOW_VERSION); Run run = swf.startWorkflowExecution(new StartWorkflowExecutionRequest().withDomain(HelloTypes.DOMAIN) .withWorkflowType(wf_type).withWorkflowId(WORKFLOW_EXECUTION).withInput(workflow_input) .withExecutionStartToCloseTimeout("90")); System.out.println("Workflow execution started with the run id '" + run.getRunId() + "'."); }
From source file:example.swf.hellolambda.WorkflowStarter.java
License:Apache License
public static void main(String[] args) { final String WORKFLOW_EXECUTION = "HelloWorld-Lambda-Execution"; AmazonSimpleWorkflow swf = AmazonSimpleWorkflowClientBuilder.defaultClient(); String workflow_input = "{\"who\": \"Amazon SWF\"}"; if (args.length > 0) { workflow_input = "{\"who\": \"" + args[0] + "\"}"; }//from ww w . j a va 2 s .co m System.out.println("Starting the workflow execution '" + WORKFLOW_EXECUTION + "' with input '" + workflow_input + "'."); WorkflowType wf_type = new WorkflowType().withName(HelloTypes.WORKFLOW) .withVersion(HelloTypes.WORKFLOW_VERSION); Run run = swf.startWorkflowExecution(new StartWorkflowExecutionRequest().withDomain(HelloTypes.DOMAIN) .withWorkflowType(wf_type).withWorkflowId(WORKFLOW_EXECUTION).withInput(workflow_input) .withExecutionStartToCloseTimeout("90")); System.out.println("Workflow execution started with the run id '" + run.getRunId() + "'."); }
From source file:org.apache.camel.component.aws.swf.CamelSWFWorkflowClient.java
License:Apache License
public String[] startWorkflowExecution(String workflowId, String runId, String eventName, String version, Object arguments) {/*from w ww.ja va2 s .c om*/ DynamicWorkflowClientExternalImpl dynamicWorkflowClientExternal = (DynamicWorkflowClientExternalImpl) getDynamicWorkflowClient( workflowId, runId); WorkflowType workflowType = new WorkflowType(); workflowType.setName(eventName); workflowType.setVersion(version); dynamicWorkflowClientExternal.setWorkflowType(workflowType); dynamicWorkflowClientExternal.startWorkflowExecution(toArray(arguments)); String newWorkflowId = dynamicWorkflowClientExternal.getWorkflowExecution().getWorkflowId(); String newRunId = dynamicWorkflowClientExternal.getWorkflowExecution().getRunId(); return new String[] { newWorkflowId, newRunId }; }
From source file:org.apache.camel.component.aws.swf.CamelWorkflowDefinitionFactoryFactory.java
License:Apache License
@Override public Iterable<WorkflowType> getWorkflowTypesToRegister() { ArrayList<WorkflowType> workflowTypes = new ArrayList<WorkflowType>(1); WorkflowType workflowType = new WorkflowType(); workflowType.setName(configuration.getEventName()); workflowType.setVersion(configuration.getVersion()); workflowTypes.add(workflowType);// w w w.ja v a 2s. c o m return workflowTypes; }