domhanak commented on code in PR #3582:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3582#discussion_r1682292031
##########
jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/RuleFlowProcessFactory.java:
##########
@@ -420,20 +420,28 @@ protected DroolsAction timerAction(String type) {
}
protected Node findNodeByIdOrUniqueIdInMetadata(NodeContainer
nodeContainer, final String nodeRef, String errorMsg) {
- Node node = null;
- // try looking for a node with same "UniqueId" (in metadata)
- for (Node containerNode : nodeContainer.getNodes()) {
- if (nodeRef.equals(containerNode.getUniqueId())) {
- node = containerNode;
- break;
- }
- }
+ Node node = findNodeByUniqueId(nodeContainer, nodeRef);
if (node == null) {
throw new IllegalArgumentException(errorMsg);
}
return node;
}
+ private Node findNodeByUniqueId(NodeContainer nodeContainer, final String
nodeRef) {
+ for (Node containedNode : nodeContainer.getNodes()) {
+ if (nodeRef.equals(containedNode.getUniqueId())) {
+ return containedNode;
+ }
+ if (containedNode instanceof NodeContainer) {
Review Comment:
@fjtirado Could you please give me a bit of detail of this change here? Why
is the extra `instanceof` check here? Looking to understand this better.
--
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]