use of org.activiti.engine.impl.persistence.entity.HistoricProcessInstanceEntity in project Activiti by Activiti.
the class HistoricProcessInstanceQueryImpl method localize.
protected void localize(HistoricProcessInstance processInstance, CommandContext commandContext) {
HistoricProcessInstanceEntity processInstanceEntity = (HistoricProcessInstanceEntity) processInstance;
processInstanceEntity.setLocalizedName(null);
processInstanceEntity.setLocalizedDescription(null);
if (locale != null && processInstance.getProcessDefinitionId() != null) {
ProcessDefinition processDefinition = commandContext.getProcessEngineConfiguration().getDeploymentManager().findDeployedProcessDefinitionById(processInstanceEntity.getProcessDefinitionId());
ObjectNode languageNode = Context.getLocalizationElementProperties(locale, processDefinition.getKey(), processInstanceEntity.getProcessDefinitionId(), withLocalizationFallback);
if (languageNode != null) {
JsonNode languageNameNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_NAME);
if (languageNameNode != null && !languageNameNode.isNull()) {
processInstanceEntity.setLocalizedName(languageNameNode.asText());
}
JsonNode languageDescriptionNode = languageNode.get(DynamicBpmnConstants.LOCALIZATION_DESCRIPTION);
if (languageDescriptionNode != null && !languageDescriptionNode.isNull()) {
processInstanceEntity.setLocalizedDescription(languageDescriptionNode.asText());
}
}
}
}
Aggregations