Question about the Nature of Ruleflows
by BenjaminWolfe
I'm trying to wrap my mind around the nature of ruleflows -- and I think this
question sums up a bit of my confusion.
I have a stateful knowledge session. The stateful knowledge session has a
ruleflow associated with it. That ruleflow diverges into two branches --
branch A and branch B -- based on a rule constraint. It's an XOR, and the
mvel rule constraints are something like this:
to branch A
$u : User( $i : userId )
exists ( Dog( owner == $i, hasDogTag == false) )
to branch B
$u : User( $i : userId )
not ( Dog( owner == $i, hasDogTag == false) )
Then the two branches converge again. I insert two facts: user 1, whose
dogs all have dog tags, and user 2 whose third dog is missing a tag. Then,
after I insert both facts, I fire all rules.
Should the flow be like this?
user 1: start --> diverge --> branch A (tell him to buy dog tags) -->
converge --> end
user 2: start --> diverge --> branch B (leave him alone) --> converge -->
end
Or does a ruleflow look at the whole session rather than each fact -- in
which case either both users would pass through branch A, or both would pass
through branch B?
If I want the first case to happen, is there something I'm missing in the
implementation? And are there any more details I can add to make my post
more specific? Thank you for your help.
--
View this message in context: http://drools.46999.n3.nabble.com/Question-about-the-Nature-of-Ruleflows-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Drools Upgrade to 5.4
by dxande6
I'm upgrading to Drools 5.4 from Drools 5.0.1. When I try to compile the
.drl files into a .pkg I'm getting a couple of strange errors. Hoping
someone can help.
Here is the .drl
rule "Rule 1 - Testing"
no-loop true
when
$orderInfo : OrderingInfo (orderedProducts != null)
then
Customer customer = $orderInfo.getCustomer();
ArrayList<ProductAttribute> productAttributes =
$orderInfo.getAttributes();
String localCode = getCode();
end
function String getCode (Customer customer) {
return customer.getCode();
}
I get an error when I try to compile saying the following:
Unable to resolve type ArrayList<ProductAttribute>
If I remove the line and just use ArrayList and leave off the
"<ProductAttribute>" component, it works.
Any help is appreciated.
It also cannot access the getCode() function.
I'm not sure why that is the case.
Finally, I can get all of these things to work when I run the rules using
the .DRL files. Typically we compile them into packages prior to
deployment.
Thank you again in advance for any/all of your help.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Upgrade-to-5-4-tp4019321.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
modify and update is not working in the rule file
by Rana
Please let me know what is the problem in this. It does not update the values
when I get the values, it gives me null in my unit test method.
rule "Drug Strength" extends "Provider State"
no-loop true
dialect "mvel"
agenda-group "AndroGel"
when
Drug( $drug.getStrength == "20.25 mg/1.25 gram (1.62 %)" )
$p : Program()
then
#drools.getWorkingMemory().setGlobal("boolDrugStrength", true )
modify( $p) {
setProgramId( "610.contentId(a)samplemd.com" ),
setProgramName( "AndroGel 1.62% Savings Card" )
};
update( $p )
#retract( $p )
#retract( $drug )
log.info("Prgram ID and Program Name is set for program Coupon for
Androgel");
#drools.halt();
end
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/modify-and-update-is-not-working-in-the...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Drools 5.4 and Java Generics
by dxande6
I’m receiving errors when compiling my .drl files as a result of using Java
generics.
Example:
rule "Rule 1 - Testing"
no-loop true
when
$orderInfo : OrderingInfo (orderedProducts != null)
then
Customer customer = $orderInfo.getCustomer();
ArrayList<ProductAttribute> productAttributes =
$orderInfo.getAttributes();
String localCode = getCode(customer);
end
It complains that ArrayList<ProductAttribute> cannot be resolved … actual
error is below:
RuleBaseTask failed: Unable to resolve type ArrayList<ProductAttribute>:
Unable to find class 'ArrayList<ProductAttribute>' : [Rule name='Rule 1
- Testing']
Is there a resolution to this problem?
Thank you in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-5-4-and-Java-Generics-tp4019327....
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Integrate Guvnor with Weblogic server user authentication
by jasonxzhong
Has anyone been able to configure Guvnor so it can use Weblogic user
authentication? Our goal is to allow users created and managed in Weblogic
security realm being able to log in to Guvnor after being autheticated by
Weblogic.
There is an article that describes how to enable authentication using JAAS
for weblogic but when we tried to follow the instructions it did not work.
Basically jaas.config file is not being picked up.
I'd appreciate it if someone who has done similar work can post the
components.xml and some instructions.
Thanks in advance,
Jason
-----
Jason
--
View this message in context: http://drools.46999.n3.nabble.com/Integrate-Guvnor-with-Weblogic-server-u...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Rules Deployment
by RulesUsers
Hi all,
We are using rules in our java based project that connects to jboss for jms.
To implement rules, we include drools specific jar files in the code itself.
When this code is executed, rules also get executed and our purpose is
served.
Rules file is written manually and is called from within the java code.
Going forward, we want to deploy java application together with rules on
jboss.
I want to know the standard way of doing it ?
Please provide pointers on this.
Regards
Samya Maiti
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-Deployment-tp4019302.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years