Example usage for com.amazonaws.services.simpleworkflow.model ActivityTask getWorkflowExecution

List of usage examples for com.amazonaws.services.simpleworkflow.model ActivityTask getWorkflowExecution

Introduction

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

Prototype


public WorkflowExecution getWorkflowExecution() 

Source Link

Document

The workflow execution that started this activity task.

Usage

From source file:org.diksha.common.utils.SchedulerActivitiesImpl.java

License:Apache License

@Override
public void terminateScheduler() {

    System.out.println("terminated...1");

    try {//  w  ww  .j  a v  a 2s  .c  om
        ActivityExecutionContextProvider provider = new ActivityExecutionContextProviderImpl();
        ActivityExecutionContext aec = provider.getActivityExecutionContext();

        ActivityTask at = aec.getTask();
        WorkflowExecution we = at.getWorkflowExecution();

        GenericWorkflowClientExternal gwcei = new GenericWorkflowClientExternalImpl(aec.getService(),
                aec.getDomain());
        TerminateWorkflowExecutionParameters terminateParameters = new TerminateWorkflowExecutionParameters(we,
                com.amazonaws.services.simpleworkflow.model.ChildPolicy.TERMINATE, "limits", "limits");
        gwcei.terminateWorkflowExecution(terminateParameters);
        System.out.println("terminated workflow");
    } catch (Exception e) {
        System.out.println("terminated workflow..2");

    }
}