completionHandle.fail(failure);
}
}
void handleActivityTaskCompleted(HistoryEvent event) {
ActivityTaskCompletedEventAttributes attributes = event.getActivityTaskCompletedEventAttributes();
String activityId = decisions.getActivityId(attributes);
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();
}
}