if (activityInstance == null) {
throw new InvalidRequestException(Status.NOT_FOUND, "Process instance with id " + processInstanceId + " does not exist");
}
ActivityInstanceDto result = ActivityInstanceDto.fromActivityInstance(activityInstance);
return result;
}