Example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClientBuilder defaultClient

List of usage examples for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClientBuilder defaultClient

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClientBuilder defaultClient.

Prototype

public static AmazonSimpleWorkflow defaultClient() 

Source Link

Usage

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   w  ww.j  ava  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() + "'.");
}