Package com.amazonaws.services.simpleworkflow.flow.core

Examples of com.amazonaws.services.simpleworkflow.flow.core.ExternalTaskCompletionHandle


        String activityId = decisions.getActivityId(attributes);
        if (decisions.handleActivityTaskCanceled(event)) {
            CancellationException e = new CancellationException();
            OpenRequestInfo<String, ActivityType> scheduled = scheduledActivities.remove(activityId);
            if (scheduled != null) {
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                // It is OK to fail with subclass of CancellationException when cancellation requested.
                // It allows passing information about cancellation (details in this case) to the surrounding doCatch block
                completionHandle.fail(e);
            }
        }
    }
View Full Code Here


        OpenRequestInfo<String, ActivityType> scheduled = scheduledActivities.remove(activityId);
        if (decisions.handleScheduleActivityTaskFailed(event)) {
            String cause = attributes.getCause();
            ScheduleActivityTaskFailedException failure = new ScheduleActivityTaskFailedException(event.getEventId(),
                    attributes.getActivityType(), activityId, cause);
            ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
            completionHandle.fail(failure);
        }
    }
View Full Code Here

        if (decisions.handleActivityTaskClosed(activityId)) {
            OpenRequestInfo<String, ActivityType> scheduled = scheduledActivities.remove(activityId);
            if (scheduled != null) {
                String result = attributes.getResult();
                scheduled.getResult().set(result);
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                completionHandle.complete();
            }
        }
    }
View Full Code Here

            if (scheduled != null) {
                String reason = attributes.getReason();
                String details = attributes.getDetails();
                ActivityTaskFailedException failure = new ActivityTaskFailedException(event.getEventId(),
                        scheduled.getUserContext(), activityId, reason, details);
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                completionHandle.fail(failure);
            }
        }
    }
View Full Code Here

            if (scheduled != null) {
                String timeoutType = attributes.getTimeoutType();
                String details = attributes.getDetails();
                ActivityTaskTimedOutException failure = new ActivityTaskTimedOutException(event.getEventId(),
                        scheduled.getUserContext(), activityId, timeoutType, details);
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                completionHandle.fail(failure);
            }
        }
    }
View Full Code Here

    void handleTimerFired(Long eventId, TimerFiredEventAttributes attributes) {
        String timerId = attributes.getTimerId();
        if (decisions.handleTimerClosed(timerId)) {
            OpenRequestInfo scheduled = scheduledTimers.remove(timerId);
            if (scheduled != null) {
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                scheduled.getResult().set(scheduled.getUserContext());
                completionHandle.complete();
            }
        }
        else {
            log.debug("handleTimerFired not complete");
        }
View Full Code Here

        StartTimerFailedEventAttributes attributes = event.getStartTimerFailedEventAttributes();
        String timerId = attributes.getTimerId();
        if (decisions.handleStartTimerFailed(event)) {
            OpenRequestInfo scheduled = scheduledTimers.remove(timerId);
            if (scheduled != null) {
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                Object createTimerUserContext = scheduled.getUserContext();
                String cause = attributes.getCause();
                Throwable failure = new StartTimerFailedException(event.getEventId(), timerId, createTimerUserContext, cause);
                completionHandle.fail(failure);
            }
        }
        else {
            log.debug("handleStartTimerFailed not complete");
        }
View Full Code Here

        TimerCanceledEventAttributes attributes = event.getTimerCanceledEventAttributes();
        String timerId = attributes.getTimerId();
        if (decisions.handleTimerCanceled(event)) {
            OpenRequestInfo<?, ?> scheduled = scheduledTimers.remove(timerId);
            if (scheduled != null) {
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                CancellationException exception = new CancellationException();
                completionHandle.fail(exception);
            }
        }
        else {
            log.debug("handleTimerCanceled not complete");
        }
View Full Code Here

            decisions.cancelTimer(timerId, new Runnable() {

                @Override
                public void run() {
                    OpenRequestInfo<?, ?> scheduled = scheduledTimers.remove(timerId);
                    ExternalTaskCompletionHandle context = scheduled.getCompletionHandle();
                    context.complete();
                }
            });
        }
View Full Code Here

        String workflowId = execution.getWorkflowId();
        if (decisions.handleChildWorkflowExecutionCanceled(workflowId)) {
            OpenRequestInfo<StartChildWorkflowReply, WorkflowType> scheduled = scheduledExternalWorkflows.remove(workflowId);
            if (scheduled != null) {
                CancellationException e = new CancellationException();
                ExternalTaskCompletionHandle completionHandle = scheduled.getCompletionHandle();
                // It is OK to fail with subclass of CancellationException when cancellation requested.
                // It allows passing information about cancellation (details in this case) to the surrounding doCatch block
                completionHandle.fail(e);
            }
        }
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.simpleworkflow.flow.core.ExternalTaskCompletionHandle

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.