use of com.uber.cadence.ActivityType in project cadence-client by uber-java.
the class ActivityDecisionContext method handleActivityTaskCanceled.
void handleActivityTaskCanceled(HistoryEvent event) {
ActivityTaskCanceledEventAttributes attributes = event.getActivityTaskCanceledEventAttributes();
String activityId = decisions.getActivityId(attributes);
if (decisions.handleActivityTaskCanceled(event)) {
CancellationException e = new CancellationException();
OpenRequestInfo<byte[], ActivityType> scheduled = scheduledActivities.remove(activityId);
if (scheduled != null) {
BiConsumer<byte[], Exception> completionHandle = scheduled.getCompletionCallback();
// 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.accept(null, e);
}
}
}
Aggregations