[
https://issues.jboss.org/browse/JBRULES-3487?page=com.atlassian.jira.plug...
]
James Nord commented on JBRULES-3487:
-------------------------------------
I have traced the underlying trigger for this back to the following xml in the .rf
(a split that had only one exit path that also included a condition)
{code}
<split id="59" name="Gateway" x="427"
y="781" width="49" height="49" type="2" >
<constraints>
<constraint toNodeId="60" toType="DROOLS_DEFAULT"
name="exception" priority="1" type="code"
dialect="java" >return exception != null;</constraint>
</constraints>
</split>
{code}
NullPointerException in
org.jbpm.ruleflow.core.validation.RuleFlowProcessValidator
----------------------------------------------------------------------------------
Key: JBRULES-3487
URL:
https://issues.jboss.org/browse/JBRULES-3487
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core (flow)
Affects Versions: 5.4.0.CR1
Reporter: James Nord
Assignee: Mark Proctor
There is a coding issue in that leads to a NullPOinterException.
The Exception has been shown presumable due to an invalid rf file - but the code gives an
unhelpful exception.
Insepction of the code reveals that if the first condition is true on line 193 then the
code will blow up - which is presumable not what the coder has intended
{code:title=RuleFlowProcessValidator.java Line 190 onwars|borderStyle=solid}
if (split.getType() == Split.TYPE_XOR || split.getType() == Split.TYPE_OR
) {
for ( final Iterator<Connection> it =
split.getDefaultOutgoingConnections().iterator(); it.hasNext(); ) {
final Connection connection = it.next();
if (split.getConstraint(connection) == null &&
!split.getConstraint(connection).isDefault() &&
(split.getConstraint(connection).getConstraint() == null ||
split.getConstraint(connection).getConstraint().trim().length() == 0)) {
errors.add(new ProcessValidationErrorImpl(process,
"Split node '" + node.getName() +
"' [" + node.getId() + "] does not have a constraint for " +
connection.toString() + "."));
}
}
}
{code}
"if (split.getConstraint(connection) == null &&
!split.getConstraint(connection).isDefault()"
if "split.gerConstraint(connection)" is null then
"split.getConstraint(connection).isDefault()" will dereference null.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira