bncriju commented on code in PR #2781:
URL: 
https://github.com/apache/incubator-kie-tools/pull/2781#discussion_r1888972826


##########
packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/rpc/JBPMDevuiJsonRPCService.java:
##########
@@ -84,24 +99,43 @@ protected WebClientOptions buildWebClientOptions(String 
dataIndexURL) throws Mal
                 .setSsl(url.getProtocol().compareToIgnoreCase("https") == 0);
     }
 
-    public Uni<String> queryProcessInstancesCount() {
-        return doQuery(ALL_PROCESS_INSTANCES_IDS_QUERY, PROCESS_INSTANCES);
+    public Multi<String> queryProcessInstancesCount() {
+        return processesStream;
+    }
+
+    public Multi<String> queryTasksCount() {
+        return userTaskStream;
     }
 
-    public Uni<String> queryTasksCount() {
-        return doQuery(ALL_TASKS_IDS_QUERY, USER_TASKS);
+    public Multi<String> queryJobsCount() {
+        return jobsStreams;
+    }
+
+    private void onProcessEvent() {
+        doQuery(processesStream, ALL_PROCESS_INSTANCES_IDS_QUERY, 
PROCESS_INSTANCES);
+    }
+    private void onUserTaskEvent() {
+        doQuery(userTaskStream, ALL_TASKS_IDS_QUERY, USER_TASKS);
+    }
+    private void onJobEvent() {
+        doQuery(jobsStreams, ALL_JOBS_IDS_QUERY, JOBS);
     }
 
-    public Uni<String> queryJobsCount() {
-        return doQuery(ALL_JOBS_IDS_QUERY, JOBS);
+    private void doQuery(BroadcastProcessor<String> stream, String query, 
String graphModelName) {
+        LOGGER.warn("Query: " + graphModelName);
+        doQuery(query, graphModelName).toCompletionStage()
+                .thenAccept(result -> {
+            LOGGER.warn("Query: " + graphModelName + ". Received response: " + 
result);
+            stream.onNext(result);

Review Comment:
   Done. Incorporated in new PR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to