Example usage for com.amazonaws.services.simpleworkflow.model StartWorkflowExecutionRequest StartWorkflowExecutionRequest

List of usage examples for com.amazonaws.services.simpleworkflow.model StartWorkflowExecutionRequest StartWorkflowExecutionRequest

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow.model StartWorkflowExecutionRequest StartWorkflowExecutionRequest.

Prototype

StartWorkflowExecutionRequest

Source Link

Usage

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  . j  av  a 2s  . 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: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] + "\"}";
    }//  w  w  w.  j a va2  s  .com

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