gitgabrio commented on code in PR #3707:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3707#discussion_r1796802281
##########
jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java:
##########
@@ -195,16 +196,25 @@ public void addNodeInstance(final NodeInstance
nodeInstance) {
((NodeInstanceImpl)
nodeInstance).setId(UUID.randomUUID().toString());
}
this.nodeInstances.add(nodeInstance);
+ if (isSerializable(nodeInstance)) {
+ this.serializableNodeInstances.add(nodeInstance);
+ }
}
@Override
public void removeNodeInstance(final NodeInstance nodeInstance) {
this.nodeInstances.remove(nodeInstance);
+ this.serializableNodeInstances.remove(nodeInstance);
}
@Override
public Collection<org.kie.api.runtime.process.NodeInstance>
getNodeInstances() {
- return new ArrayList<>(getNodeInstances(false));
+ return Collections.unmodifiableCollection(nodeInstances);
+ }
+
+ @Override
+ public Collection<org.kie.api.runtime.process.NodeInstance>
getSerializableNodeInstances() {
+ return Collections.unmodifiableCollection(serializableNodeInstances);
Review Comment:
stream/filtering on each requests add an unneeded overhead
--
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]