protected void execute(final ActivityTask task) throws Exception {
String output = null;
ActivityType activityType = task.getActivityType();
try {
ActivityExecutionContext context = new ActivityExecutionContextImpl(service, domain, task);
ActivityImplementation activityImplementation = activityImplementationFactory.getActivityImplementation(activityType);
if (activityImplementation == null) {
throw new ActivityFailureException("Unknown activity type: " + activityType);
}
output = activityImplementation.execute(context);