Skip to content

Commit

Permalink
[KOGITO-9555] Update process definition
Browse files Browse the repository at this point in the history
  • Loading branch information
fjtirado committed Jul 11, 2023
1 parent a3054eb commit 6ab6023
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ public Process<JsonNodeModel> process(Workflow workflow) {
return processes.map.computeIfAbsent(workflow.getId(), k -> createProcess(workflow));
}

public Process<JsonNodeModel> processAlways(Workflow workflow) {
return processes.map.put(workflow.getId(), createProcess(workflow));
}

public void registerHandler(KogitoWorkItemHandler handler) {
handlers.add(handler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 6ab6023

Please sign in to comment.