From bfadeb2868d31ec856c09a036d2618ff3cad46d3 Mon Sep 17 00:00:00 2001 From: GouadriaHanen <49310007+GouadriaHanen@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:15:14 +0100 Subject: [PATCH] fix: fix creation new process issue - EXO-68731 (#348) before this change, when saving a new process a log error is displayed for nullability for modifiedDate field After this change, when saving a process the modified date is not null and the process is created successfully --- .../exoplatform/processes/storage/ProcessesStorageImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java b/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java index d386039c2..bc623aa3b 100644 --- a/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java +++ b/processes-services/src/main/java/org/exoplatform/processes/storage/ProcessesStorageImpl.java @@ -145,6 +145,8 @@ public WorkFlow saveWorkFlow(WorkFlow workFlow, long userId) throws IllegalArgum } else if (illustrativeAttachment != null && illustrativeAttachment.isToDelete()) { workFlowEntity.setIllustrationImageId(null); } + workFlowEntity.setModifiedDate(new Date()); + workFlowEntity.setModifierId(userId); if (workFlow.getId() == 0) { workFlowEntity.setId(null); workFlowEntity.setCreatedDate(new Date()); @@ -181,8 +183,6 @@ public WorkFlow saveWorkFlow(WorkFlow workFlow, long userId) throws IllegalArgum workFlowEntity.setParticipator(workFlowDAO.find(workFlowEntity.getId()).getParticipator()); } workFlowEntity.setManager(getManagers(workFlow.getRequestsCreators())); - workFlowEntity.setModifiedDate(new Date()); - workFlowEntity.setModifierId(userId); workFlowEntity = workFlowDAO.update(workFlowEntity); } processesAttachmentService.linkAttachmentsToEntity(workFlow.getAttachments(), @@ -515,6 +515,7 @@ public Work saveWorkDraft(Work work, long userId) { throw new IllegalArgumentException("identity is not exist"); } WorkEntity workEntity = EntityMapper.toEntity(work); + workEntity.setModifiedDate(new Date()); if (work.getId() == 0) { workEntity.setId(null); workEntity.setCreatedDate(new Date()); @@ -527,7 +528,6 @@ public Work saveWorkDraft(Work work, long userId) { WORK_DRAFT_ENTITY_TYPE, work.getWorkFlow().getProjectId()); } else { - workEntity.setModifiedDate(new Date()); workEntity = workDraftDAO.update(workEntity); }