<p><font size=2 face="sans-serif">I have a requirement for a simple rule
flow containing a &quot;status&quot; process variable; a work item sets
the value of this variable via its Result Mapping. Following the work item
is an XOR Split node, which can go to one of two following nodes, depending
on the value of the status process variable. The relevant sections from
the rule flow definition, as currently written, are as follows:</font>
<br>
<br><font size=2 face="Courier">&nbsp; &lt;header&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;variables&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;variable name=&quot;status&quot;
&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; &lt;type name=&quot;org.drools.process.core.datatype.impl.type.StringDataType&quot;
/&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;/variable&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; ...</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;/variables&gt;</font>
<br><font size=2 face="Courier">&nbsp; &lt;/header&gt;</font>
<br>
<br><font size=2 face="Courier">&nbsp; &lt;nodes&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; ...</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;workItem id=&quot;4&quot;
name=&quot;Test work item&quot; x=&quot;352&quot; y=&quot;52&quot; width=&quot;80&quot;
height=&quot;40&quot; &gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;work name=&quot;TestItem&quot;
&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;/work&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;mapping type=&quot;out&quot;
from=&quot;status&quot; to=&quot;status&quot; /&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;/workItem&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; ...</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;split id=&quot;9&quot;
name=&quot;Split&quot; x=&quot;464&quot; y=&quot;52&quot; width=&quot;80&quot;
height=&quot;40&quot; type=&quot;2&quot; &gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;constraints&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; &lt;constraint
toNodeId=&quot;10&quot; toType=&quot;DROOLS_DEFAULT&quot; name=&quot;error&quot;
priority=&quot;1&quot; type=&quot;code&quot; dialect=&quot;java&quot; &gt;status.equals(&quot;error&quot;)&lt;/constraint&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &nbsp; &lt;constraint
toNodeId=&quot;8&quot; toType=&quot;DROOLS_DEFAULT&quot; name=&quot;success&quot;
priority=&quot;1&quot; type=&quot;code&quot; dialect=&quot;java&quot; &gt;status.equals(&quot;success&quot;)&lt;/constraint&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &nbsp; &lt;/constraints&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; &lt;/split&gt;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; ...</font>
<br><font size=2 face="Courier">&nbsp; &lt;/nodes&gt;</font>
<p><font size=2 face="sans-serif">The Java code that implements the &quot;TestItem&quot;
work item finishes with the code:</font>
<br>
<br><font size=2 face="Courier">&nbsp; &nbsp; Map&lt;String, Object&gt;
results = new HashMap&lt;String, Object&gt;();</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; results.put(&quot;status&quot;,
status); &nbsp;// Value of status can be &quot;success&quot; or &quot;error&quot;</font>
<br><font size=2 face="Courier">&nbsp; &nbsp; ksession.getWorkItemManager().completeWorkItem(stepInstance.getWorkItemId(),
results);</font>
<p><font size=2 face="sans-serif">When I execute this process, no matter
what the value of the status result returned by the work item, the node
with ID 8 (the 'success' path) always executes.</font>
<p><font size=2 face="sans-serif">I hope it's clear what I'm trying to
do (i.e. define a process variable, sets its value using the result from
a work item, and then test its value in a Split node); can anyone help
me out as to why it's not working? (Incidentally, this is Drools v5.1M1.)</font>
<p><font size=2 face="sans-serif">Many thanks,</font>
<p><font size=2 face="sans-serif">Alan</font>