Re: [rules-users] precompile rules

2008-06-07 Thread Marcus Ilgner
Hi,

On Fri, Jun 6, 2008 at 10:02 PM, apor [EMAIL PROTECTED] wrote:

 hi, i am new with drools. one question , The rules can precompilar ?

yes, you can compile your rulebase and serialize then later
deserialize the compiled packages.
From the documentation:
7.1.4.4. Serializing

Practically all of the rulebase related objects in Drools are
serializable. For a working memory to be serializable, all of your
objects must of course be serializable. So it is always possible to
deploy remotely, and bind rule assets to JNDI as a means of using
them in a container environment.

Please note that when using package builder, you may want to check the
hasError() flag before continuing deploying your rules (if there are
errors, you can get them from the package builder - rather then
letting it fail later on when you try to deploy).

Best regards
Marcus

 Thank you
 --
 View this message in context: 
 http://www.nabble.com/precompile-rules-tp17700145p17700145.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] Question about timing rules

2008-06-07 Thread Alexander Claus
It is perhaps not the optimal solution for your case, but you could use for 
example the duration keyword to enable a cyclic behaviour: Simply add a 
dummy object of a certain class into the working memory and do a 
pseudo-modification in the rhs of the rule to this object. This ensures that 
the rule will be reactivated:


rule A cyclic rule
   duration 1000
   when
   o : DummyObject()
   then
   System.out.println(fire);
   modify (o) {};
end

So you could model cyclic behaviour with a predefined cycle time. 
Unfortunately you could not change the duration parameter at runtime.

Hope I could inspire you...

Alexander Claus


- Original Message - 
From: Bagwell, Allen F [EMAIL PROTECTED]

To: Rules Users List rules-users@lists.jboss.org
Sent: Thursday, June 05, 2008 7:14 PM
Subject: RE: [rules-users] Question about timing rules




I've already followed something similar to Corneil's suggestion just by 
poking around on my own. What I've found is that the timers have to be set 
up to be checked first, then that caused focus to change to evaluate rules 
affected by those timers going off.


That's at least one way of doing it. I was wondering if others had used 
different methods.


In our old rule engine software, optional keywords could be used to set up 
what was essentially an interval timer under the hood on a per rule basis. 
Like this:


RULE: example rule
TIME_INTERVAL: 60; // (seconds)
WHEN
   
THEN
   

So rule activation based on the WHEN criteria only happened at a 
consistent interval of 60 seconds.


It was convenient, very easy to work with, and didn't require creating 
additional objects that had to referenced in the LHSs of rule writing. So 
with Drools we're experimenting with analagous ways of achieving the same 
thing.


Allen

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Reed

Sent: Thursday, June 05, 2008 10:35 AM
To: Rules Users List
Subject: Re: [rules-users] Question about timing rules

To parameterize each rule's frequency, you can add an object with a 
frequency property for each rule or group of rules with the same frequency 
and check the frequency in the LHS against Corniels proposed timer object. 
You can then modify the frequency property of these objects and signal the 
rule engine that the change was made and the new frequency will be be used 
to trigger the rules.


I am not sure you need to fireAllRules periodically. I think you can just 
update the timer object that Corneil proposes and signal the update to the 
rule engine and it will reevaluate the rules automatically.


Corneil du Plessis wrote:

It should not be an issue to have an object inserted representing the
current time and have rules checking against the object

--
--
*From:* [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] *On Behalf Of *Bagwell,
Allen F
*Sent:* 05 June 2008 17:34
*To:* Rules Users List
*Subject:* [rules-users] Question about timing rules


Another noob question:

Is there a generally understood way of implementing the concept of a
time interval rule?

That is, lets say I have a Drools-enabled client which is constantly
receiving information from outside resources. Most of this data (and
the consequences of its changes) is time sensitive, so I'm calling the
fireAllRules() method in a loop every minute.

And now, let's say I have a rule that in addition to being driven by
incoming data changes has to be linked to a repeating clock interval
or synched with wall time such that the rule only activates and fires
if the data meets certain parameters AND it's been exactly 1 hour
since the last check or that it will fire at the top of every wall
time hour (1 PM, 2PM, 3 PM, etc.).

Furthermore, timing may change. A successful rule activation and
firing might do something like now change this timing so that for the
next 24 hours, this rule must be examined every 30 minutes instead of
every hour.

My initial reading of the Drools documetation I came across the
Duration, and Date-* keywords. Their descriptions didn't seem to fit
the bill.

I ask this because our old rules engine software that has been retired
to obsolescence allowed this kind of thing to be easily set up. Coming
at it in the Drools world seems a lot more challenging.

Thoughts? Examples?

-Allen




--
--

___
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