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