That's because you are evaluating a Process Variable as a fact.. and it's not a fact. You cannot do:<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">i : FooInstance(action == 'EDITING')</span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Because inside the working memory there is no FooInstance.</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">If you want to do that.. you should insert the FooInstance instead of defining it as process variable.</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">You also has the possibility to evaluate ProcessVariables in rules.. for that you should get the process variable from the WorkFlowProcessInstance.</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Greetings<br></span></font><div><br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 1:58 PM, bob.breitling <span dir="ltr"><<a href="mailto:bob.breitling@rrd.com">bob.breitling@rrd.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br>
Here is my object:<br>
<br>
package com.rrd.xspace.drools;<br>
<br>
import java.io.Serializable;<br>
<br>
public class FooInstance implements Serializable<br>
{<br>
/**<br>
*<br>
*/<br>
private static final long serialVersionUID = 132337L;<br>
<br>
private String action = "EDITING";<br>
<br>
public FooInstance()<br>
{<br>
}<br>
<br>
public String getAction() {<br>
return action;<br>
}<br>
<br>
public void setAction(String action) {<br>
this.action = action;<br>
}<br>
}<br>
<br>
<br>
Here is my rf file:<br>
<br>
<process xmlns="<a href="http://drools.org/drools-5.0/process" target="_blank">http://drools.org/drools-5.0/process</a>"<br>
xmlns:xs="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xs:schemaLocation="<a href="http://drools.org/drools-5.0/process
drools-processes-5.0.xsd" target="_blank">http://drools.org/drools-5.0/process<br>
drools-processes-5.0.xsd</a>"<br>
type="RuleFlow" name="Studio Sample Listener Flow"<br>
id="StudioSampleListener" package-name="com.rrd.xspace.drools" ><br>
<br>
<header><br>
<variables><br>
<variable name="Instance" ><br>
<type<br>
name="org.drools.process.core.datatype.impl.type.ObjectDataType"<br>
className="com.rrd.xspace.drools.FooInstance" /><br>
</variable><br>
</variables><br>
</header><br>
<br>
<nodes><br>
<start id="1" name="Start" x="81" y="36" width="48" height="48" /><br>
<end id="2" name="End" x="81" y="291" width="48" height="48" /><br>
<ruleSet id="5" name="Validate" x="65" y="122" width="80" height="48"<br>
ruleFlowGroup="StudioSampleListenerValidate" /><br>
</nodes><br>
<br>
<connections><br>
<connection from="5" to="2" /><br>
<connection from="1" to="5" /><br>
</connections><br>
<br>
</process><br>
<br>
<br>
Here is my drl file:<br>
<br>
package com.rrd.xspace.drools<br>
<br>
import com.rrd.xspace.drools.*;<br>
import com.rrd.xspace.data.levels.XMetaDataValue;<br>
<br>
import org.drools.runtime.process.ProcessInstance<br>
import org.drools.runtime.process.WorkflowProcessInstance<br>
<br>
rule "Test"<br>
ruleflow-group "StudioSampleListenerValidate"<br>
when<br>
then<br>
System.out.println("GOT HERE FIRST");<br>
end<br>
<br>
rule "StudioSampleListener"<br>
ruleflow-group "StudioSampleListenerValidate"<br>
agenda-group "MAIN"<br>
when<br>
processInstance : WorkflowProcessInstance()<br>
then<br>
System.out.println("GOT HERE");<br>
end<br>
<br>
rule "StudioSampleListener Validate"<br>
ruleflow-group "StudioSampleListenerValidate"<br>
agenda-group "MAIN"<br>
when<br>
i : FooInstance(action == 'EDITING')<br>
then<br>
System.out.println("GOT HERE LAST");<br>
end<br>
<br>
<br>
When I runt this stuff, the Test rule and the StudioSampleListener rule will<br>
fire. If I move Test, then nothing fires. The "StudioSampleListener<br>
Validate" has never fired. I have a break point on the getAction method of<br>
FooInstance and it is never called.<br>
<br>
Bob<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1590453.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1590453.html</a><br>
</font><div><div></div><div class="h5">Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> - CTO @ <a href="http://www.plugtree.com">http://www.plugtree.com</a> <br> - MyJourney @ <a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a><br>
- Co-Founder @ <a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a><br> <br> - Salatino "Salaboy" Mauricio -<br>
</div></div>