)
{
try {
Map<String, Object> javaPayload = getProcessManagement().getInstanceData(instanceId);
Payload2XML payload2XML = new Payload2XML();
StringBuffer sb = payload2XML.convert(instanceId, javaPayload);
return Response.ok(sb.toString()).build();
} catch (Exception e) {
log.error("Error when getting instance data", e);
ResponseBuilder builder = Response.fromResponse(Response.ok(e.getMessage()).build());
builder.status(Status.INTERNAL_SERVER_ERROR);