gmunozfe commented on code in PR #3459:
URL:
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3459#discussion_r1548572199
##########
jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/core/node/Split.java:
##########
@@ -86,23 +85,24 @@ public boolean isDefault(final Connection connection) {
if (this.type == TYPE_OR || this.type == TYPE_XOR) {
ConnectionRef ref = new ConnectionRef((String)
connection.getMetaData().get("UniqueId"), connection.getTo().getId(),
connection.getToType());
- Constraint constraint = this.constraints.get(ref);
+ Collection<Constraint> constraints = this.constraints.get(ref);
+ if (constraints != null) {
+ for (Constraint constraint : constraints) {
+ if (constraint != null) {
+ return constraint.isDefault();
+ }
+ }
+ }
String defaultConnection = (String) getMetaData().get("Default");
String connectionId = (String)
connection.getMetaData().get("UniqueId");
- if (constraint != null) {
- return constraint.isDefault();
- } else if (constraint == null &&
connectionId.equals(defaultConnection)) {
- return true;
- } else {
- return false;
- }
+ return connectionId.equals(defaultConnection);
}
throw new UnsupportedOperationException("Constraints are " +
"only supported with XOR or OR split types, not with: " +
getType());
}
@Override
- public Constraint getConstraint(final Connection connection) {
+ public Collection<Constraint> getConstraint(final Connection connection) {
Review Comment:
Probably `getConstraints` in plural is more appropriated here
--
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]