Package com.amazonaws.services.simpleworkflow.model

Examples of com.amazonaws.services.simpleworkflow.model.WorkflowExecution


        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();
       
       
        WorkflowExecution workflowExecution = new WorkflowExecution();
        String workflowId = args[1];
        workflowExecution.setWorkflowId(workflowId);
        String runId = args[2];
        workflowExecution.setRunId(runId);
       
        GenericWorkflowClientExternal client = new GenericWorkflowClientExternalImpl(swfService, domain);
       
        String state = client.getWorkflowState(workflowExecution);
       
View Full Code Here


        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);
    }   
View Full Code Here

        }
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        WorkflowExecution workflowExecution = new WorkflowExecution();
        String workflowId = args[1];
        workflowExecution.setWorkflowId(workflowId);
        String runId = args[2];
        workflowExecution.setRunId(runId);

        String implementationTypeName = args[0];
        @SuppressWarnings("unchecked")
        Class<Object> workflowImplementationType = (Class<Object>) Class.forName(implementationTypeName);
        WorkflowReplayer<Object> replayer = new WorkflowReplayer<Object>(swfService, domain, workflowExecution,
View Full Code Here

        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();
       
       
        WorkflowExecution workflowExecution = new WorkflowExecution();
        String workflowId = args[0];
        workflowExecution.setWorkflowId(workflowId);
        String runId = args[1];
        workflowExecution.setRunId(runId);
        System.out.println(WorkflowExecutionUtils.prettyPrintHistory(swfService, domain, workflowExecution, true));
    }   
View Full Code Here

        }
        ConfigHelper configHelper = ConfigHelper.createConfig();
        AmazonSimpleWorkflow swfService = configHelper.createSWFClient();
        String domain = configHelper.getDomain();

        WorkflowExecution workflowExecution = new WorkflowExecution();
        String workflowId = args[1];
        workflowExecution.setWorkflowId(workflowId);
        String runId = args[2];
        workflowExecution.setRunId(runId);

        String implementationTypeName = args[0];
        @SuppressWarnings("unchecked")
        Class<Object> workflowImplementationType = (Class<Object>) Class.forName(implementationTypeName);
        WorkflowReplayer<Object> replayer = new WorkflowReplayer<Object>(swfService, domain, workflowExecution,
View Full Code Here

     *      WorkflowExecution, long)
     */
    public static String waitForWorkflowInstanceCompletionAcrossGenerations(AmazonSimpleWorkflow service, String domain,
            WorkflowExecution workflowExecution, long timeoutSeconds) throws InterruptedException, TimeoutException {

        WorkflowExecution lastExecutionToRun = workflowExecution;
        long millisecondsAtFirstWait = System.currentTimeMillis();
        String lastExecutionToRunCloseStatus = waitForWorkflowInstanceCompletion(service, domain, lastExecutionToRun,
                timeoutSeconds);

        // keep waiting if the instance continued as new
        while (lastExecutionToRunCloseStatus.equals(CloseStatus.CONTINUED_AS_NEW.toString())) {
            // get the new execution's information
            HistoryEvent closeEvent = getInstanceCloseEvent(service, domain, lastExecutionToRun);
            WorkflowExecutionContinuedAsNewEventAttributes continuedAsNewAttributes = closeEvent.getWorkflowExecutionContinuedAsNewEventAttributes();

            WorkflowExecution newGenerationExecution = new WorkflowExecution().withWorkflowId(lastExecutionToRun.getWorkflowId()).withRunId(
                    continuedAsNewAttributes.getNewExecutionRunId());
           
            // and wait for it
            long currentTime = System.currentTimeMillis();
            long millisecondsSinceFirstWait = currentTime - millisecondsAtFirstWait;
View Full Code Here

    @Override
    public T getClient() {
        checkGenericClient();
        String workflowId = genericClient.generateUniqueId();
        WorkflowExecution workflowExecution = new WorkflowExecution().withWorkflowId(workflowId);
        return getClient(workflowExecution, startWorkflowOptions, dataConverter, genericClient);
    }
View Full Code Here

    @Override
    public T getClient(String workflowId) {
        if (workflowId == null || workflowId.isEmpty()) {
            throw new IllegalArgumentException("workflowId");
        }
        WorkflowExecution workflowExecution = new WorkflowExecution().withWorkflowId(workflowId);
        return getClient(workflowExecution, startWorkflowOptions, dataConverter, genericClient);
    }
View Full Code Here

    @Override
    public T getClient() {
      GenericWorkflowClient client = getGenericClientToUse();
        String workflowId = client.generateUniqueId();
        WorkflowExecution execution = new WorkflowExecution().withWorkflowId(workflowId);
        return getClient(execution, startWorkflowOptions, dataConverter);
    }
View Full Code Here

    @Override
    public T getClient(String workflowId) {
        if (workflowId == null || workflowId.isEmpty()) {
            throw new IllegalArgumentException("workflowId");
        }
        WorkflowExecution execution = new WorkflowExecution().withWorkflowId(workflowId);
        return getClient(execution, startWorkflowOptions, dataConverter);
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleworkflow.model.WorkflowExecution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.