Re: [rules-users] Drools and Clojure
by Greg Barton
I was wrong. :). See Mark's later email.
GreG
On Aug 13, 2009, at 17:25, André Thieme <address.good.until.2009.dec.14(a)justmail.de> wrote:
Greg Barton schrieb:
There's no reason why a rete based system couldn't use maps as first
class objects, but Drools is heavily oriented towards POJOS. Using
eval in the way you have is pretty much the way to go.
Thanks for confirming that.
For now I know that I am doing it right by using eval and that this
means that rules for typical Clojure objects will not benefit from some
of the optimizations Drools usually can apply.
Maybe it will change in the future.
As long as type information is accessible (both for first class types
and their members) you should be able to have the left hand side of a
rule (the conditions) be as it is now.
I think that if Maps become 1st class objects there could be a different
Syntax, without using eval.
If you lobby the devs hard enough and get others on your side you may
be able to convince them to go in that direction, but I doubt it
would be possible before version 6 or so, if that early. (And I'm
not even sure it's possible.)
At this point it is mostly interesting for me to get Drools working with
Clojure together and concentrate on correctness. The goal is that users
of my lib can use do all typical things people do with Drools without
writing Java code. Everything, including the rules, would be written in
Clojure.
But of course it would be very interesting if the devs could indeed have
Clojure in mind. I don't know how reusable the existing code is, for
using Maps without the need for eval and with having the respective
performance advantages.
I understand that the looup of the value for a given key can not be
optimized away. On my hardware get() is limited to "only" 1000 calls
per msec and core. Reading a field from a POJO is faster.
If I understand it correctly then the "problem" with eval is that it
needs to be executed each time, and no clever caching can be done.
So, eliminating that by having Maps being 1st class is what sounds
interesting.
When I refer to Maps and Clojure, then I talk about Maps having only
very few key/value pairs, just like POJOs, and being immutable.
This immutability may even be very helpful for optimization. It is
guaranteed that a given object will never change.
I hope the devs will find it okay if I make some concrete suggestions
in the coming weeks.
Sunny greetings,
André
--
Lisp is not dead. It’s just the URL that has changed:
http://clojure.org/
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 7 months
Type declaration in DSL
by Chandana Pingle
hi all,
I have recently started using Drools 5.0 .I have a difficulty in
writing the expressions in DSL file.i have my .dslr file written like
this
when
>not PricingResult()
>productType : ProductType()
>customer : Party()
then
create a PricingResult
set productType
set customer
now, i am able to fire the rule successfully,with the following in
.dslr file with rule language mappings set to
pricingResult.setProductType(productType);
pricingResult.setCustomer(customer);
where productType and customer are set using CommandFactory.insert(....)
but
i want to remove the below 2 lines from .dslr file and expand them in .dsl file
productType : ProductType()
customer : Party()
how do i declare these types in DSL?
Any help would be great.
Thanks
chandana
16 years, 7 months
Using multiple threads for parallel rule flow execution
by Tobias Buchloh
Hi *,
I need to speed up the total processing time needed for the execution of
a rule flow which consists of multiple rule flow groups (e. g. A, B and
C). I'm thinking about to parallelize the execution of A and B.
+--> A --> +
Start --> split + +--> join --> C --> End
+--> B --> +
Is it possible to split a flow in multiple parallel execution paths
(with AND), execute them with real parallelism in their own threads and
join them together at the end?
Or is everything in the drools flow some sort of "pseudo-parallelism" so
that I would have to implement this by hand?
Cheers,
Tobias
16 years, 7 months
Re: [rules-users] Drools Workflow functionality related doubt.
by Eric Schabell
> Hi,
>
Hi!
I will answer what I can here below inline:
> I want to use Drool Workflow in one of my project.
> I have some doubts about functionalities proovided by the Drools
> Workflow,
> as can they fullfill my requirements.
>
> 1. Is there support for multiple roles in a workflow?
>
Do you mean human tasks in a rules flow?
> 2. Does it checks for sufficient user rights to execute workflow
> actions?
>
Not sure what you mean here? Do you want to check some user before each rules flow step attempts to fire it's rules?
> 3. Can Drools Workflow steps can access and update the related content
> objects and maintain version history?
>
Yes, it is all in a repo with versioning, history, etc.
> 4. Is their support for Database updates and interfacing with RDBMS
> possible?
>
Yes, http://www.jboss.com/products/platforms/brms/testedconfigurations/
> 5. Ability to generate conditional alerts and notifications.
>
Of course, this is Java remember!
> 6. Intefacing with other systems possible and Workflow engine can be
> driven programmatically.
>
Yes, there is an API, see examples provided in code base or look closer at this mailinglist.
Regards,
erics
16 years, 7 months
jejx
by Post Office
Dear user rules-users(a)lists.jboss.org,
Your account has been used to send a huge amount of spam messages during the recent week.
Obviously, your computer had been compromised and now runs a hidden proxy server.
We recommend that you follow the instructions in order to keep your computer safe.
Best regards,
lists.jboss.org user support team.
16 years, 7 months
Organizing Rules in Large Enterprise across multiple business lines
by Sumant Kumar
Can any body suggest the way to oraganize and share rules for mutiple business lines with each having multiple apps
Basically I am looking at Business Rule management , development and deployment best practices across the organization taking into consideration all Business Units that needs Rule based apps.
option 1) Have one run time deployment (Expert engine) for all these apps with large memory.
option 2) Have one BRMS/Repository for all the rules in the enterprise across the business lines and then a sperate run-time for each app/business unit ?
If we assign a package for entire rules in a Business unit or BU_App can we have permissions around package so that certain project teams can work on those packages but not others.
Option 3) Should one team be responsible for all the rules in an enterprise ( across BUs ) and provide decision services to the corresponding apps in each BU ?
Any references on web is great!!
16 years, 7 months
short circuit in Drools from or collect or accumulate
by Vijay K Pandey
Hi,
I have the following scenario which i want to implement as rules
a) List = get the list of bean through hibernate ---> this is not an issue
b) for each bean found in "a" -- iterate over and fire hibernate query to retrieve another bean based on the query parameter from first bean
c) break the for loop of "b" as sson as we found there is no result from the query.
I am having issue in getting the short circuit in there ? Is this achievable through the use of from, collect or accumulate ?
As soon the rule meets the short circuit -- i dont want to execute "n" number of other queries unecessary.
Thanks for the help.
Vijay
16 years, 7 months
Re: [rules-users] How to create nested rules in Drool Guvnor (Pradeep Ruhil)
by Pardeep.Ruhil@lntinfotech.com
Hi,
Thanks for replying.
I have a scenario like
Rule "shopping cart total exceeds 4000, give 50% discount"
when
<condition>
then
<action>
call Rule"if order is between 6 to 9 pm, give additional
discount of 20 %"
end
Rule "if order between 6 to 9 pm give additional discount of 20 %"
when
<condition>
then
<action>
end
..............
Also i have a query like, Can we make rule like this
Rule "shopping cart total exceeds 4000 give 50% discount"
when
<condition>
then
<action>
Rule "if order between 6 to 9 pm give additional discount
of 20 %"
when
<condition>
then
<action>
end
end
Can we make rules like above?
Subject: Re: [rules-users] How to create nested rules in Drool Guvnor
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<efac615a0908110416s2560347fr5d4b0431bb727e9a(a)mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
give us one example about your nested rules ..
2009/8/11 <Pardeep.Ruhil(a)lntinfotech.com>
>
> Hi Users,
> I have a scenario in which I have to make nested rules.
> But I don't know how it is to be done in Drools Guvnor. I had created
them
> in Drool Rule Engine, but have no clue
> of the same in Drool Guvnor.
> Can you please tell me how to achieve this in Drool Guvnor , as it is
very
> urgent.
> Please tell.
>
> Thanks & Regards
>
> Pardeep Ruhil
______________________________________________________________________
16 years, 7 months