Example usage for com.amazonaws.services.simpleworkflow.model WorkflowExecution getRunId

List of usage examples for com.amazonaws.services.simpleworkflow.model WorkflowExecution getRunId

Introduction

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

Prototype


public String getRunId() 

Source Link

Document

A system-generated unique identifier for the workflow execution.

Usage

From source file:com.dby.swf.WorkflowExecutionStarter.java

License:Open Source License

public static void main(String[] args) throws Exception {
    ConfigHelper configHelper = ConfigHelper.createConfig();
    AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
    String domain = configHelper.getDomain();

    SwfWorkflowClientExternalFactory clientFactory = new SwfWorkflowClientExternalFactoryImpl(swfService,
            domain);//from  w w  w  .  j  ava2s  . co  m
    SwfWorkflowClientExternal workflow = clientFactory.getClient("someID");

    // Start Wrokflow Execution
    workflow.helloSwf("hello swf");

    // WorkflowExecution is available after workflow creation 
    WorkflowExecution workflowExecution = workflow.getWorkflowExecution();
    System.out.println("Started helloWorld workflow with workflowId=\"" + workflowExecution.getWorkflowId()
            + "\" and runId=\"" + workflowExecution.getRunId() + "\"");
}

From source file:jp.inc.forrest.aws.swf.WorkflowExecutionStarter.java

License:Open Source License

public static void main(String[] args) throws Exception {

    // Load configuration
    ConfigHelper configHelper = ConfigHelper.createConfig();

    // Create the client for Simple Workflow Service
    swfService = configHelper.createSWFClient();
    domain = configHelper.getDomain();// w  w w  .  j  a  va2  s . com

    // Start Workflow execution
    String bucketName = configHelper.getValueFromConfig(SplitMergeConfigKeys.S3_BUCKET_NAME);
    String fileName = configHelper.getValueFromConfig(SplitMergeConfigKeys.S3_INPUT_FILENAME);
    String val = configHelper.getValueFromConfig(SplitMergeConfigKeys.NUMBER_OF_WORKERS);
    int numberOfWorkers = Integer.parseInt(val);

    AverageCalculatorWorkflowClientExternalFactory clientFactory = new AverageCalculatorWorkflowClientExternalFactoryImpl(
            swfService, domain);
    AverageCalculatorWorkflowClientExternal workflow = clientFactory.getClient();
    workflow.average(bucketName, fileName, numberOfWorkers);

    // WorkflowExecution is available after workflow creation
    WorkflowExecution workflowExecution = workflow.getWorkflowExecution();
    System.out.println("Started periodic workflow with workflowId=\"" + workflowExecution.getWorkflowId()
            + "\" and runId=\"" + workflowExecution.getRunId() + "\"");

    System.exit(0);
}