How to setup Foreach node?
by Cristiano Gavião
Hi, I would like to know how can I setup a ForEach composite.
I setup two variables on accountProcess.rf properties (main flow
diagram). One is the Account class, and other is a
java.util.Collection<Account>.
I fill the variable and collection expression on the ForEach node
with those variables. But Im still getting these errors:
ForEach node 'Every Account' [8] has no collection expression.
ForEach node 'Every Account' [8] has no variable name.
Im missing something or I did something wrong?
ah, I almost forget.... When I have a ForEach node on a flows diagram,
the layout isn't saved. I mean, if I close the diagram and open It
again, the ForEach node will be on a different place.
thanks in advance
_________________________
Cristiano V. Gavião
"Tudo vale a pena se a alma não é pequena..." Fernando Pessoa
15 years, 10 months
RuleFlow question
by Steven Williams
Hi guys,
I am playing with the OrderExample in drools-examples and was wondering how
I get access in my rules to the parameters that are sent to startProcess?
e.g.
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("order", order);
parameters.put("orderId", order.getOrderId());
parameters.put("email", emailTextField.getText());
ProcessInstance processInstance =
ksession.startProcess("org.drools.examples.process.ruleset.RuleSetExample",
parameters);
I have access to the ProcessInstance but there doesn't seem to be any clear
path to the parameters.
thanks
Steve
15 years, 10 months
Globals
by Femke De Backere
Hi!
I'm trying to set a global for my ruleflow in Drools 5 M5.
Patient patient = new Patient();
ksession.setGlobal("patient", patient);
But I always get the following error:
"Could not find variable scope for variable patient when trying to
execute Work Item Human Task
Continuing without setting parameter."
Does anyone know what I'm doing wrong?
Thx!
Femke
15 years, 10 months
How can i achieve below in Guvnor or Drools
by Ashish Soni
Hi All ,
I am not sure if below structure is supported in Drools 5 or Guvnor or is
there is any way we can achieve this -
We want to create packages structure like below under the packages panel ,
as of now every package comes under the packages tab but how can we have a
multiple package root element with different names -
As per the below there are parent default rules and function which may or
may not be applicable to states ( child's ) and then each child also have
their own rules and functions
Countries
USA
- Default Rules
- Default functions
- MA
- Rules
- Functions
--
--
-Arizona
- Rules
- Functions
-NY
- Rules
- Functions
United Kingdom
- Default Rules
- Default functions
- State 1
- Rules
- Functions
--
--
-State 2
- Rules
- Functions
-State 3
- Rules
- Functions
Please suggest.
Regards,
Ashish Soni
15 years, 10 months
Need Help
by yash kapoor
Hi All, I want to execute the example PricingRuleDTExample.java
contains in drools-examples-drl-4.0.x
This file read the the ExamplePolicyPricing.xls file ,when I am running it
gives the following error
Exception in thread "main" java.lang.RuntimeException: Script template is
null - check for missing script definition.
at org.drools.decisiontable.model.SnippetBuilder.build(Unknown Source)
at org.drools.decisiontable.parser.ActionType.getSnippet(Unknown Source)
at org.drools.decisiontable.parser.RuleSheetListener.createCondition(Unknown
Source)
at org.drools.decisiontable.parser.RuleSheetListener.nextRule(Unknown
Source)
at org.drools.decisiontable.parser.RuleSheetListener.processRuleCell(Unknown
Source)
at org.drools.decisiontable.parser.RuleSheetListener.newCell(Unknown Source)
at org.drools.decisiontable.parser.xls.ExcelParser.handleText(Unknown
Source)
at org.drools.decisiontable.parser.xls.ExcelParser.processRecord(Unknown
Source)
at
org.apache.poi.hssf.eventusermodel.HSSFRequest.processRecord(HSSFRequest.java:136)
at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.genericProcessEvents(HSSFEventFactory.java:170)
at
org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents(HSSFEventFactory.java:101)
at org.drools.decisiontable.parser.xls.ExcelParser.parseFile(Unknown Source)
at org.drools.decisiontable.SpreadsheetCompiler.getRuleSheetListener(Unknown
Source)
at org.drools.decisiontable.SpreadsheetCompiler.compile(Unknown Source)
at
org.drools.examples.PricingRuleDTExample.executeExample(PricingRuleDTExample.java:40)
at
org.drools.examples.PricingRuleDTExample.main(PricingRuleDTExample.java:29)
I do not know .....what is wrong in XLS file here I am attaching the code in
zip format .
Any suggestion/comment will appreciated.
Regards
Yash
15 years, 11 months
Not looping the rule when more then 1 valid match is found
by Maxim Veksler
Hello group,
Assuming I have the rule:
rule "try not to loop"
when
$a : A($code : code)
$b : B(parentCode == $code)
then
addResult($a, $b);
end
and the classes:
public class A {
int code;
}
public class B {
int parentCode;
}
I insert into the WM 4 objects :
A(code = 1), A(code = 2);
B(parentCode=1), B(parentCode = 2);
I would like that after calling fireAllRules() only 1 match will be
returned. I have no preference regarding which one, in the current situation
2 matches are returned.
Anyone could suggest a method to enforce this ?
Thank you,
Maxim.
15 years, 11 months
Failover setup with BRMS
by Michael Finger
Hey everyone,
We're looking at putting the BRMS backed by an Oracle RBDMS into
production and the issue of failover has come up.
As things will move from QA into production using export/import,
clustering so someone's
work isn't lost if a server goes down isn't a big concern.
Ideally we would just like to put a load balancer in front of the BRMS
servers, point the rule agent
at the load balancer url, and be done with it. I've been trying to find
some info on how this word.
In particular, what happens if I import a new package into BRMS server
1. When would server 2 see the new package and server them out? What
about existing packages that are updated? When would these changes
propagate?
Also, I noticed the following param in the rule agent config:
*
url
This is a space separated list of URLs to the BRMS which is
exposing the packages (see below for more details).
What is the expected behavior when you list multiple URLS?
Thanks,
Michael Finger
Overstock.com
CONFIDENTIALITY NOTICE: This message is intended only for the use and review of the individual or entity to which it is addressed and may contain information that is privileged and confidential. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message solely to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify sender immediately by telephone or return email. Thank you.
15 years, 11 months
Working with dates in rules
by David Siefert
Hi-
I'm wondering how it would be possible to compare a part of a date in the
lhs condition of a rule in a Drool. In other words, I need to compare a
date to see if it is *x* days from the current date, *n* hours from current
time, etc. Would anyone be kind enough to provide an example? I'm thinking
I may have to implement something of my own to offer that functionality?
Big thanks,
David
15 years, 11 months
A Simple Rule ( using Guided editor )
by Ashish Soni
Hi All ,
I am just trying to write a simple rule but not sure how can i write it ,
Please help me as i am new to drools and still in the learning phase .
I have a below Fact with three fields
Person
firstName
lastName
fullName
Now i want to assign fullName = firstName + lastName which i am not able to
find out how can i do that.
I am able to define the *when *part using guided editor but able to
define *then
*part , Please help
*rule "PersonRules"
dialect "mvel"
when
p : Person( firstName != "" && lastName != "" )
then*
Thanks,
Ashish
15 years, 11 months