Re: [rules-users] Guvnor Asset versioning vs Package snapshot versioning

2010-09-17 Thread Ed Lo
Thanks Abdel.
I tried it, I like the idea. It will be good to have the package snapshot
versions managed in Guvnor, if you have implemented this for your project I
will be interested.

Ed

2010/9/16 Abdel Dridi 

> In my case, I have three fixed target environments (DEV, UAT and
> Production), each environment has a snapshot package in Guvnor. In the
> server side I use the Drools HTTP pull to listen to changes in the snapshot.
> I move package assets from a snapshot environment to an other only if it
> passes the target environment tests.
>
> Deployment happen when you take a snapshot "Create snapshot for
> deployment"; Guvnor gives you the option to overwrite a specific package
> snapshot - As my target environment server is configured to listen to the
> snapshot URL then it will load the updated snapshot assets.
> This approach worked better for me.
> I think using Selectors is not a bad idea but you have to update each asset
> status every time you want to create a package to deploy.
>
> Abdel
>
>
>
> I like the Guvnor package snapshot
>
> 2010/9/16 Ed Lo 
>
>> Abdel,
>>
>> Out of curiosity would you please clarify the use of Guvnor package
>> snapshot for target environment?
>> At my company we're using selectors.
>>
>> Ed
>>
>> ___
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: Early bird registration ENDS TODAY: Rules Fest 2010

2010-09-17 Thread Edson Tirelli
   Yes, basically, if you are new to Drools, you get a nice exposure to it,
and if you are experienced with Drools, bring your questions/examples/etc
and it will be the perfect opportunity to discuss them face to face with
both the development team and other users. Although this is a short bootcamp
(1 day), it is a great opportunity to drink it from the fountain as there
will surely be other people there that will be able to help you with
whatever your needs are.

See you there,
Edson

2010/9/17 Abdel Dridi 

> Thanks Mark!
> This will be my first Rules Fest - I appreciate your clarifications.
>
> Abdel
>
>  2010/9/17 Mark Proctor 
>
>  On 17/09/2010 19:07, Abdel Dridi wrote:
>>
>> Edson,
>> Would you please clarify what kind of exercise you guys are planing to do
>> for the Drools Bootcamp?
>> which level of Drools knowledge is required to attend the bootcamp?
>> Is it worth it for people who have been using Drools for some time now?
>>
>> The morning will be talks, for those that know Drools well, it will mostly
>> be what they know. The afternoon will be an open workshop, this means people
>> work through examples with us onhand to help. There are also more experience
>> people there who are already working on their own projects and just want a
>> bit of mentoring/advice/insite, and often bring their code along with them.
>> Those people will probably just code away in the morning, with one eye on
>> the talks if anything interests them they haven't seen before. The other
>> type of person are those wanting to actually hack on Drools internals adding
>> news features.
>>
>> You get the most out of the Day if you know what it is you specifically
>> want and know how to ask it. What the day isn't is 8 hours of spoon fed step
>> by step workshop tutorials that you would get on a training course.
>>
>> In the past we used virtual machine images on a USB stick, but setting
>> that up always caused a lot of problems. So this year I think we are going
>> to provide bootable usb sticks with Fedora and Drools ready to go, so people
>> can work through examples and just hack code.
>>
>> Mark
>>
>>
>> Thanks,
>> Abde
>>
>>  2010/9/17 Edson Tirelli 
>>
>>>
>>> Hey people,
>>>
>>> I am glad to see that people are registering for the bootcamp (and
>>> the conference)! Hope to meet you all there! If you've never been to Rules
>>> Fest before (this is the 3rd year it is happening), it is the only
>>> technical, no-fluff, conference in Rules Engines and related technologies
>>> that I know of.  I had a great time last 2 years and I know it will not be
>>> different this year.
>>>
>>> And for those that did not registered yet, just a reminder, the
>>> early bird discount ends today as per the e-mail bellow.
>>>
>>> Edson
>>>
>>> -- Forwarded message --
>>> From: Rules Fest Association 
>>> Date: 2010/9/17
>>> Subject: Early bird registration ENDS TODAY: Rules Fest 2010
>>> To: tire...@post.com
>>>
>>>
>>>   International Rules Fest 2010 Conference
>>>  [image: Header.jpg]
>>>  *Studied, Defined, Explained, Illustrated*:
>>> Rules & Decisioning Technologies Made Easy
>>>[image: Register Now Before September 17 
>>> deadline!]
>>>
>>>
>>>  *Conference fee*:
>>>  *$399*
>>>
>>>  *Early Bird Registration*
>>>  *$349*
>>>
>>>  *Register today and save $50!*
>>>
>>>  *Conference package deal*:
>>>
>>>- 4 nights and 3 days at the historic Dolce Hayes Mansion 
>>> Resort
>>>- A boot camp of choice
>>>- Continental breakfast and lunch each day
>>>- Discount off from the Rules Fest 2011 conference
>>>- *$999 ($225 savings)*
>>>
>>>  *Bootcamps*
>>>
>>> Rules Fest 2010 offers a number of hands-on tutorial and coding sessions
>>> known as "bootcamps." These events give all developers — from novice to
>>> advanced — a chance to learn new technologies and/or techniques while being
>>> coached by those who know them well. All bootcamps are a full day, and they
>>> run concurrently on Thursday, October 14th, the day after the main
>>> conference ends.
>>>
>>> More info on 
>>> Bootcamps...
>>>
>>>
>>>   Hi ,
>>>
>>> Dozens of the world’s top thinkers, developers , architects, engineers
>>> and programmers from industry and academia will come together on October
>>> 11-14 to present a single-track of 17 hot topics reasoning, inferencing,
>>> artificial intelligence and pattern matching  …  at the heart of many
>>> solutions to modern, complex computing problems.
>>>
>>>  The world's only technical conference devoted to the practical
>>> application of all rule-based and knowledge-based reasoning, inferencing,
>>> and decisioning technologies will feature 3 days of presentations.
>>>
>>>
>>>  *Conference 
>>> Agenda

Re: [rules-users] Drools with Spring Batch

2010-09-17 Thread smogstate

I have some problems by configurating flow, here is my spring config:


http://www.springframework.org/schema/beans";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xmlns:drools="http://drools.org/schema/drools-spring";
   xmlns:camel="http://camel.apache.org/schema/spring";
   xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://drools.org/schema/drools-spring
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-container/drools-spring/src/main/resources/org/drools/container/spring/drools-spring-1.0.0.xsd
   http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd";>
























 




If i remove my flow from the kbase, i wount find it: 

ksession.startProcess("someId") - throws notFoundException

if i remove my rules from the base, happens nothing when i call: 

ksession.fireAllRules()

if i move away all resources from agent, nothing happens when i change my
rule file.

any help is appreciated.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-with-Spring-Batch-tp1488585p1517906.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: Early bird registration ENDS TODAY: Rules Fest 2010

2010-09-17 Thread Abdel Dridi
Thanks Mark!
This will be my first Rules Fest - I appreciate your clarifications.

Abdel

2010/9/17 Mark Proctor 

>  On 17/09/2010 19:07, Abdel Dridi wrote:
>
> Edson,
> Would you please clarify what kind of exercise you guys are planing to do
> for the Drools Bootcamp?
> which level of Drools knowledge is required to attend the bootcamp?
> Is it worth it for people who have been using Drools for some time now?
>
> The morning will be talks, for those that know Drools well, it will mostly
> be what they know. The afternoon will be an open workshop, this means people
> work through examples with us onhand to help. There are also more experience
> people there who are already working on their own projects and just want a
> bit of mentoring/advice/insite, and often bring their code along with them.
> Those people will probably just code away in the morning, with one eye on
> the talks if anything interests them they haven't seen before. The other
> type of person are those wanting to actually hack on Drools internals adding
> news features.
>
> You get the most out of the Day if you know what it is you specifically
> want and know how to ask it. What the day isn't is 8 hours of spoon fed step
> by step workshop tutorials that you would get on a training course.
>
> In the past we used virtual machine images on a USB stick, but setting that
> up always caused a lot of problems. So this year I think we are going to
> provide bootable usb sticks with Fedora and Drools ready to go, so people
> can work through examples and just hack code.
>
> Mark
>
>
> Thanks,
> Abde
>
>  2010/9/17 Edson Tirelli 
>
>>
>> Hey people,
>>
>> I am glad to see that people are registering for the bootcamp (and
>> the conference)! Hope to meet you all there! If you've never been to Rules
>> Fest before (this is the 3rd year it is happening), it is the only
>> technical, no-fluff, conference in Rules Engines and related technologies
>> that I know of.  I had a great time last 2 years and I know it will not be
>> different this year.
>>
>> And for those that did not registered yet, just a reminder, the early
>> bird discount ends today as per the e-mail bellow.
>>
>> Edson
>>
>> -- Forwarded message --
>> From: Rules Fest Association 
>> Date: 2010/9/17
>> Subject: Early bird registration ENDS TODAY: Rules Fest 2010
>> To: tire...@post.com
>>
>>
>>   International Rules Fest 2010 Conference
>>  [image: Header.jpg]
>>  *Studied, Defined, Explained, Illustrated*:
>> Rules & Decisioning Technologies Made Easy
>>[image: Register Now Before September 17 
>> deadline!]
>>
>>
>>  *Conference fee*:
>>  *$399*
>>
>>  *Early Bird Registration*
>>  *$349*
>>
>>  *Register today and save $50!*
>>
>>  *Conference package deal*:
>>
>>- 4 nights and 3 days at the historic Dolce Hayes Mansion 
>> Resort
>>- A boot camp of choice
>>- Continental breakfast and lunch each day
>>- Discount off from the Rules Fest 2011 conference
>>- *$999 ($225 savings)*
>>
>>  *Bootcamps*
>>
>> Rules Fest 2010 offers a number of hands-on tutorial and coding sessions
>> known as "bootcamps." These events give all developers — from novice to
>> advanced — a chance to learn new technologies and/or techniques while being
>> coached by those who know them well. All bootcamps are a full day, and they
>> run concurrently on Thursday, October 14th, the day after the main
>> conference ends.
>>
>> More info on 
>> Bootcamps...
>>
>>
>>   Hi ,
>>
>> Dozens of the world’s top thinkers, developers , architects, engineers and
>> programmers from industry and academia will come together on October 11-14
>> to present a single-track of 17 hot topics reasoning, inferencing,
>> artificial intelligence and pattern matching  …  at the heart of many
>> solutions to modern, complex computing problems.
>>
>>  The world's only technical conference devoted to the practical
>> application of all rule-based and knowledge-based reasoning, inferencing,
>> and decisioning technologies will feature 3 days of presentations.
>>
>>
>>  *Conference 
>> Agenda
>> *
>>
>> Topic categories include:
>>
>>- Reasoning *in Action*
>>- Reasoning Methodologis & Best Practices
>>- Reasoning and Management
>>- Reasoning Trends
>>
>>  Factoid: RulesFest 2010 speakers comprise
>>
>> 7 CEOs
>>
>> 6 Ph.D.s
>>
>> 4 CTOs
>>
>> 8 Senior Developers
>> 1 Vice President
>>
>>  View 
>> abstracts
>>
>>  *Click to register and save $50
>> 
>> *
>>
>> For info:  
>> www.rulesfe

[rules-users] Guvnor 5.1: Pencil icon not clickable in BRL editor‏

2010-09-17 Thread Scott Mayne














Hi all,

I'm reading Paul 
Browne's "JBoss Drools Business Rules" and in Ch. 5 we make a BRL in the guided 
editor. We're using a simple fact model with a single class (Sales) which has 
(among others) a field "sales", type long. The book uses an earlier version of 
Guvnor so things look a little different but everything's worked so far, until 
I 
use the editor to make a rule that looks like this in "view source":

rule 
"SalesDiscount"
  dialect "mvel"
  when
    mySales : Sales( salesValue 
: sales >= "100" )
  then
    mySales.setSales( salesValue-10 );
    
update( mySales );
end

When I try it out, I get this line in the THEN 
section

"1.  Modify value of Sales [mySales] sales [pencil icon] [remove 
icon]

but neither "sales" nor the pencil icon is clickable, so I can't enter what it 
should change to. When click view source using what I could do I 
get:

rule "SalesDiscount"
  dialect "mvel"
  when
    mySales : 
Sales( salesValue : sales >= "100" )
  then
    mySales.setSales( 
);
    mySales.setWait( );
    update( mySales );
end

[I added 
the "wait" because the modify field dropdown has this as an option but it's not 
in the Java class and I'm not sure where it came from.]

Can anyone shed light on this behavior? I'm using the latest version of 
Firefox, compiling 
with GWT/building my own EAR (though I haven't done any code changes) using RAD 
7.5.5.1 (based on Eclipse 3.4), and am running Guvnor on 
WebSphere.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Fwd: Early bird registration ENDS TODAY: Rules Fest 2010

2010-09-17 Thread Mark Proctor

 On 17/09/2010 19:07, Abdel Dridi wrote:

Edson,
Would you please clarify what kind of exercise you guys are planing to 
do for the Drools Bootcamp?

which level of Drools knowledge is required to attend the bootcamp?
Is it worth it for people who have been using Drools for some time now?
The morning will be talks, for those that know Drools well, it will 
mostly be what they know. The afternoon will be an open workshop, this 
means people work through examples with us onhand to help. There are 
also more experience people there who are already working on their own 
projects and just want a bit of mentoring/advice/insite, and often bring 
their code along with them. Those people will probably just code away in 
the morning, with one eye on the talks if anything interests them they 
haven't seen before. The other type of person are those wanting to 
actually hack on Drools internals adding news features.


You get the most out of the Day if you know what it is you specifically 
want and know how to ask it. What the day isn't is 8 hours of spoon fed 
step by step workshop tutorials that you would get on a training course.


In the past we used virtual machine images on a USB stick, but setting 
that up always caused a lot of problems. So this year I think we are 
going to provide bootable usb sticks with Fedora and Drools ready to go, 
so people can work through examples and just hack code.


Mark


Thanks,
Abde

2010/9/17 Edson Tirelli mailto:tire...@post.com>>


   Hey people,

   I am glad to see that people are registering for the bootcamp
(and the conference)! Hope to meet you all there! If you've never
been to Rules Fest before (this is the 3rd year it is happening),
it is the only technical, no-fluff, conference in Rules Engines
and related technologies that I know of.  I had a great time last
2 years and I know it will not be different this year.

   And for those that did not registered yet, just a reminder, the
early bird discount ends today as per the e-mail bellow.

   Edson

-- Forwarded message --
From: *Rules Fest Association*
mailto:rules_fest_associat...@mail.vresp.com>>
Date: 2010/9/17
Subject: Early bird registration ENDS TODAY: Rules Fest 2010
To: tire...@post.com 


International Rules Fest 2010 Conference

Header.jpg
*Studied, Defined, Explained, Illustrated*:
Rules & Decisioning Technologies Made Easy

Register Now Before September 17 deadline!


*Conference fee*:
*$399*
*Early Bird Registration*
*$349*
*Register today and save $50!*
*Conference package deal*:

* 4 nights and 3 days at the historic Dolce Hayes Mansion
  Resort
  

* A boot camp of choice
* Continental breakfast and lunch each day
* Discount off from the Rules Fest 2011 conference
* *$999 ($225 savings)*

*Bootcamps*

Rules Fest 2010 offers a number of hands-on tutorial and coding
sessions known as "bootcamps." These events give all developers —
from novice to advanced — a chance to learn new technologies
and/or techniques while being coached by those who know them well.
All bootcamps are a full day, and they run concurrently on
Thursday, October 14th, the day after the main conference ends.

More info on Bootcamps...





Hi ,

Dozens of the world’s top thinkers, developers , architects,
engineers and programmers from industry and academia will come
together on October 11-14 to present a single-track of 17 hot
topics reasoning, inferencing, artificial intelligence and pattern
matching  …  at the heart of many solutions to modern, complex
computing problems.
The world's only technical conference devoted to the practical
application of all rule-based and knowledge-based reasoning,
inferencing, and decisioning technologies will feature 3 days of
presentations.
*Conference Agenda

*

Topic categories include:

* Reasoning /in Action/
* Reasoning Methodologis & Best Practices
* Reasoning and Management
* Reasoning Trends

Factoid: RulesFest 2010 speakers comprise

7 CEOs

6 Ph.D.s

4 CTOs

8 Senior Developers

1 Vice President

View abstracts


*Click to register and save $50

*

For info: www.rulesfest.org



Re: [rules-users] Fwd: Early bird registration ENDS TODAY: Rules Fest 2010

2010-09-17 Thread Abdel Dridi
Edson,
Would you please clarify what kind of exercise you guys are planing to do
for the Drools Bootcamp?
which level of Drools knowledge is required to attend the bootcamp?
Is it worth it for people who have been using Drools for some time now?

Thanks,
Abde

2010/9/17 Edson Tirelli 

>
>Hey people,
>
>I am glad to see that people are registering for the bootcamp (and the
> conference)! Hope to meet you all there! If you've never been to Rules Fest
> before (this is the 3rd year it is happening), it is the only technical,
> no-fluff, conference in Rules Engines and related technologies that I know
> of.  I had a great time last 2 years and I know it will not be different
> this year.
>
>And for those that did not registered yet, just a reminder, the early
> bird discount ends today as per the e-mail bellow.
>
>Edson
>
> -- Forwarded message --
> From: Rules Fest Association 
> Date: 2010/9/17
> Subject: Early bird registration ENDS TODAY: Rules Fest 2010
> To: tire...@post.com
>
>
>   International Rules Fest 2010 Conference
>  [image: Header.jpg]
>  *Studied, Defined, Explained, Illustrated*:
> Rules & Decisioning Technologies Made Easy
>[image: Register Now Before September 17 
> deadline!]
>
>
>  *Conference fee*:
>  *$399*
>
>  *Early Bird Registration*
>  *$349*
>
>  *Register today and save $50!*
>
>  *Conference package deal*:
>
>- 4 nights and 3 days at the historic Dolce Hayes Mansion 
> Resort
>- A boot camp of choice
>- Continental breakfast and lunch each day
>- Discount off from the Rules Fest 2011 conference
>- *$999 ($225 savings)*
>
>  *Bootcamps*
>
> Rules Fest 2010 offers a number of hands-on tutorial and coding sessions
> known as "bootcamps." These events give all developers — from novice to
> advanced — a chance to learn new technologies and/or techniques while being
> coached by those who know them well. All bootcamps are a full day, and they
> run concurrently on Thursday, October 14th, the day after the main
> conference ends.
>
> More info on 
> Bootcamps...
>
>
>   Hi ,
>
> Dozens of the world’s top thinkers, developers , architects, engineers and
> programmers from industry and academia will come together on October 11-14
> to present a single-track of 17 hot topics reasoning, inferencing,
> artificial intelligence and pattern matching  …  at the heart of many
> solutions to modern, complex computing problems.
>
>  The world's only technical conference devoted to the practical application
> of all rule-based and knowledge-based reasoning, inferencing, and
> decisioning technologies will feature 3 days of presentations.
>
>
>  *Conference 
> Agenda
> *
>
> Topic categories include:
>
>- Reasoning *in Action*
>- Reasoning Methodologis & Best Practices
>- Reasoning and Management
>- Reasoning Trends
>
>  Factoid: RulesFest 2010 speakers comprise
>
> 7 CEOs
>
> 6 Ph.D.s
>
> 4 CTOs
>
> 8 Senior Developers
> 1 Vice President
>
>  View 
> abstracts
>
>  *Click to register and save $50
> 
> *
>
> For info:  
> www.rulesfest.org
> ;
>
>  Email: i...@rulesfest.org
>
>
>   *Join the Dialog on
> Rules Fest 2010!*
>
>  [image: Rules Fest 2010 on 
> Twitter]
>
>  [image: "Like us" on 
> Facebook]
>
>  [image: Join our LinkedIn 
> Group]
>
>
>  A message from Rules Fest 2010 Vice Chairman, Charles Young of Solidsoft:
>  [image: Message from Rules Fest Vice Chairman Charles Young, 
> SolidSoft]
>
>
>  *RulesFest 2010*
>  *International Conference on Reasoning Technologies *
>
>  [image: Rules Fest 2010: International Conference on Reasoning
> Technologies]
>  serving Software
> Engineers
>  Developers
>  Architects
>  and
>  Programmers
>  Contact Information: Rules Fest Association, Inc.
> 6655 W. Sahara Avenue Suite E-102
> Las Vegas, Nevada 89146
>
>
>
> --
>   Click to view this email in a 
> browser
>
> If you no longer wish to

[rules-users] Fwd: Early bird registration ENDS TODAY: Rules Fest 2010

2010-09-17 Thread Edson Tirelli
   Hey people,

   I am glad to see that people are registering for the bootcamp (and the
conference)! Hope to meet you all there! If you've never been to Rules Fest
before (this is the 3rd year it is happening), it is the only technical,
no-fluff, conference in Rules Engines and related technologies that I know
of.  I had a great time last 2 years and I know it will not be different
this year.

   And for those that did not registered yet, just a reminder, the early
bird discount ends today as per the e-mail bellow.

   Edson

-- Forwarded message --
From: Rules Fest Association 
Date: 2010/9/17
Subject: Early bird registration ENDS TODAY: Rules Fest 2010
To: tire...@post.com


  International Rules Fest 2010 Conference
 [image: Header.jpg]
 *Studied, Defined, Explained, Illustrated*:
Rules & Decisioning Technologies Made Easy
   [image: Register Now Before September 17
deadline!]


 *Conference fee*:
 *$399*

 *Early Bird Registration*
 *$349*

 *Register today and save $50!*

 *Conference package deal*:

   - 4 nights and 3 days at the historic Dolce Hayes Mansion
Resort
   - A boot camp of choice
   - Continental breakfast and lunch each day
   - Discount off from the Rules Fest 2011 conference
   - *$999 ($225 savings)*

 *Bootcamps*

Rules Fest 2010 offers a number of hands-on tutorial and coding sessions
known as "bootcamps." These events give all developers — from novice to
advanced — a chance to learn new technologies and/or techniques while being
coached by those who know them well. All bootcamps are a full day, and they
run concurrently on Thursday, October 14th, the day after the main
conference ends.

More info on 
Bootcamps...


  Hi ,

Dozens of the world’s top thinkers, developers , architects, engineers and
programmers from industry and academia will come together on October 11-14
to present a single-track of 17 hot topics reasoning, inferencing,
artificial intelligence and pattern matching  …  at the heart of many
solutions to modern, complex computing problems.

 The world's only technical conference devoted to the practical application
of all rule-based and knowledge-based reasoning, inferencing, and
decisioning technologies will feature 3 days of presentations.


 *Conference 
Agenda
*

Topic categories include:

   - Reasoning *in Action*
   - Reasoning Methodologis & Best Practices
   - Reasoning and Management
   - Reasoning Trends

 Factoid: RulesFest 2010 speakers comprise

7 CEOs

6 Ph.D.s

4 CTOs

8 Senior Developers
1 Vice President

 View 
abstracts

 *Click to register and save $50

*

For info:  
www.rulesfest.org
;

 Email: i...@rulesfest.org


  *Join the Dialog on
Rules Fest 2010!*

 [image: Rules Fest 2010 on
Twitter]

 [image: "Like us" on
Facebook]

 [image: Join our LinkedIn
Group]


 A message from Rules Fest 2010 Vice Chairman, Charles Young of Solidsoft:
 [image: Message from Rules Fest Vice Chairman Charles Young,
SolidSoft]


 *RulesFest 2010*
 *International Conference on Reasoning Technologies *

 [image: Rules Fest 2010: International Conference on Reasoning
Technologies]
 serving Software
Engineers
 Developers
 Architects
 and
 Programmers
 Contact Information: Rules Fest Association, Inc.
6655 W. Sahara Avenue Suite E-102
Las Vegas, Nevada 89146



--
  Click to view this email in a
browser

If you no longer wish to receive these emails, please reply to this message
with "Unsubscribe" in the subject line or simply click on the following
link: Unsubscribe 
--
  Rules Fest Association, Inc.
6655 W. Sahara Avenue Suite E-102
Las Vegas, NV 89146

Read  the
VerticalResponse marketing policy.
  [image: Try Email Marketing with VerticalResponse!]




-- 
  Edson Ti

Re: [rules-users] Perfromance issues and memory leaks in Drools

2010-09-17 Thread Edson Tirelli
Nikhil,

Maybe you are using the term "memory leak" loosely here, but otherwise,
Drools 4.0.7 and Drools 5.0.1 were both tested to exhaustion for memory
leaks and I can tell you that no memory leak was found, and I personally
doubt there is one there on regular use. Also, FYI, Drools 5.x eliminates
the need for shadow facts, what is a considerable memory save over 4.x, but
adds some other overheads for performance improvement that kind of offset
those gains. On the other hand, Drools 5.1.1 takes the algorithm to a new
level, saving a lot of memory on systems that use modify actions on their
rules.

http://blog.athico.com/2010/03/drools-halves-memory-use-with-new-true.html

Regarding your performance, all I can tell you is that a rules engine is
a relational engine that works pretty much like a database, and rules as
databases queries. The same way you can write SQL queries that run fast or
slow on a database, you can write rules that run fast or slow on a rules
engine. It all depends on how the rules/queries are written, how your data
model/domain model looks like, etc.

So, regarding your question, we can't tell you how to improve those
metrics without knowing your domain model, rules and etc.

[]s
Edson

2010/9/17 Nikhil S. Kulkarni 

>  Hi,
>
>
>
> I have written 2 different Drools programs. One is with
> Using rule Base of Drools 4.0 and other is using Knowledge Base of Drools
> 5.0.
>
> I was trying to check that is there any improvement in Drools 5.0. But I
> haven’t got any performance improvement in Drools 5.0 code compared to
> Drools 4.0.
>
>
>
> One more important thing is I am calling this drools code
> from  My application which itself is heavy application, when I am doing
> Performance tuning
>
> I got one point i.e. session.execute() method is taking around 6-7 seconds
> to initialize rules and even the memory utilized by Rules is huge.
>
>
>
> So is there any way that we can reduce the Memory leakage and improve
> performance.
>
>
>
> Waiting for Reply.
>
>
>
> Thanks & Regards,
>
> Nikhil S. Kulkarni
>
> Emp No: - 9254
>
>
>
>
>
> MASTEK LTD.
> In the US, we're called MAJESCOMASTEK
>
>
> ~~
>
> Opinions expressed in this e-mail are those of the individual and not that of 
> Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
> does not accept any responsibility or liability for it. This e-mail and 
> attachments (if any) transmitted with it are confidential and/or privileged 
> and solely for the use of the intended person or entity to which it is 
> addressed. Any review, re-transmission, dissemination or other use of or 
> taking of any action in reliance upon this information by persons or entities 
> other than the intended recipient is prohibited. This e-mail and its 
> attachments have been scanned for the presence of computer viruses. It is the 
> responsibility of the recipient to run the virus check on e-mails and 
> attachments before opening them. If you have received this e-mail in error, 
> kindly delete this e-mail from desktop and server.
>
> ~~
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Ritesh

Thank you so much...  earlier I tried with both as below for each rule
with different salience values... but it was generating 4 exception as I
mentioned in my last email.

1.

agenda-group "init"

  auto-focus true

  no-loop true

salience 10 

  dialect 'java'

2.

  dialect 'java'

 

Now I am just using :

Rule 1

salience 100

  dialect 'java'

Rule 2

salience 50

  dialect 'java'

Rule 3

salience -1

  dialect 'java'

 

This is working just fine.

 

Thanks a lot..

 

Ritesh



From: Michael Anstis-2 [via Drools - Java Rules Engine]
[mailto:ml-node+1516613-244846131-167...@n3.nabble.com] 
Sent: Friday, September 17, 2010 4:46 PM
To: Khot, Ritesh
Subject: Re: How to activate/deactivate a rule.

 

Am I correct in thinking you want to calculate the sum of groups of
ABC.C's differentiated by ABC.A?

 

An activation for the third rule is being created each time an ABC is
inserted into WM. First with one ABC, then with two and so fourth.

 

What you want is to ensure that "processing" for rules 1 and 2 complete
first and then rule 3 works on the results in WM. This can be achieved
with salience on the three rules; lower on rule 3 than 1 and 2 to ensure
it's activations execute after rules 1 and 2 are finished operating on
all facts.

 

2010/9/17 <[hidden email]>

Hi,

Thanks for the reply..

 

--The sequential option is set to false

--Using  StatelessKnowledgeSession

 

Summary what I intend to achieve,

1.  In first rule, I am doing calculation on three different columns
and putting it in sumOfThree property of ActualSum and inserting it in
WM. Let say I have four facts.
2.  In Second Rule, I am inserting distinct audit trail in
DistinctAT. Lets say I have two distinct AT.
3.  In Third Rule, I am assuming 4 Facts of ActualSum and 2 Facts of
DistinctAT already available in WM. Now I want to get sum of sumOfThree
group by AT, which I am trying to get using Accumulate function.

 

OutPut I am getting:

AT :1001

Done!

Done Main Rule, total :-40.0

AT :1000

Done!

Done Main Rule, total :210.0

AT :1000

Done Main Rule, total :160.0

AT :1000

Done Main Rule, total :260.0

 

INFO: Number of generated exceptions   4

 

Here I see the last rule is getting fired every time ActualSum fact is
inserted in first rule. And as the facts are available one by one, these
are available to Accumulate function used in third Rule. Actually I am
expecting only two exceptions one for AT:1001 and AT:1000 with total of
-40 and 260 resp.

 

Please advise.

 

P.S.  Please ignore "$lfna_SEI and $r_SE".

 

 

Thanks,

Ritesh



From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Anstis
Sent: Friday, September 17, 2010 12:43 PM
To: Rules Users List
Subject: Re: [rules-users] How to activate/deactivate a rule.

 

Have you tried running what you have?

 

I'd expect it to give the result you expect already (other than throwing
an error because $lfna_SEI and $r_SE are not bound in the last rule and
assuming chkRuleExpre is constant over time). Rules do not normally
execute in any sequential order (unless you explicitly make them so). As
the facts are inserted into WM they are matched against your rules and
activations scheduled. When all facts are inserted into WM and you call
fireAllRules the activations are played out and "truth maintenance"
ensures the "result" of their firing is consistent with the facts in WM
(either inserted by rules or the programmer). This is in essence "how
inference engines" work.

 

After you've called fireAllRules (and assuming you have a stateful
session) you insert more ABC's then you'd have to expect the last rule
to be re-evaluated - following another call to fireAllRules. So in part
when rule 3 ultimately gives the "correct" answer depends upon when you
stop inserting ABC's.

 

On 17 September 2010 07:35, Ritesh <[hidden email]> wrote:


Hi,

I have 3 rules in my drl file and want the last one should get fired
only
after all the facts in rule1 and rule2 gets inserted in working memory.
Please see below code for more understanding. Please suggest.

Thanks

declare DistinctAT
d_auditT : String
end

declare ActualSum
auditT : String
sumOfThree : BigDecimal
end

rule "insert combined sum"
   dialect 'java'
when
   ABC( $a:A, $b:B, $c:C )

then
   BigDecimal actSum = $c.multiply(0.13);
   ActualSum $as = new ActualSum();
   $as.setAuditT($a);
   $as.setSumOfThree(actSum);
   insert($as);
   System.out.println("AT :" + $movAuditT);
end

rule "insert distinct AT"

   dialect 'java'
when
   $a : ActualSum( $AT : auditT )
   not DistinctAT( d_auditT == $AT )
then
   DistinctAT $disAT = new DistinctAT();
   $disAT.setD_auditT($AT);
   insert($disAT);
   System.out.println("Done!");
end

rule "Get Sum Group by AT"

   dialect 'java'
when

DistinctAT( $dAT: d_auditT 

Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Michael Anstis
Am I correct in thinking you want to calculate the sum of groups of ABC.C's
differentiated by ABC.A?

An activation for the third rule is being created each time an ABC is
inserted into WM. First with one ABC, then with two and so fourth.

What you want is to ensure that "processing" for rules 1 and 2 complete
first and then rule 3 works on the results in WM. This can be achieved with
salience on the three rules; lower on rule 3 than 1 and 2 to ensure it's
activations execute after rules 1 and 2 are finished operating on all facts.

2010/9/17 

>  Hi,
>
> Thanks for the reply..
>
>
>
> --The sequential option is set to *false*
>
> --Using  *StatelessKnowledgeSession*
>
> * *
>
> Summary what I intend to achieve,
>
>1. In first rule, I am doing calculation on three different columns and
>putting it in *sumOfThree *property of ActualSum and inserting it in
>WM. Let say I have four facts.
>2. In Second Rule, I am inserting distinct audit trail in DistinctAT.
>Lets say I have two distinct AT.
>3. In Third Rule, I am assuming 4 Facts of ActualSum and 2 Facts of
>DistinctAT already available in WM. Now I want to get sum of sumOfThree
>group by AT, which I am trying to get using Accumulate function.
>
>
>
> *OutPut I am getting:*
>
> AT :1001
>
> Done!
>
> Done Main Rule, total :-40.0
>
> AT :1000
>
> Done!
>
> Done Main Rule, total :210.0
>
> AT :1000
>
> Done Main Rule, total :160.0
>
> AT :1000
>
> Done Main Rule, total :260.0
>
>
>
> INFO: Number of generated exceptions   4
>
>
>
> Here I see the last rule is getting fired every time ActualSum fact is
> inserted in first rule. And as the facts are available one by one, these are
> available to Accumulate function used in third Rule. Actually I am expecting
> only two exceptions one for AT:1001 and AT:1000 with total of -40 and 260
> resp.
>
>
>
> Please advise.
>
>
>
> P.S.  Please ignore “$lfna_SEI and $r_SE”.
>
>
>
>
>
> Thanks,
>
> Ritesh
>  --
>
> *From:* rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] *On Behalf Of *Michael Anstis
> *Sent:* Friday, September 17, 2010 12:43 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] How to activate/deactivate a rule.
>
>
>
> Have you tried running what you have?
>
>
>
> I'd expect it to give the result you expect already (other than throwing an
> error because $lfna_SEI and $r_SE are not bound in the last rule and
> assuming chkRuleExpre is constant over time). Rules do not normally execute
> in any sequential order (unless you explicitly make them so). As the facts
> are inserted into WM they are matched against your rules and activations
> scheduled. When all facts are inserted into WM and you call fireAllRules the
> activations are played out and "truth maintenance" ensures the "result" of
> their firing is consistent with the facts in WM (either inserted by rules or
> the programmer). This is in essence "how inference engines" work.
>
>
>
> After you've called fireAllRules (and assuming you have a stateful session)
> you insert more ABC's then you'd have to expect the last rule to be
> re-evaluated - following another call to fireAllRules. So in part when rule
> 3 ultimately gives the "correct" answer depends upon when you stop inserting
> ABC's.
>
>
>
> On 17 September 2010 07:35, Ritesh  wrote:
>
>
> Hi,
>
> I have 3 rules in my drl file and want the last one should get fired only
> after all the facts in rule1 and rule2 gets inserted in working memory.
> Please see below code for more understanding. Please suggest.
>
> Thanks
>
> declare DistinctAT
> d_auditT : String
> end
>
> declare ActualSum
> auditT : String
> sumOfThree : BigDecimal
> end
>
> rule "insert combined sum"
>dialect 'java'
> when
>ABC( $a:A, $b:B, $c:C )
>
> then
>BigDecimal actSum = $c.multiply(0.13);
>ActualSum $as = new ActualSum();
>$as.setAuditT($a);
>$as.setSumOfThree(actSum);
>insert($as);
>System.out.println("AT :" + $movAuditT);
> end
>
> rule "insert distinct AT"
>
>dialect 'java'
> when
>$a : ActualSum( $AT : auditT )
>not DistinctAT( d_auditT == $AT )
> then
>DistinctAT $disAT = new DistinctAT();
>$disAT.setD_auditT($AT);
>insert($disAT);
>System.out.println("Done!");
> end
>
> rule "Get Sum Group by AT"
>
>dialect 'java'
> when
>
> DistinctAT( $dAT: d_auditT )
>
> $total : Double()
> from accumulate( ActualSum( auditT == $dAT, $actSum_Main : sumOfThree ),
> sum( $actSum_Main ) )
>
> eval(
>chkRuleExpre( $total,$lfna_SEI,$r_SEI )
> )
>
> then
>System.out.println("Done Main Rule, total :" + $total);
> end
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/How-to-activate-deactivate-a-rule-tp1516088p1516088.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> ___

Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Ritesh.khot
Hi,

Thanks for the reply..

 

--The sequential option is set to false

--Using  StatelessKnowledgeSession

 

Summary what I intend to achieve,

1.  In first rule, I am doing calculation on three different columns
and putting it in sumOfThree property of ActualSum and inserting it in
WM. Let say I have four facts.
2.  In Second Rule, I am inserting distinct audit trail in
DistinctAT. Lets say I have two distinct AT.
3.  In Third Rule, I am assuming 4 Facts of ActualSum and 2 Facts of
DistinctAT already available in WM. Now I want to get sum of sumOfThree
group by AT, which I am trying to get using Accumulate function.

 

OutPut I am getting:

AT :1001

Done!

Done Main Rule, total :-40.0

AT :1000

Done!

Done Main Rule, total :210.0

AT :1000

Done Main Rule, total :160.0

AT :1000

Done Main Rule, total :260.0

 

INFO: Number of generated exceptions   4

 

Here I see the last rule is getting fired every time ActualSum fact is
inserted in first rule. And as the facts are available one by one, these
are available to Accumulate function used in third Rule. Actually I am
expecting only two exceptions one for AT:1001 and AT:1000 with total of
-40 and 260 resp.

 

Please advise.

 

P.S.  Please ignore "$lfna_SEI and $r_SE". And I am not modifying any
facts in any of the rules consequence (just insertion).

 

 

Thanks,

Ritesh

 

 

Ritesh Khot

SunGard Technology Services, Lohia Jain, S.B. Road, Pune - 411016, India


Direct Tel: +91-20-3021 6084 * Cell: +91- 9850960259 *
ritesh.k...@sungard.com   *
www.sungard.com/sts  

__

CONFIDENTIALITY: This email (including any attachments) may contain
confidential, proprietary and privileged information, and unauthorized
disclosure or use is prohibited. If you received this email in error,
please notify the sender and delete this email from your system. Thank
you.



From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Friday, September 17, 2010 1:00 PM
To: Rules Users List
Subject: Re: [rules-users] How to activate/deactivate a rule.

 

I think this overly complex (unless other things have to be considered
as well.

As I interpret these three rules, it is required to compute the sum
of all values ABC.C with equal ABC.A

declare DistinctAT
d_auditT : String
d_sum: Double
end

rule "create DistinctAT on first ABC"
when
ABC( $a:A )
not DistinctAT( d_auditT == $a )
then
DistinctAT $disAT = new DistinctAT();
$disAT.setD_auditT($AT);
insert( $disAT );
end

rule "update d_sum in DistinctAT"
when
$disAT: DistinctAT( $a: d_auditT )
ABC( A == $a, $c:C )
then
$disAT.setD_sum( $disAT.getD_sum() + $c*0.13 );
end

Notice that I do not update/modify $disAT in the second rule since this
would cause a loop.
If you need the update to fire other rules, add "no-loop true".

To get all results, you can use a query; run it after all ABCs have been
inserted.

-W



On 17 September 2010 08:35, Ritesh  wrote:


Hi,

I have 3 rules in my drl file and want the last one should get fired
only
after all the facts in rule1 and rule2 gets inserted in working memory.
Please see below code for more understanding. Please suggest.

Thanks

declare DistinctAT
d_auditT : String
end

declare ActualSum
auditT : String
sumOfThree : BigDecimal
end

rule "insert combined sum"
   dialect 'java'
when
   ABC( $a:A, $b:B, $c:C )

then
   BigDecimal actSum = $c.multiply(0.13);
   ActualSum $as = new ActualSum();
   $as.setAuditT($a);
   $as.setSumOfThree(actSum);
   insert($as);
   System.out.println("AT :" + $movAuditT);
end

rule "insert distinct AT"

   dialect 'java'
when
   $a : ActualSum( $AT : auditT )
   not DistinctAT( d_auditT == $AT )
then
   DistinctAT $disAT = new DistinctAT();
   $disAT.setD_auditT($AT);
   insert($disAT);
   System.out.println("Done!");
end

rule "Get Sum Group by AT"

   dialect 'java'
when

DistinctAT( $dAT: d_auditT )

$total : Double()
from accumulate( ActualSum( auditT == $dAT, $actSum_Main : sumOfThree ),
sum( $actSum_Main ) )

eval(
   chkRuleExpre( $total,$lfna_SEI,$r_SEI )
)

then
   System.out.println("Done Main Rule, total :" + $total);
end

--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-activate-deac
tivate-a-rule-tp1516088p1516088.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Ritesh.khot
Hi,

Thanks for the reply..

 

--The sequential option is set to false

--Using  StatelessKnowledgeSession

 

Summary what I intend to achieve,

1.  In first rule, I am doing calculation on three different columns
and putting it in sumOfThree property of ActualSum and inserting it in
WM. Let say I have four facts.
2.  In Second Rule, I am inserting distinct audit trail in
DistinctAT. Lets say I have two distinct AT.
3.  In Third Rule, I am assuming 4 Facts of ActualSum and 2 Facts of
DistinctAT already available in WM. Now I want to get sum of sumOfThree
group by AT, which I am trying to get using Accumulate function.

 

OutPut I am getting:

AT :1001

Done!

Done Main Rule, total :-40.0

AT :1000

Done!

Done Main Rule, total :210.0

AT :1000

Done Main Rule, total :160.0

AT :1000

Done Main Rule, total :260.0

 

INFO: Number of generated exceptions   4

 

Here I see the last rule is getting fired every time ActualSum fact is
inserted in first rule. And as the facts are available one by one, these
are available to Accumulate function used in third Rule. Actually I am
expecting only two exceptions one for AT:1001 and AT:1000 with total of
-40 and 260 resp.

 

Please advise.

 

P.S.  Please ignore "$lfna_SEI and $r_SE".

 

 

Thanks,

Ritesh



From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Michael Anstis
Sent: Friday, September 17, 2010 12:43 PM
To: Rules Users List
Subject: Re: [rules-users] How to activate/deactivate a rule.

 

Have you tried running what you have?

 

I'd expect it to give the result you expect already (other than throwing
an error because $lfna_SEI and $r_SE are not bound in the last rule and
assuming chkRuleExpre is constant over time). Rules do not normally
execute in any sequential order (unless you explicitly make them so). As
the facts are inserted into WM they are matched against your rules and
activations scheduled. When all facts are inserted into WM and you call
fireAllRules the activations are played out and "truth maintenance"
ensures the "result" of their firing is consistent with the facts in WM
(either inserted by rules or the programmer). This is in essence "how
inference engines" work.

 

After you've called fireAllRules (and assuming you have a stateful
session) you insert more ABC's then you'd have to expect the last rule
to be re-evaluated - following another call to fireAllRules. So in part
when rule 3 ultimately gives the "correct" answer depends upon when you
stop inserting ABC's.

 

On 17 September 2010 07:35, Ritesh  wrote:


Hi,

I have 3 rules in my drl file and want the last one should get fired
only
after all the facts in rule1 and rule2 gets inserted in working memory.
Please see below code for more understanding. Please suggest.

Thanks

declare DistinctAT
d_auditT : String
end

declare ActualSum
auditT : String
sumOfThree : BigDecimal
end

rule "insert combined sum"
   dialect 'java'
when
   ABC( $a:A, $b:B, $c:C )

then
   BigDecimal actSum = $c.multiply(0.13);
   ActualSum $as = new ActualSum();
   $as.setAuditT($a);
   $as.setSumOfThree(actSum);
   insert($as);
   System.out.println("AT :" + $movAuditT);
end

rule "insert distinct AT"

   dialect 'java'
when
   $a : ActualSum( $AT : auditT )
   not DistinctAT( d_auditT == $AT )
then
   DistinctAT $disAT = new DistinctAT();
   $disAT.setD_auditT($AT);
   insert($disAT);
   System.out.println("Done!");
end

rule "Get Sum Group by AT"

   dialect 'java'
when

DistinctAT( $dAT: d_auditT )

$total : Double()
from accumulate( ActualSum( auditT == $dAT, $actSum_Main : sumOfThree ),
sum( $actSum_Main ) )

eval(
   chkRuleExpre( $total,$lfna_SEI,$r_SEI )
)

then
   System.out.println("Done Main Rule, total :" + $total);
end

--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/How-to-activate-deac
tivate-a-rule-tp1516088p1516088.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Perfromance issues and memory leaks in Drools

2010-09-17 Thread Nikhil S. Kulkarni
Hi,

I have written 2 different Drools programs. One is with Using 
rule Base of Drools 4.0 and other is using Knowledge Base of Drools 5.0.
I was trying to check that is there any improvement in Drools 5.0. But I 
haven't got any performance improvement in Drools 5.0 code compared to Drools 
4.0.

One more important thing is I am calling this drools code from  
My application which itself is heavy application, when I am doing Performance 
tuning
I got one point i.e. session.execute() method is taking around 6-7 seconds to 
initialize rules and even the memory utilized by Rules is huge.

So is there any way that we can reduce the Memory leakage and improve 
performance.

Waiting for Reply.

Thanks & Regards,
Nikhil S. Kulkarni
Emp No: - 9254

MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~
Opinions expressed in this e-mail are those of the individual and not that of 
Mastek Limited, unless specifically indicated to that effect. Mastek Limited 
does not accept any responsibility or liability for it. This e-mail and 
attachments (if any) transmitted with it are confidential and/or privileged and 
solely for the use of the intended person or entity to which it is addressed. 
Any review, re-transmission, dissemination or other use of or taking of any 
action in reliance upon this information by persons or entities other than the 
intended recipient is prohibited. This e-mail and its attachments have been 
scanned for the presence of computer viruses. It is the responsibility of the 
recipient to run the virus check on e-mails and attachments before opening 
them. If you have received this e-mail in error, kindly delete this e-mail from 
desktop and server.
~~
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Wolfgang Laun
I think this overly complex (unless other things have to be considered as
well.

As I interpret these three rules, it is required to compute the sum
of all values ABC.C with equal ABC.A

declare DistinctAT
d_auditT : String
d_sum: Double
end

rule "create DistinctAT on first ABC"
when
ABC( $a:A )
not DistinctAT( d_auditT == $a )
then
DistinctAT $disAT = new DistinctAT();
$disAT.setD_auditT($AT);
insert( $disAT );
end

rule "update d_sum in DistinctAT"
when
$disAT: DistinctAT( $a: d_auditT )
ABC( A == $a, $c:C )
then
$disAT.setD_sum( $disAT.getD_sum() + $c*0.13 );
end

Notice that I do not update/modify $disAT in the second rule since this
would cause a loop.
If you need the update to fire other rules, add "no-loop true".

To get all results, you can use a query; run it after all ABCs have been
inserted.

-W


On 17 September 2010 08:35, Ritesh  wrote:

>
> Hi,
>
> I have 3 rules in my drl file and want the last one should get fired only
> after all the facts in rule1 and rule2 gets inserted in working memory.
> Please see below code for more understanding. Please suggest.
>
> Thanks
>
> declare DistinctAT
> d_auditT : String
> end
>
> declare ActualSum
> auditT : String
> sumOfThree : BigDecimal
> end
>
> rule "insert combined sum"
>dialect 'java'
> when
>ABC( $a:A, $b:B, $c:C )
>
> then
>BigDecimal actSum = $c.multiply(0.13);
>ActualSum $as = new ActualSum();
>$as.setAuditT($a);
>$as.setSumOfThree(actSum);
>insert($as);
>System.out.println("AT :" + $movAuditT);
> end
>
> rule "insert distinct AT"
>
>dialect 'java'
> when
>$a : ActualSum( $AT : auditT )
>not DistinctAT( d_auditT == $AT )
> then
>DistinctAT $disAT = new DistinctAT();
>$disAT.setD_auditT($AT);
>insert($disAT);
>System.out.println("Done!");
> end
>
> rule "Get Sum Group by AT"
>
>dialect 'java'
> when
>
> DistinctAT( $dAT: d_auditT )
>
> $total : Double()
> from accumulate( ActualSum( auditT == $dAT, $actSum_Main : sumOfThree ),
> sum( $actSum_Main ) )
>
> eval(
>chkRuleExpre( $total,$lfna_SEI,$r_SEI )
> )
>
> then
>System.out.println("Done Main Rule, total :" + $total);
> end
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/How-to-activate-deactivate-a-rule-tp1516088p1516088.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools with Spring Batch

2010-09-17 Thread Evert Penninckx

Check the drools introduction at 
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-introduction/html/ch02.html#d0e63
chapter 2.1.2.2. 

It has a nice configuration example. 

-Evert
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-with-Spring-Batch-tp1488585p1516156.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to activate/deactivate a rule.

2010-09-17 Thread Michael Anstis
Have you tried running what you have?

I'd expect it to give the result you expect already (other than throwing an
error because $lfna_SEI and $r_SE are not bound in the last rule and
assuming chkRuleExpre is constant over time). Rules do not normally execute
in any sequential order (unless you explicitly make them so). As the facts
are inserted into WM they are matched against your rules and activations
scheduled. When all facts are inserted into WM and you call fireAllRules the
activations are played out and "truth maintenance" ensures the "result" of
their firing is consistent with the facts in WM (either inserted by rules or
the programmer). This is in essence "how inference engines" work.

After you've called fireAllRules (and assuming you have a stateful session)
you insert more ABC's then you'd have to expect the last rule to be
re-evaluated - following another call to fireAllRules. So in part when rule
3 ultimately gives the "correct" answer depends upon when you stop inserting
ABC's.

On 17 September 2010 07:35, Ritesh  wrote:

>
> Hi,
>
> I have 3 rules in my drl file and want the last one should get fired only
> after all the facts in rule1 and rule2 gets inserted in working memory.
> Please see below code for more understanding. Please suggest.
>
> Thanks
>
> declare DistinctAT
> d_auditT : String
> end
>
> declare ActualSum
> auditT : String
> sumOfThree : BigDecimal
> end
>
> rule "insert combined sum"
>dialect 'java'
> when
>ABC( $a:A, $b:B, $c:C )
>
> then
>BigDecimal actSum = $c.multiply(0.13);
>ActualSum $as = new ActualSum();
>$as.setAuditT($a);
>$as.setSumOfThree(actSum);
>insert($as);
>System.out.println("AT :" + $movAuditT);
> end
>
> rule "insert distinct AT"
>
>dialect 'java'
> when
>$a : ActualSum( $AT : auditT )
>not DistinctAT( d_auditT == $AT )
> then
>DistinctAT $disAT = new DistinctAT();
>$disAT.setD_auditT($AT);
>insert($disAT);
>System.out.println("Done!");
> end
>
> rule "Get Sum Group by AT"
>
>dialect 'java'
> when
>
> DistinctAT( $dAT: d_auditT )
>
> $total : Double()
> from accumulate( ActualSum( auditT == $dAT, $actSum_Main : sumOfThree ),
> sum( $actSum_Main ) )
>
> eval(
>chkRuleExpre( $total,$lfna_SEI,$r_SEI )
> )
>
> then
>System.out.println("Done Main Rule, total :" + $total);
> end
>
> --
> View this message in context:
> http://drools-java-rules-engine.46999.n3.nabble.com/How-to-activate-deactivate-a-rule-tp1516088p1516088.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users