Seam, JBPM and Drools
mas_dayana Nov 27, 2009 9:45 PMHi, can anyone help me?
This is my scenario. I am using seam 2.1.2. I create a process in my project, in the first node, the process will call some data from the dB, pass the data to the second node. In the second node, i want to evaluate the data using Drools. This is a part of my processDefinition.xml;
....
<node name="Collect Data">
<event type="node-enter">
<action expression="#{collectData.collect}"/>
</event>
<transition to="Evaluate Data"></transition>
</node>
<node name="Evaluate Data">
<event type="node-enter">
<action expression="#{evaluateData.evaluatStatus}"/>
</event>
<transition to="Send Email"></transition>
</node>
.....
I'm having trouble in the EvaluateData, in this seam component, i want to inject the workingMemory like the code below;
@Name("evaluateData")
public class EvaluateData {
@In WorkingMemory evaluationRulesWorkingMemory;
@In Status status;
@In Result result;
public void evaluateStatus() throws FactException
{
policyPricingWorkingMemory.insert(status);
policyPricingWorkingMemory.fireAllRules();
}
....
The error is at the @In WorkingMemory..where it will create a null value, and will create error in the JBPM context. The error will also occur if i define the workingmemory directly in processDefinition. I do not have problem injecting the data that i pass from the previous node. And the output from the .drl file is a just strings.
This is my Drools part in the component.xml;
...
<component name="evaluationRule"
class="org.jboss.seam.drools.RuleBase">
<property name="ruleFiles">evaluation.drl</property>
</component>
<component name="evaluationRulesWorkingMemory"
class="org.jboss.seam.drools.ManagedWorkingMemory" auto-create="true">
<property name="ruleBase">"#{evaluationRules}"</property>
</component>
.........
Another question is, where should i put my .drl file? Currently, i put it in the EAR folder.
Thank you for your time.||||
This is my scenario. I am using seam 2.1.2. I create a process in my project, in the first node, the process will call some data from the dB, pass the data to the second node. In the second node, i want to evaluate the data using Drools. This is a part of my processDefinition.xml;
....
<node name="Collect Data">
<event type="node-enter">
<action expression="#{collectData.collect}"/>
</event>
<transition to="Evaluate Data"></transition>
</node>
<node name="Evaluate Data">
<event type="node-enter">
<action expression="#{evaluateData.evaluatStatus}"/>
</event>
<transition to="Send Email"></transition>
</node>
.....
I'm having trouble in the EvaluateData, in this seam component, i want to inject the workingMemory like the code below;
@Name("evaluateData")
public class EvaluateData {
@In WorkingMemory evaluationRulesWorkingMemory;
@In Status status;
@In Result result;
public void evaluateStatus() throws FactException
{
policyPricingWorkingMemory.insert(status);
policyPricingWorkingMemory.fireAllRules();
}
....
The error is at the @In WorkingMemory..where it will create a null value, and will create error in the JBPM context. The error will also occur if i define the workingmemory directly in processDefinition. I do not have problem injecting the data that i pass from the previous node. And the output from the .drl file is a just strings.
This is my Drools part in the component.xml;
...
<component name="evaluationRule"
class="org.jboss.seam.drools.RuleBase">
<property name="ruleFiles">evaluation.drl</property>
</component>
<component name="evaluationRulesWorkingMemory"
class="org.jboss.seam.drools.ManagedWorkingMemory" auto-create="true">
<property name="ruleBase">"#{evaluationRules}"</property>
</component>
.........
Another question is, where should i put my .drl file? Currently, i put it in the EAR folder.
Thank you for your time.||||