gitgabrio commented on code in PR #3707:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3707#discussion_r1796801643


##########
jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/CompositeNodeInstance.java:
##########
@@ -54,13 +55,13 @@
 
 /**
  * Runtime counterpart of a composite node.
- * 
  */
 public class CompositeNodeInstance extends StateBasedNodeInstance implements 
NodeInstanceContainer, EventNodeInstanceInterface, 
EventBasedNodeInstanceInterface {
 
     private static final long serialVersionUID = 510l;
 
     private final List<NodeInstance> nodeInstances = new ArrayList<>();
+    private final List<NodeInstance> serializableNodeInstances = new 
ArrayList<>();

Review Comment:
   @elguardian 
   Scope of that list is to avoid streams/filtering during execution, that 
impact on performance



##########
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);

Review Comment:
   see above



-- 
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