Example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient countOpenWorkflowExecutions

List of usage examples for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient countOpenWorkflowExecutions

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleworkflow AmazonSimpleWorkflowClient countOpenWorkflowExecutions.

Prototype

@Override
public WorkflowExecutionCount countOpenWorkflowExecutions(CountOpenWorkflowExecutionsRequest request) 

Source Link

Document

Returns the number of open workflow executions within the given domain that meet the specified filtering criteria.

Usage

From source file:org.diksha.common.dyutils.SchedulerUDE.java

License:Apache License

public static int countOpenExecutionsFromSWF(String config) {

    SchedulerConfig schedulerConfig = DyDBUtils.getSchedulerConfig(config);

    AmazonSimpleWorkflowClient amazonSimpleWorkflowClient = new AmazonSimpleWorkflowClient(
            DyDBUtils.getAwsCredentials());
    amazonSimpleWorkflowClient.setEndpoint(schedulerConfig.getEndPoint());

    CountOpenWorkflowExecutionsRequest countOpenWorkflowExecutionsRequest = new CountOpenWorkflowExecutionsRequest()
            .withDomain(schedulerConfig.getDomain());
    countOpenWorkflowExecutionsRequest//w  w  w .  j a va  2  s  .  c  om
            .setStartTimeFilter(new ExecutionTimeFilter().withOldestDate(new Date(0L)));
    WorkflowExecutionCount workflowExecutionCount = amazonSimpleWorkflowClient
            .countOpenWorkflowExecutions(countOpenWorkflowExecutionsRequest);

    return workflowExecutionCount.getCount();
}