gabriel-farache commented on code in PR #3895:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3895#discussion_r2046813558


##########
jbpm/process-serialization-protobuf/src/main/java/org/jbpm/flow/serialization/impl/ProtobufProcessInstanceWriter.java:
##########
@@ -164,6 +161,21 @@ public void 
writeProcessInstance(WorkflowProcessInstanceImpl workFlow, OutputStr
         }
     }
 
+    private Stream<Entry<String, List<String>>> 
getHeadersStream(WorkflowProcessInstanceImpl workFlow, HeadersPersistentConfig 
headersConfig) {
+        Stream<Entry<String, List<String>>> stream = 
workFlow.getHeaders().entrySet().stream();
+        if (headersConfig.excluded() != null && 
!headersConfig.excluded().isEmpty()) {
+            stream = stream.filter(e -> {
+                if (headersConfig.excluded().contains(e.getKey())) {
+                    LOGGER.info("Excluding header {} from process instance {} 
from persistence", e.getKey(), workFlow.getId());
+                    return false;
+                }
+                LOGGER.info("Adding header {} from process instance {} for 
persistence", e.getKey(), workFlow.getId());
+                return true;
+             });
+        }
+        return stream;
+    }

Review Comment:
   just to understand: it's your coding practice to not limit the size of the 
methods? I tend to try to limit it to 40 and to extract sub-method as much as I 
can, hence this new method.
   I am fine not doing it though, as long as it matches your practices :)



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