fjtirado commented on code in PR #3895:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3895#discussion_r2052242612
##########
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:
we do not have a strict policy. In this case, I prefer to have the whole
marshall in one method since the original logic were three lines. With the
addition of the four additional lines to debug the headers, it might be moved
to a private method, but its not mandatory.
When I mention that this was not needed, I do not refer to the additional
method, but to the debug within the filter
--
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]