@Override public void transformJson(HistoryJobEntity job, ObjectNode historicalData, CommandContext commandContext) { HistoricEntityLinkService historicEntityLinkService = CommandContextUtil.getHistoricEntityLinkService(); HistoricEntityLinkEntity historicEntityLinkEntity = (HistoricEntityLinkEntity) historicEntityLinkService.createHistoricEntityLink(); historicEntityLinkEntity.setId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_ID)); historicEntityLinkEntity.setLinkType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_ENTITY_LINK_TYPE)); historicEntityLinkEntity.setCreateTime(getDateFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_CREATE_TIME)); historicEntityLinkEntity.setScopeId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_ID)); historicEntityLinkEntity.setScopeType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_TYPE)); historicEntityLinkEntity.setScopeDefinitionId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_DEFINITION_ID)); historicEntityLinkEntity.setReferenceScopeId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REF_SCOPE_ID)); historicEntityLinkEntity.setReferenceScopeType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REF_SCOPE_TYPE)); historicEntityLinkEntity.setReferenceScopeDefinitionId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_REF_SCOPE_DEFINITION_ID)); historicEntityLinkEntity.setHierarchyType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_HIERARCHY_TYPE)); historicEntityLinkService.insertHistoricEntityLink(historicEntityLinkEntity, false); }
@Override public void transformJson(HistoryJobEntity job, ObjectNode historicalData, CommandContext commandContext) { HistoricEntityLinkService historicEntityLinkService = CommandContextUtil.getHistoricEntityLinkService(); HistoricEntityLinkEntity historicEntityLinkEntity = (HistoricEntityLinkEntity) historicEntityLinkService.createHistoricEntityLink(); historicEntityLinkEntity.setId(getStringFromJson(historicalData, HistoryJsonConstants.ID)); historicEntityLinkEntity.setLinkType(getStringFromJson(historicalData, HistoryJsonConstants.ENTITY_LINK_TYPE)); historicEntityLinkEntity.setCreateTime(getDateFromJson(historicalData, HistoryJsonConstants.CREATE_TIME)); historicEntityLinkEntity.setScopeId(getStringFromJson(historicalData, HistoryJsonConstants.SCOPE_ID)); historicEntityLinkEntity.setScopeType(getStringFromJson(historicalData, HistoryJsonConstants.SCOPE_TYPE)); historicEntityLinkEntity.setScopeDefinitionId(getStringFromJson(historicalData, HistoryJsonConstants.SCOPE_DEFINITION_ID)); historicEntityLinkEntity.setReferenceScopeId(getStringFromJson(historicalData, HistoryJsonConstants.REF_SCOPE_ID)); historicEntityLinkEntity.setReferenceScopeType(getStringFromJson(historicalData, HistoryJsonConstants.REF_SCOPE_TYPE)); historicEntityLinkEntity.setReferenceScopeDefinitionId(getStringFromJson(historicalData, HistoryJsonConstants.REF_SCOPE_DEFINITION_ID)); historicEntityLinkEntity.setHierarchyType(getStringFromJson(historicalData, HistoryJsonConstants.HIERARCHY_TYPE)); historicEntityLinkService.insertHistoricEntityLink(historicEntityLinkEntity, false); }
historicEntityLinkEntity.setReferenceScopeDefinitionId(entityLink.getReferenceScopeDefinitionId()); historicEntityLinkEntity.setHierarchyType(entityLink.getHierarchyType()); historicEntityLinkService.insertHistoricEntityLink(historicEntityLinkEntity, false);
@Override public void recordEntityLinkCreated(EntityLinkEntity entityLink) { if (cmmnEngineConfiguration.getHistoryLevel() != HistoryLevel.NONE && entityLink.getScopeId() != null) { HistoricEntityLinkService historicEntityLinkService = CommandContextUtil.getHistoricEntityLinkService(); HistoricEntityLinkEntity historicEntityLinkEntity = (HistoricEntityLinkEntity) historicEntityLinkService.createHistoricEntityLink(); historicEntityLinkEntity.setId(entityLink.getId()); historicEntityLinkEntity.setLinkType(entityLink.getLinkType()); historicEntityLinkEntity.setCreateTime(entityLink.getCreateTime()); historicEntityLinkEntity.setScopeId(entityLink.getScopeId()); historicEntityLinkEntity.setScopeType(entityLink.getScopeType()); historicEntityLinkEntity.setScopeDefinitionId(entityLink.getScopeDefinitionId()); historicEntityLinkEntity.setReferenceScopeId(entityLink.getReferenceScopeId()); historicEntityLinkEntity.setReferenceScopeType(entityLink.getReferenceScopeType()); historicEntityLinkEntity.setReferenceScopeDefinitionId(entityLink.getReferenceScopeDefinitionId()); historicEntityLinkEntity.setHierarchyType(entityLink.getHierarchyType()); historicEntityLinkService.insertHistoricEntityLink(historicEntityLinkEntity, false); } }