03-08-2011 01:53 AM
rule "salarycheck"
when
(salary > 3000) && (age < 30)
then
ruleOutput = "pattern1";
end
08-22-2012 02:50 PM
FactHandle executionFact = ksession.insert(execution);
So, the following rule works fine:
import org.activiti.engine.impl.pvm.delegate.ActivityExecution;
rule "Rulez"
when
ActivityExecution(getVariable("inputVar") == "myInput")
then
System.out.println("Rulez executed");
insert("RulezExecuted");
end
And after execution, I remove the execution from the Working Memory to clean the output:
ksession.retract(executionFact);
What do you think?08-23-2012 01:10 AM
08-23-2012 03:48 PM
11-30-2012 03:35 AM
Hi,
I've noticed a couple of things that you should think about when using the business rule task:
1. The drools-api, drools-compiler, drools-core and mvel2 jar files are missing from the activiti-rest application, so you have to add those manually.
Is it possible that with drools 5.3.0 the drools-api.jar is renamed to knowledge-api-5.3.0.Final-sources.jar? Or, are these two jars not the same?
2. In the activiti-cfg.xml inside the activiti-cfg.jar in the activiti-rest application you have to include the following property:
<property name="customPostDeployers">
<list>
<bean class="org.activiti.engine.impl.rules.RulesDeployer" />
</list>
</property>
This is missing in the userguide, but needs to be in the activiti-cfg.xml file to get the rules deployed.
3. Make sure you create a valid drl file. It's important to use Javabeans as input variables and output variables.
So maybe you could create a Javabean with salary and age as attributes. The same for the result variable.
4. I saw the bpmn20.xml in your BAR file is inside the diagrams folder. It's better to have it at the root of the BAR file.
With these changes it should work. Let me know if it works for you.
Best regards,
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.