String activityResult = impl.execute(executionContext);
result.set(activityResult);
}
catch (Throwable e) {
if (e instanceof ActivityFailureException) {
ActivityFailureException falure = (ActivityFailureException) e;
throw new ActivityTaskFailedException(0, activityType, parameters.getActivityId(), falure.getReason(),
falure.getDetails());
}
// Unless there is problem in the framework or generic activity implementation this shouldn't be executed
ActivityTaskFailedException failure = new ActivityTaskFailedException(0, activityType, parameters.getActivityId(),
e.getMessage(), null);
failure.initCause(e);