Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
adds a batch API to fetch workflows based on a correlation id list
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Lacerda de Miranda committed Feb 23, 2018
1 parent 556029e commit 72d2649
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -117,6 +118,21 @@ public List<Workflow> getWorkflows(@PathParam("name") String name, @PathParam("c
@QueryParam("includeTasks") @DefaultValue("false") boolean includeTasks) throws Exception {
return service.getWorkflowInstances(name, correlationId, includeClosed, includeTasks);
}

@POST
@Path("/{name}/correlated")
@ApiOperation("Lists workflows for the given correlation id list")
@Consumes(MediaType.WILDCARD)
public Map<String, List<Workflow>> getWorkflows(@PathParam("name") String name,
@QueryParam("includeClosed") @DefaultValue("false") boolean includeClosed,
@QueryParam("includeTasks") @DefaultValue("false") boolean includeTasks, List<String> correlationIds) throws Exception {
Map<String, List<Workflow>> workflows = new HashMap<>();
for(String correlationId : correlationIds) {
List<Workflow> ws = service.getWorkflowInstances(name, correlationId, includeClosed, includeTasks);
workflows.put(correlationId, ws);
}
return workflows;
}

@GET
@Path("/{workflowId}")
Expand Down

0 comments on commit 72d2649

Please sign in to comment.