Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#1669: jBPM Quarkus DevUI seems to not update the # of items #2781

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bncriju
Copy link
Contributor

@bncriju bncriju commented Dec 2, 2024

The wrong behavior is rectified by making the Process Instances, Tasks and Jobs to get dynamically updated, as and when user defines a process instance.

Closes apache/incubator-kie-issues#1669

@bncriju bncriju requested a review from tiagobento as a code owner December 2, 2024 10:17
Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, I have some points for a discussion before merge.

Comment on lines 125 to 129
LOGGER.warn("Query: " + graphModelName);
doQuery(query, graphModelName).toCompletionStage()
.thenAccept(result -> {
LOGGER.warn("Query: " + graphModelName + ". Received response: " + result);
stream.onNext(result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the warning level needed here? sounds like good event for info or debug, but I am not sure, maybe there is good reason to have warn

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea I'd remove this to avoid verbosity. Only log if there's an error on the query.

}

private void maybeRun(Runnable runnable) {
if(Objects.nonNull(runnable)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tiagobento hi, does Prettier format only non java files? I would expect if () { instead of if() {

import java.util.Collection;
import java.util.Objects;

@ApplicationScoped
Copy link
Contributor

@pefernan pefernan Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the @IfBuildProfile("dev") here, to make sure that this bean is only available in dev mode!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke the build, @pefernan . Maybe more changes need to be made or it need to have a prod bean? I don't know.

@@ -41,6 +44,10 @@
public class JBPMDevuiJsonRPCService {
private static final String DATA_INDEX_URL = "kogito.data-index.url";

private final BroadcastProcessor<String> processesStream = BroadcastProcessor.create();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we said to move this to Multi, since the BroadcastProcessor don't cache values, or have an intermediate bean that acts as a values producer for the Multi

@yesamer yesamer changed the title Changes to make counters dynamic kie-issues#1669: DevUI seems to not update the # of items Dec 4, 2024
@tiagobento tiagobento changed the title kie-issues#1669: DevUI seems to not update the # of items kie-issues#1669: jBPM Quarkus DevUI seems to not update the # of items Dec 6, 2024
@danielzhe
Copy link
Contributor

I fixed the broken build locally and published here: danielzhe@329e23e

The fix that I made it was just to make it buildable, I don't know if the code this way is your intention, because of the use of @IfBuildProfile("dev") that I had to remove to satisfy the injection point. @bncriju

private Multi<String> multi;
private WebClient dataIndexWebClient;

public DataIndexCounter(String query, String graphname, BroadcastProcessor<String> stream,WebClient dataIndexWebClient, JBPMDevUIEventPublisher eventPublisher) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JBPMDevUIEventPublisher eventPublisher is not being used anywhere here.

Also, you can format the parameters with a space between each one:
String query, String graphname, BroadcastProcessor<String> stream, WebClient dataIndexWebClient
(the stream,WebClient are merged)

private static final Logger LOGGER = LoggerFactory.getLogger(DataIndexCounter.class);

private Multi<String> multi;
private WebClient dataIndexWebClient;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can set those fields as final, since their instances are not changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

jBPM Quarkus DevUI seems to not update the # of items
5 participants