Package com.amazonaws.services.simpleworkflow.flow.examples.common

Examples of com.amazonaws.services.simpleworkflow.flow.examples.common.ConfigHelper


    private static String domain;
   
    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();
       
        // Start Workflow instance
        int requestId = Integer.parseInt(configHelper.getValueFromConfig(BookingConfigKeys.WORKFLOW_INPUT_REQUESTID_KEY));
        int customerId = Integer.parseInt(configHelper.getValueFromConfig(BookingConfigKeys.WORKFLOW_INPUT_CUSTOMERID_KEY));
       
        BookingWorkflowClientExternalFactory clientFactory = new BookingWorkflowClientExternalFactoryImpl(swfService, domain);
        BookingWorkflowClientExternal workflow = clientFactory.getClient();
        workflow.makeBooking(requestId, customerId, true, true);
       
View Full Code Here


        return activityWorker;
    }

    public static void main(String[] args) throws Exception {
      // load configuration
      ConfigHelper configHelper = loadConfig();
     
      // Start Activity Worker
        getActivityHost().startWorker(configHelper);
                       
        // Add a Shutdown hook to close ActivityWorker
View Full Code Here

        System.out.println("Worker Stopped...");
    }
   
   
    static ConfigHelper loadConfig() throws IllegalArgumentException, IOException{
         ConfigHelper configHelper = ConfigHelper.createConfig();
        swfService = configHelper.createSWFClient();
        domain = configHelper.getDomain();
        domainRetentionPeriodInDays = configHelper.getDomainRetentionPeriodInDays();
       
        return configHelper;
    }
View Full Code Here

    private static String domain;

    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();

        // Start Workflow execution
        PeriodicWorkflowClientExternalFactory clientFactory = new PeriodicWorkflowClientExternalFactoryImpl(swfService, domain);

        // Passing instance id to ensure that only one periodic workflow can be active at a time.
View Full Code Here

public class ActivityHost {   
   
    private static final String ACTIVITIES_TASK_LIST = "Periodic";

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

        final ActivityWorker worker = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);

        // Create activity implementations
        PeriodicWorkflowActivities periodicActivitiesImpl = new PeriodicWorkflowActivitiesImpl();
View Full Code Here

public class WorkflowHost {

    public static final String DECISION_TASK_LIST = "PeriodicWorkflow";

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

        final WorkflowWorker worker = new WorkflowWorker(swfService, domain, DECISION_TASK_LIST);
        worker.addWorkflowImplementationType(CronWorkflowImpl.class);
        worker.setRegisterDomain(true);
        worker.setDomainRetentionPeriodInDays(1);
View Full Code Here

        catch (NumberFormatException e) {
            System.err.println("Value of CONTINUE_AS_NEW_AFTER_SECONDS is not int: " + args[2]);
            System.exit(1);
        }
        // Load configuration
        ConfigHelper configHelper = ConfigHelper.createConfig();

        // Create the client for Simple Workflow Service
        swfService = configHelper.createSWFClient();
        domain = configHelper.getDomain();

        // Name and versions are hardcoded here but they can be passed as args or loaded from configuration file.
        ActivityType activity = new ActivityType();
        activity.setName("CronExampleActivities.doSomeWork");
        activity.setVersion("1.0");
View Full Code Here

public class WorkflowHost {

    private static final String DECISION_TASK_LIST = "FileProcessing";

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

        final WorkflowWorker worker = new WorkflowWorker(swfService, domain, DECISION_TASK_LIST);
        worker.addWorkflowImplementationType(FileProcessingWorkflowZipImpl.class);
        worker.start();
View Full Code Here

    private static String domain;
   
    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();
       
        // Start Workflow instance
        String sourceBucketName = configHelper.getValueFromConfig(FileProcessingConfigKeys.WORKFLOW_INPUT_SOURCEBUCKETNAME_KEY);
        String sourceFilename = configHelper.getValueFromConfig(FileProcessingConfigKeys.WORKFLOW_INPUT_SOURCEFILENAME_KEY);
        String targetBucketName = configHelper.getValueFromConfig(FileProcessingConfigKeys.WORKFLOW_INPUT_TARGETBUCKETNAME_KEY);
        String targetFilename = configHelper.getValueFromConfig(FileProcessingConfigKeys.WORKFLOW_INPUT_TARGETFILENAME_KEY);
       
        FileProcessingWorkflowClientExternalFactory clientFactory = new FileProcessingWorkflowClientExternalFactoryImpl(swfService, domain);
        FileProcessingWorkflowClientExternal workflow = clientFactory.getClient();
        workflow.processFile(sourceBucketName, sourceFilename, targetBucketName, targetFilename);
View Full Code Here

public class ActivityHost {   

    private static final String ACTIVITIES_TASK_LIST = "FileProcessing";

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

        String localFolder = configHelper.getValueFromConfig(FileProcessingConfigKeys.ACTIVITY_WORKER_LOCALFOLDER);
       
        // Start worker to poll the common task list
        final ActivityWorker workerForCommonTaskList = new ActivityWorker(swfService, domain, ACTIVITIES_TASK_LIST);
        SimpleStoreActivitiesS3Impl storeActivityImpl = new SimpleStoreActivitiesS3Impl(s3Client, localFolder, getHostName());
        workerForCommonTaskList.addActivitiesImplementation(storeActivityImpl);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleworkflow.flow.examples.common.ConfigHelper

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.