Multithreading Rulebase Parsing Threadsafe
by Barry K
We have an application with 2 rules engines and we load the rules on startup.
Is creation of a rulebase threadsafe?
Can I load both rulebases using the code below concurrently in 4.07 ?
I encountered issues multithreading this in 4.01 but in prototyping for our
4.07 upgrade I have not encountered the same issues.
PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);
builder.addPackageFromDrl( new StringReader(ruleset) );
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Thanks
Barry
--
View this message in context: http://www.nabble.com/Multithreading-Rulebase-Parsing-Threadsafe-tp172399...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
Re: Java vs mvel dialects
by Krishna Satya
>
> Edson, Thanks so much for the reply. It makes perfect sense to me. I
> really appreciate it.
- Krishna
> Krishna,
>
> The dialect configuration affects only semantic code blocks. I.e.,
> consequences, eval() blocks, etc.
> They are designed to be interchangeable. That is why the examples have
> rules using each of the dialects.
>
> It is mostly a matter of taste, but MVEL is a script language and as so
> has syntax sugar for nested object access, collections, maps, arrays etc...
> nothing more than that. Also, MVEL supports java syntax anyway. For
> instance, assuming you have a class:
>
> Person {
> Map<String, Address> addresses;
> // gets/sets
> }
>
> The following consequence should run just fine, both in java and MVEL:
>
> then
> $person.getAddresses().get("home").setStreetName("my street");
> end
>
> Although, MVEL allows you to use a cleaner syntax:
>
> then
> $person.addresses["home"].streetName = "my street";
> end
>
> It is mostly a matter of taste.
>
> []s
> Edson
>
> 2008/5/14 Krishna Satya <krishna.ksatya(a)gmail.com>:
>
> > Hi, I am trying to understand the difference in how drl rules are
> expressed
> > via the java or mvel dialects. Looking at the drools-examples it is not
> > exactly clear. I was looking at the PetStore.drl which seems to specify
> the
> > dialects for various rules using both java and mvel. Are there any
> > references to examples which showcase a rule that is expressed both
> through
> > java and mvel dialects so it is clear what the differences are. The
> rules
> > in the PetStore.drl which specify java or mvel syntactically seem to look
> > the same.
> >
> > Also, are there any general suggestions as to when a rule author should
> use
> > the java or the mvel dialect.
> >
> > Thanks.
> > - K
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of Red Hat @ www.jboss.com
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/rules-users/attachments/20080514/57a78c7...
>
>
16 years, 7 months
Writing a business-Rule (Promod George)
by pramod george
Hi.
I'm new to Drools and also to this group.
Can anyone give me some pointers on how
to write a business rule in a drl language?
Ie:- any pdf or link that talks about
(in depth) analysing a business scenario
and then converting it into a drl format?
Thank you.
-Promod
16 years, 7 months
Questions on building from source of 4.0.7
by Brett M. Bergquist
What is the correct way to get the source for the 4.0.7 release. I
followed the directions in the documentation and used the SVN repository:
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/
but is there some release tag that I should be using to ensure that the source that I retrieve matches the 4.0.7 bin release?
A second question, when I build from this source, I get 3 tests failing. I can build with a "-Dmaven.skip.test" but should there be tests failing?
16 years, 7 months
Compilation failed on BRMS with multi-consequence DSL phrase
by Benjamin J McMillan
Hello all,
I have a single DSL phrase that performs 2 actions, delimited by a
semicolon. This compiles and works fine under Eclipse. However, when I
uploaded the same DSL to the BRMS and rewrote the same rule that uses
this phrase, rule validation failed:
Unable to build expression for 'consequence': Failed to compile: 1
compilation error(s) ' modify(svc) { addBenefit( [...] ) }; insert(new
Decision( [...] )); '
( "[ ... ]" is sanitized for our protection )
The DSL phrase:
[consequence][]Do {p1} to {p2};=modify(svc) { addBenefit("{p1}") };
insert(new Decision(c, "{p2}"));
Note that in our DSL the RHS of the phrase does not include a line
break.
Is this a bug? Or are we just doing something wrong? Or can't the BRMS
handle this (again, Eclipse can)?
Any help is greatly appreciated.
Cheers,
Ben
16 years, 7 months
Java vs mvel dialects
by Krishna Satya
Hi, I am trying to understand the difference in how drl rules are expressed
via the java or mvel dialects. Looking at the drools-examples it is not
exactly clear. I was looking at the PetStore.drl which seems to specify the
dialects for various rules using both java and mvel. Are there any
references to examples which showcase a rule that is expressed both through
java and mvel dialects so it is clear what the differences are. The rules
in the PetStore.drl which specify java or mvel syntactically seem to look
the same.
Also, are there any general suggestions as to when a rule author should use
the java or the mvel dialect.
Thanks.
- K
16 years, 7 months
Salience not working
by sridhar123
rule A
Salience 10
when
$data : MyFact( $anotherObj )
then
$anotherObj.setDiscard(true)
rule B
Salience 5
when
eval ($anotherObj.isDiscard() == true)
then
...
I am trying to get Rule A executed before Rule B. So when condition in Rule
B is valid. However i dont see "Saliene" has any effect. How else i can do
the above?
thank you
--
View this message in context: http://www.nabble.com/Salience-not-working-tp17190028p17190028.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
Question on "or" rule syntax
by Brett M. Bergquist
If I use this syntax for an "or" with binding:
pensioner : (or Person( sex == "f", age > 60 )
Person( sex == "m", age > 65 ) )
I get a compile error. Is this syntax supported?
I can successfully use this syntax:
(or pensioner : Person( sex == "f", age > 60 )
pensioner : Person( sex == "m", age > 65 ) )
which works okay but I was wondering if the documentation or implementation is incorrect.
16 years, 7 months