diff --git a/kogito-serverless-workflow/kogito-serverless-workflow-executor-core/src/main/java/org/kie/kogito/serverless/workflow/executor/StaticWorkflowApplication.java b/kogito-serverless-workflow/kogito-serverless-workflow-executor-core/src/main/java/org/kie/kogito/serverless/workflow/executor/StaticWorkflowApplication.java index 17e40acdfc4..22634fab628 100644 --- a/kogito-serverless-workflow/kogito-serverless-workflow-executor-core/src/main/java/org/kie/kogito/serverless/workflow/executor/StaticWorkflowApplication.java +++ b/kogito-serverless-workflow/kogito-serverless-workflow-executor-core/src/main/java/org/kie/kogito/serverless/workflow/executor/StaticWorkflowApplication.java @@ -217,6 +217,10 @@ public Process process(Workflow workflow) { return processes.map.computeIfAbsent(workflow.getId(), k -> createProcess(workflow)); } + public Process processAlways(Workflow workflow) { + return processes.map.put(workflow.getId(), createProcess(workflow)); + } + public void registerHandler(KogitoWorkItemHandler handler) { handlers.add(handler); } diff --git a/quarkus/addons/process-definitions/runtime/src/main/java/org/kie/kogito/process/definitions/ProcessDefinitionsResource.java b/quarkus/addons/process-definitions/runtime/src/main/java/org/kie/kogito/process/definitions/ProcessDefinitionsResource.java index c27ce320ffb..eb84e2c19b0 100644 --- a/quarkus/addons/process-definitions/runtime/src/main/java/org/kie/kogito/process/definitions/ProcessDefinitionsResource.java +++ b/quarkus/addons/process-definitions/runtime/src/main/java/org/kie/kogito/process/definitions/ProcessDefinitionsResource.java @@ -67,7 +67,7 @@ public Response executeProcess(@PathParam("id") String processId, JsonNodeModelI @Produces(MediaType.TEXT_PLAIN) @Path("{id}/definition") public Response uploadProcess(@PathParam("id") String processId, String content) throws IOException { - application.process(ServerlessWorkflowUtils.getWorkflow(new StringReader(content), content.startsWith("{") ? WorkflowFormat.JSON : WorkflowFormat.YAML)); + application.processAlways(ServerlessWorkflowUtils.getWorkflow(new StringReader(content), content.startsWith("{") ? WorkflowFormat.JSON : WorkflowFormat.YAML)); return Response.ok().build(); } }