From 369a13401a9cab52bd4b88cc9e88a9dc002929ca Mon Sep 17 00:00:00 2001 From: renczesstefan Date: Thu, 5 Feb 2026 17:53:59 +0100 Subject: [PATCH] Ensure process ID and identifier are non-empty in case creation. Refine condition checks by validating that `processId` and `processIdentifier` are not empty strings. This prevents potential issues caused by invalid or incomplete input during case creation. --- .../application/engine/workflow/service/WorkflowService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java b/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java index f4ade6dc8b..f4884ebc70 100644 --- a/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java +++ b/application-engine/src/main/java/com/netgrif/application/engine/workflow/service/WorkflowService.java @@ -340,9 +340,9 @@ private void fillAndValidateAttributes(CreateCaseParams createCaseParams) throws } if (createCaseParams.getProcess() == null) { PetriNet petriNet; - if (createCaseParams.getProcessId() != null) { + if (createCaseParams.getProcessId() != null && !createCaseParams.getProcessId().isEmpty()) { petriNet = new com.netgrif.application.engine.adapter.spring.petrinet.domain.PetriNet((com.netgrif.application.engine.adapter.spring.petrinet.domain.PetriNet) petriNetService.get(new ObjectId(createCaseParams.getProcessId()))); - } else if (createCaseParams.getProcessIdentifier() != null) { + } else if (createCaseParams.getProcessIdentifier() != null && !createCaseParams.getProcessIdentifier().isEmpty()) { PetriNet originNet = petriNetService.getDefaultVersionByIdentifier(createCaseParams.getProcessIdentifier()); if (originNet == null) { throw new IllegalArgumentException("Could not find the process for the Case from provided inputs on case creation.");