pefernan commented on code in PR #4303:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/4303#discussion_r3333235429


##########
api/kogito-api/src/main/java/org/kie/kogito/internal/process/workitem/WorkItemRecordParameters.java:
##########
@@ -76,7 +77,29 @@ private static boolean 
shouldRecordParameters(KogitoNodeInstance nodeInstance) {
     }
 
     private static boolean shouldRecordParameters(Node node) {
-        return node != null && 
shouldRecordParameters(node.getMetaData().getOrDefault(RECORD_ARGS, false));
+        if (node == null) {
+            return false;
+        }
+
+        // Check node-level metadata (highest priority)
+        Object nodeValue = node.getMetaData().get(RECORD_ARGS);
+        if (nodeValue != null) {
+            return shouldRecordParameters(nodeValue);
+        }
+
+        // Check process-level metadata
+        if (node instanceof KogitoNode kogitoNode && 
kogitoNode.getParentContainer() != null) {

Review Comment:
   @josedee maybe here we could also check if the `NodeContainer` is 
`CompositeContextNode` (eg the container is an embedded subprocess) and we can 
get the Process from there.



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