Closed mingfang closed 3 years ago
https://github.com/kiegroup/kogito-runtimes/blob/741a14640fa11f2ee1d21104ab3e47df8bec4831/addons/process-svg/process-svg-quarkus-addon/src/main/java/org/kie/kogito/svg/dataindex/QuarkusDataIndexClient.java#L82
here is the fix
public List<NodeInstance> getNodeInstancesFromProcessInstance(String processInstanceId) { String query = getNodeInstancesQuery(processInstanceId); CompletableFuture<List<NodeInstance>> cf = new CompletableFuture<>(); HttpRequest<Buffer> request = client.post("/graphql").putHeader("Authorization", getToken()); request.sendJsonObject(JsonObject.mapFrom(singletonMap("query", query)), result -> { if (result.succeeded() && result.result().statusCode() == 200) { cf.complete(getNodeInstancesFromResponse(result.result().bodyAsJsonObject())); } else { cf.completeExceptionally(result.cause()); } }); try { return cf.get(); } catch (Exception e) { throw new ProcessSVGException("Exception while trying to get data from Data Index service", e); } }
It turns out sendJson() and sendJsonObject() do exactly the same thing.
https://github.com/kiegroup/kogito-runtimes/blob/741a14640fa11f2ee1d21104ab3e47df8bec4831/addons/process-svg/process-svg-quarkus-addon/src/main/java/org/kie/kogito/svg/dataindex/QuarkusDataIndexClient.java#L82
here is the fix