Search in sources :

Example 1 with ActivityTaskCancelRequestedEventAttributes

use of com.uber.cadence.ActivityTaskCancelRequestedEventAttributes in project cadence-client by uber-java.

the class DecisionsHelper method handleActivityTaskCancelRequested.

boolean handleActivityTaskCancelRequested(HistoryEvent event) {
    ActivityTaskCancelRequestedEventAttributes attributes = event.getActivityTaskCancelRequestedEventAttributes();
    String activityId = attributes.getActivityId();
    DecisionStateMachine decision = getDecision(new DecisionId(DecisionTarget.ACTIVITY, activityId));
    decision.handleCancellationInitiatedEvent();
    return decision.isDone();
}
Also used : ActivityTaskCancelRequestedEventAttributes(com.uber.cadence.ActivityTaskCancelRequestedEventAttributes)

Example 2 with ActivityTaskCancelRequestedEventAttributes

use of com.uber.cadence.ActivityTaskCancelRequestedEventAttributes in project cadence-client by uber-java.

the class StateMachines method requestActivityCancellation.

private static void requestActivityCancellation(RequestContext ctx, ActivityTaskData data, RequestCancelActivityTaskDecisionAttributes d, long decisionTaskCompletedEventId) {
    ActivityTaskCancelRequestedEventAttributes a = new ActivityTaskCancelRequestedEventAttributes().setActivityId(d.getActivityId()).setDecisionTaskCompletedEventId(decisionTaskCompletedEventId);
    HistoryEvent event = new HistoryEvent().setEventType(EventType.ActivityTaskCancelRequested).setActivityTaskCancelRequestedEventAttributes(a);
    ctx.addEvent(event);
}
Also used : ActivityTaskCancelRequestedEventAttributes(com.uber.cadence.ActivityTaskCancelRequestedEventAttributes) HistoryEvent(com.uber.cadence.HistoryEvent)

Aggregations

ActivityTaskCancelRequestedEventAttributes (com.uber.cadence.ActivityTaskCancelRequestedEventAttributes)2 HistoryEvent (com.uber.cadence.HistoryEvent)1