}
ExecuteRequest request = new ExecuteRequest(execute);
// TODO: get the startup time from the execution status
ExecuteResponseBuilder builder = new ExecuteResponseBuilder(execute, context, new Date());
String executionId = executionManager.submit(request, !request.isAsynchronous());
builder.setExecutionId(executionId);
if (!request.isAsynchronous()) {
try {
Map<String, Object> outputs = executionManager.getOutput(executionId, -1);
builder.setOutputs(outputs);
} catch (Exception e) {
LOGGER.log(Level.SEVERE, "Process execution failed", e);
builder.setException(e);
}
}
return builder.build();
}