public RestVariable getVariableFromRequest(boolean includeBinary, String detailId, HttpServletRequest request) { Object value = null; HistoricVariableUpdate variableUpdate = null; HistoricDetail detailObject = historyService.createHistoricDetailQuery().id(detailId).singleResult(); if (detailObject instanceof HistoricVariableUpdate) { variableUpdate = (HistoricVariableUpdate) detailObject; value = variableUpdate.getValue(); } if (value == null) { throw new ActivitiObjectNotFoundException("Historic detail '" + detailId + "' doesn't have a variable value.", VariableInstanceEntity.class); } else { return restResponseFactory.createRestVariable(variableUpdate.getVariableName(), value, null, detailId, RestResponseFactory.VARIABLE_HISTORY_DETAIL, includeBinary); } } }