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);
}
}
void handleActivityTaskCompleted(HistoryEvent event) {
ActivityTaskCompletedEventAttributes attributes = event.getActivityTaskCompletedEventAttributes();