That's because you are evaluating a Process Variable as a fact.. and it's not a fact. You cannot do:
Here is my object:
package com.rrd.xspace.drools;
import java.io.Serializable;
public class FooInstance implements Serializable
{
/**
*
*/
private static final long serialVersionUID = 132337L;
private String action = "EDITING";
public FooInstance()
{
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
}
Here is my rf file:
<process xmlns="http://drools.org/drools-5.0/process"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
xs:schemaLocation="http://drools.org/drools-5.0/process
drools-processes-5.0.xsd"
type="RuleFlow" name="Studio Sample Listener Flow"
id="StudioSampleListener" package-name="com.rrd.xspace.drools" >
<header>
<variables>
<variable name="Instance" >
<type
name="org.drools.process.core.datatype.impl.type.ObjectDataType"
className="com.rrd.xspace.drools.FooInstance" />
</variable>
</variables>
</header>
<nodes>
<start id="1" name="Start" x="81" y="36" width="48" height="48" />
<end id="2" name="End" x="81" y="291" width="48" height="48" />
<ruleSet id="5" name="Validate" x="65" y="122" width="80" height="48"
ruleFlowGroup="StudioSampleListenerValidate" />
</nodes>
<connections>
<connection from="5" to="2" />
<connection from="1" to="5" />
</connections>
</process>
Here is my drl file:
package com.rrd.xspace.drools
import com.rrd.xspace.drools.*;
import com.rrd.xspace.data.levels.XMetaDataValue;
import org.drools.runtime.process.ProcessInstance
import org.drools.runtime.process.WorkflowProcessInstance
rule "Test"
ruleflow-group "StudioSampleListenerValidate"
when
then
System.out.println("GOT HERE FIRST");
end
rule "StudioSampleListener"
ruleflow-group "StudioSampleListenerValidate"
agenda-group "MAIN"
when
processInstance : WorkflowProcessInstance()
then
System.out.println("GOT HERE");
end
rule "StudioSampleListener Validate"
ruleflow-group "StudioSampleListenerValidate"
agenda-group "MAIN"
when
i : FooInstance(action == 'EDITING')
then
System.out.println("GOT HERE LAST");
end
When I runt this stuff, the Test rule and the StudioSampleListener rule will
fire. If I move Test, then nothing fires. The "StudioSampleListener
Validate" has never fired. I have a break point on the getAction method of
FooInstance and it is never called.
Bob
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Drools-Flow-process-question-tp1589567p1590453.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users