Re: [rules-users] executing ruleflow with AgendaFilter

2009-05-26 Thread Michal Bali
Hi Kris,

Thank you for quick response and explaining the details.

I thought that the AgendaFilter would cancel the activations and that the
ruleflow would continue. Otherwise it doesn't make much sense to use
AgendaFilter with ruleflow. But if it is not supported I'll have to live
with that :)

My use case: I have lot of rules. I need to be able to turn some rules on
and off depending on user input. I know that I could modify rule conditions
to check if a rule is enabled or not but this means lot of duplicated
conditions that are hard to maintain. I could also use 'rule inheritance'
but it doesn't provide enough flexibility - it supports only single
inheritance.

The problem is a crosscutting concern. It spreads across many rules. An
AgendaFilter seemed like the ideal candidate.
Alternatively, as you've indicated, I could use an AgendaEventListener and
in the activationCreated method cancel the activation. However this will
require use of some Drools internal APIs...

Thanks for your help.

Best regards,
Michal


On Mon, May 25, 2009 at 4:45 PM, Kris Verlaenen 
kris.verlae...@cs.kuleuven.be wrote:

 Michal,

 A ruleset node only continues if the ruleflow group is it associated
 with is deactivated.  A ruleflow group is deactivated automatically if
 it contains no more activations or if you deactivate it manually.  By
 using an agenda filter, you are not executing the activation and thus
 the activation is never removed from the ruleflow group.  Therefore, the
 process will keep waiting.  This is expected behavior.  Why were you
 expecting it to continue?  I guess you would need some other kind of
 filter that not prevents the activation from firing but cancels
 activations that are not accepted by the filter?

 Kris

 Quoting Michal Bali michalb...@gmail.com:

  Hi,
  If a rule is not allowed to fire by an AgendaFilter the whole
  ruleflow
  stops.
 
  I've created a small test case (attached). It contains:
   - one DRL file with one dummy rule that is in some ruleflow-group.
   - one RF file with three nodes ('start', 'ruleflow group' and
  'end')
   - a program that starts the process, and calls fireAllRules with
  custom
  agenda filter.
 
  Once the program is executed the ruleflow will stop inside the
  ruleflow-group. If I remove the agenda filter it works as expected
  (the
  ruleflow finishes).
 
  Tested with Drools 5.0.1.
 
  Is this a bug or am I missing something?
 
  Best regards,
  Michal
 




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

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


Re: [rules-users] executing ruleflow with AgendaFilter

2009-05-26 Thread Edson Tirelli
   Hey Michal,

   What about enabled attribute? Would that work for you?

   Of course that when I tried to find the docs on the enabled attribute I
noticed someone actually removed it from there... :(

   Basically, enabled takes an MVEL expression as parameter. The
expression can reference any globals, bindings from the LHS (user input),
rule metadata and also are allowed to make external calls to arbitrary java
methods. If the expression returns true, the rule is activated as usual,
while if it returns false, it will not activate for that given tuple.

   Since you mentioned based on user input, I am assuming that the user
inputs are either facts or globals.

   Example:

http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_enabledExpression.drl

So, I guess it would be like moving your logic from the agenda filter
into the enabled expression. If you want, you can wrap that evaluation in a
static method somewhere and call it, obviously.

Hope it helps.

On a side note, AgendaFilters were designed to be used mostly in unit
tests and debug, not as a real modeling feature. Even then, I think we could
improve this interaction between it and flow.

   Edson


2009/5/25 Michal Bali michalb...@gmail.com

 Hi Kris,

 Thank you for quick response and explaining the details.

 I thought that the AgendaFilter would cancel the activations and that the
 ruleflow would continue. Otherwise it doesn't make much sense to use
 AgendaFilter with ruleflow. But if it is not supported I'll have to live
 with that :)

 My use case: I have lot of rules. I need to be able to turn some rules on
 and off depending on user input. I know that I could modify rule conditions
 to check if a rule is enabled or not but this means lot of duplicated
 conditions that are hard to maintain. I could also use 'rule inheritance'
 but it doesn't provide enough flexibility - it supports only single
 inheritance.

 The problem is a crosscutting concern. It spreads across many rules. An
 AgendaFilter seemed like the ideal candidate.
 Alternatively, as you've indicated, I could use an AgendaEventListener and
 in the activationCreated method cancel the activation. However this will
 require use of some Drools internal APIs...

 Thanks for your help.

 Best regards,
 Michal


 On Mon, May 25, 2009 at 4:45 PM, Kris Verlaenen 
 kris.verlae...@cs.kuleuven.be wrote:

 Michal,

 A ruleset node only continues if the ruleflow group is it associated
 with is deactivated.  A ruleflow group is deactivated automatically if
 it contains no more activations or if you deactivate it manually.  By
 using an agenda filter, you are not executing the activation and thus
 the activation is never removed from the ruleflow group.  Therefore, the
 process will keep waiting.  This is expected behavior.  Why were you
 expecting it to continue?  I guess you would need some other kind of
 filter that not prevents the activation from firing but cancels
 activations that are not accepted by the filter?

 Kris

 Quoting Michal Bali michalb...@gmail.com:

  Hi,
  If a rule is not allowed to fire by an AgendaFilter the whole
  ruleflow
  stops.
 
  I've created a small test case (attached). It contains:
   - one DRL file with one dummy rule that is in some ruleflow-group.
   - one RF file with three nodes ('start', 'ruleflow group' and
  'end')
   - a program that starts the process, and calls fireAllRules with
  custom
  agenda filter.
 
  Once the program is executed the ruleflow will stop inside the
  ruleflow-group. If I remove the agenda filter it works as expected
  (the
  ruleflow finishes).
 
  Tested with Drools 5.0.1.
 
  Is this a bug or am I missing something?
 
  Best regards,
  Michal
 




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of 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] executing ruleflow with AgendaFilter

2009-05-26 Thread Mark Proctor

Michal Bali wrote:

Hi Kris,

Thank you for quick response and explaining the details.

I thought that the AgendaFilter would cancel the activations and that 
the ruleflow would continue. Otherwise it doesn't make much sense to 
use AgendaFilter with ruleflow. But if it is not supported I'll have 
to live with that :)
It seems like a reasonable request, that if all the rules have been 
cancelled, fired or filtered that the ruleflow-group should be 
de-activated so the flow can continue. We'll look into it for 5.1.


Mark


My use case: I have lot of rules. I need to be able to turn some rules 
on and off depending on user input. I know that I could modify rule 
conditions to check if a rule is enabled or not but this means lot of 
duplicated conditions that are hard to maintain. I could also use 
'rule inheritance' but it doesn't provide enough flexibility - it 
supports only single inheritance.


The problem is a crosscutting concern. It spreads across many 
rules. An AgendaFilter seemed like the ideal candidate.
Alternatively, as you've indicated, I could use an AgendaEventListener 
and in the activationCreated method cancel the activation. However 
this will require use of some Drools internal APIs...


Thanks for your help.

Best regards,
Michal


On Mon, May 25, 2009 at 4:45 PM, Kris Verlaenen 
kris.verlae...@cs.kuleuven.be mailto:kris.verlae...@cs.kuleuven.be 
wrote:


Michal,

A ruleset node only continues if the ruleflow group is it associated
with is deactivated.  A ruleflow group is deactivated automatically if
it contains no more activations or if you deactivate it manually.  By
using an agenda filter, you are not executing the activation and thus
the activation is never removed from the ruleflow group.
 Therefore, the
process will keep waiting.  This is expected behavior.  Why were you
expecting it to continue?  I guess you would need some other kind of
filter that not prevents the activation from firing but cancels
activations that are not accepted by the filter?

Kris

Quoting Michal Bali michalb...@gmail.com
mailto:michalb...@gmail.com:

 Hi,
 If a rule is not allowed to fire by an AgendaFilter the whole
 ruleflow
 stops.

 I've created a small test case (attached). It contains:
  - one DRL file with one dummy rule that is in some ruleflow-group.
  - one RF file with three nodes ('start', 'ruleflow group' and
 'end')
  - a program that starts the process, and calls fireAllRules with
 custom
 agenda filter.

 Once the program is executed the ruleflow will stop inside the
 ruleflow-group. If I remove the agenda filter it works as expected
 (the
 ruleflow finishes).

 Tested with Drools 5.0.1.

 Is this a bug or am I missing something?

 Best regards,
 Michal





Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm




___
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] RuleBase.removeRule leads to NoClassDefFoundError

2009-05-26 Thread Steinar Haugen
Hi Edson,
Thanks for your reply. Unfortunately, that is not yet an option for us,
since we're still on JDK 1.4.2.
We're working on upgrading to JDK 1.6, but that requires an upgrade of our
different client applications as well (~25 apps with varying degree of
maintenance personell assigned), and will probably not be in place until
earliest Q4 this year (i.e. about six months). Until that time, we'll have
to live with the current situation.
Regards,
Steinar Haugen

2009/5/25 Edson Tirelli tire...@post.com


Hi Steiner,

Did you tried Drools 5? We fixed a couple bugs related to package
 add/remove in the Drools 5 codebase.

[]s
Edson

 2009/5/25 Steinar Haugen steinar.hau...@gmail.com



 We found the reason for this behaviour, it is a bug which we reported in
 Jira:
 https://jira.jboss.org/jira/browse/JBRULES-2098

 See the Jira issue for details, code examples reproducing the issue and
 for
 a workaround.

 Regards,
 Steinar Haugen
 --
 View this message in context:
 http://www.nabble.com/RuleBase.removeRule-leads-to-NoClassDefFoundError-tp23657476p23707100.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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss, a division of Red Hat @ www.jboss.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] Drools Flow question

2009-05-26 Thread coffee_rancher

Let's say I have a flow: start - step1 - step2 - step3 - end. We execute the
flow and it fails at step 3. To be more concrete let's assume that we are
talking of provisioning of some items. Since we do not want to provision the
same items twice we obviously do not want to repeat steps 1 and 2 when we
re-execute the process . The question is: is it responsibility of the user
to skip those steps or the engine has some mechanism of tracing that?
-- 
View this message in context: 
http://www.nabble.com/Drools-Flow-question-tp23726193p23726193.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] executing ruleflow with AgendaFilter

2009-05-26 Thread Michal Bali
Hi Edson,
I was thinking about the enabled attribute but I didn't know it accepts mvel
expressions. That will certainly work. Thanks for letting me know.

For me, the benefit of AgendaFilter is that all this filtering is localized
in one place. With the 'enabled attribute' it still has to be applied to
each individual rule. With an AgendaFilter I could do stuff like 'fillter
everything except ...'. I can also easily add new types of AgendaFilters or
combine multiple AgendaFilters into one CompositeAgendaFilter.

I guess both approaches have their advantages and disadvantages.

Thank you.
Best regards,
Michal


2009/5/26 Edson Tirelli tire...@post.com


Hey Michal,

What about enabled attribute? Would that work for you?

Of course that when I tried to find the docs on the enabled attribute I
 noticed someone actually removed it from there... :(

Basically, enabled takes an MVEL expression as parameter. The
 expression can reference any globals, bindings from the LHS (user input),
 rule metadata and also are allowed to make external calls to arbitrary java
 methods. If the expression returns true, the rule is activated as usual,
 while if it returns false, it will not activate for that given tuple.

Since you mentioned based on user input, I am assuming that the user
 inputs are either facts or globals.

Example:

 http://anonsvn.le
 metadatajboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_enabledExpression.drlhttp://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/test_enabledExpression.drl

 So, I guess it would be like moving your logic from the agenda filter
 into the enabled expression. If you want, you can wrap that evaluation in a
 static method somewhere and call it, obviously.

 Hope it helps.

 On a side note, AgendaFilters were designed to be used mostly in unit
 tests and debug, not as a real modeling feature. Even then, I think we could
 improve this interaction between it and flow.

Edson


 2009/5/25 Michal Bali michalb...@gmail.com

  Hi Kris,

 Thank you for quick response and explaining the details.

 I thought that the AgendaFilter would cancel the activations and that the
 ruleflow would continue. Otherwise it doesn't make much sense to use
 AgendaFilter with ruleflow. But if it is not supported I'll have to live
 with that :)

 My use case: I have lot of rules. I need to be able to turn some rules on
 and off depending on user input. I know that I could modify rule conditions
 to check if a rule is enabled or not but this means lot of duplicated
 conditions that are hard to maintain. I could also use 'rule inheritance'
 but it doesn't provide enough flexibility - it supports only single
 inheritance.

 The problem is a crosscutting concern. It spreads across many rules. An
 AgendaFilter seemed like the ideal candidate.
 Alternatively, as you've indicated, I could use an AgendaEventListener and
 in the activationCreated method cancel the activation. However this will
 require use of some Drools internal APIs...

 Thanks for your help.

 Best regards,
 Michal


 On Mon, May 25, 2009 at 4:45 PM, Kris Verlaenen 
 kris.verlae...@cs.kuleuven.be wrote:

 Michal,

 A ruleset node only continues if the ruleflow group is it associated
 with is deactivated.  A ruleflow group is deactivated automatically if
 it contains no more activations or if you deactivate it manually.  By
 using an agenda filter, you are not executing the activation and thus
 the activation is never removed from the ruleflow group.  Therefore, the
 process will keep waiting.  This is expected behavior.  Why were you
 expecting it to continue?  I guess you would need some other kind of
 filter that not prevents the activation from firing but cancels
 activations that are not accepted by the filter?

 Kris

 Quoting Michal Bali michalb...@gmail.com:

  Hi,
  If a rule is not allowed to fire by an AgendaFilter the whole
  ruleflow
  stops.
 
  I've created a small test case (attached). It contains:
   - one DRL file with one dummy rule that is in some ruleflow-group.
   - one RF file with three nodes ('start', 'ruleflow group' and
  'end')
   - a program that starts the process, and calls fireAllRules with
  custom
  agenda filter.
 
  Once the program is executed the ruleflow will stop inside the
  ruleflow-group. If I remove the agenda filter it works as expected
  (the
  ruleflow finishes).
 
  Tested with Drools 5.0.1.
 
  Is this a bug or am I missing something?
 
  Best regards,
  Michal
 




 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm



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




 --
  Edson Tirelli
  JBoss Drools Core Development
  JBoss, a division of Red Hat @ www.jboss.com

 

[rules-users] moving average rule

2009-05-26 Thread Chris Richmond
Hello,

 

I am trying to write a rule for a moving average over values over the last
minute using fusion.  In general I can't seem to locate a detailed resource
for authoring syntax for these types of rules or rules in general, but
specifically, I tried to modify something from the fusion documentation for
my purposes using the StockTicker fusion sample.  Here is the rule entry I
aded to the broker.drl:

 

rule Alert when moving average goes below 50

when

Number( doubleValue  127 ) from accumulate(

StockTick( symbol == ORCL, $price: price ) over window:time( 1m ),

average( $price ) )

then

System.out.println(moving average has gone beyone moving average);

End

 

I basically want to be alerted any time the moving average for ORCL moves
above 127 (or whatever criteria I set.I picked that based on the sample data
the sample fusion project uses), but it doesn't seem to be working.  

 

I guess if I could locate the definitave samples or guide for authoring
these types of rules I could use that, but it's very difficult to piece
together how to author rules utilizing fusion features based on isolated
snippets from the fusion guide.

 

Can anyone point me to some reasources for learning rule authoring,
especially for taking advantage of the fusion features.

 

Thanks,


Chris

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


Re: [rules-users] moving average rule

2009-05-26 Thread Edson Tirelli
   Chris,

   Fusion is an extension of Drools Expert. Think about it as all Expert
features + some additional features. That is why Drools Fusion docs is just
a list of features explained.

   I assume you looked here already:

http://www.jboss.org/drools/documentation.html

   For both, expert and fusion docs.

   So, back to your rule, syntax seems correct to me. Why do you say it is
not working? What error or symptoms do you see?

   []s
   Edson

2009/5/26 Chris Richmond crichm...@referentia.com

  Hello,



 I am trying to write a rule for a moving average over values over the last
 minute using fusion.  In general I can’t seem to locate a detailed resource
 for authoring syntax for these types of rules or rules in general, but
 specifically, I tried to modify something from the fusion documentation for
 my purposes using the StockTicker fusion sample.  Here is the rule entry I
 aded to the broker.drl:



 *rule* Alert when moving average goes below 50

 *when*

 Number( doubleValue  127 ) *from* *accumulate*(

 StockTick( symbol == ORCL, $price: price ) over window:time( 1m
 ),

 average( $price ) )

 *then*

 System.out.println(moving average has gone beyone moving average);

 *End*

 * *

 I basically want to be alerted any time the moving average for ORCL moves
 above 127 (or whatever criteria I set…I picked that based on the sample data
 the sample fusion project uses), but it doesn’t seem to be working.



 I guess if I could locate the definitave samples or guide for authoring
 these types of rules I could use that, but it’s very difficult to piece
 together how to author rules utilizing fusion features based on isolated
 snippets from the fusion guide.



 Can anyone point me to some reasources for learning rule authoring,
 especially for taking advantage of the fusion features.



 Thanks,


 Chris

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




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


[rules-users] Rules Effective Date

2009-05-26 Thread Srinivas Doddi
Hi

I am a newbie for Drools and googled for a good time.  I would like to
know if Drools 4.0.7 and Drools 5 have anything like an Effective Date
concept? We have a requirement for having a rule written by the Business
Analysts and takes effective for a future date, without restarting the
application. Is Rules Engine intelligent enough to pick the rules
depending on effective dates?

Thanks a lot for your help.

SRINI

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


[rules-users] A Question about roadmap on integration between Drools and Apache ODE

2009-05-26 Thread 노종극
Title: Samsung Enterprise Portal mySingle
Hi.

I'm working for Samsung SDS in Korea as a project leader and in contemplation 
using Apache ODE and Drools.
When I was googling I saw your mail as below (Plz see bold) then I have a question about 
integration between Apache ODE and Drools.

I'd like to use Apache ODE as a business flow and Drools as a business rules 
on my project because I thinkBPEL is a  standard toolsrepresenting 
business flow. 
In details I'd like to implement in the way somenode in BPEL flow can call Drools 
business rules.

Would you give me the information about whether and when you're planned to integrate 
apache ODE into Drools?

Thank you in advance 

JongGeuk


Umesh Wankhede wrote:


Mark Proctor wrote:

Umesh Wankhede wrote:



Mark Proctor wrote:

Umesh Wankhede wrote:

Hi

I am trying to evaluate various features (rules and workflow) of 
Drools 5.0. What I understand from docs (drools-docs-flow.pdf - 
page 5) is that the Drools flow engine is based on generic process 
engine that allows the execution of different process languages 
like RuleFlow, BPEL, OSWorkflow, etc. Although I am able to do PoC 
(Proof of Concept) with RuleFlow, there isn't any 
documentation/samples available for using BPEL as process 
language. Also I don't find any more information on blogs, etc. 
If anyone has done something similar, please let me know, or any 
pointers would help. There is no BPEL product, 
Drools COULD do BPEL, but we haven't made it do so yet. It is more 
likely we would look to integrate an existing BPEL product like ODE, as 
the execution engine is the easy bit, it's all the xml manipulations 
that are time consuming. So that means I would have to go 
with jBPM for BPEL support (and losing the advantage of tight rule 
engine integration provided in Drools). How far would be the BPEL 
support in Drools in the roadmap? If you are going to use 
BPEL I would recommend ODE, jBPM BPEL is not BPEL 2.0, but 1.0, which 
is very limited. ODE is likely to be the BPEL engine we integrated into 
Drools. 
More importantly though, have a good think on why it is you are using 
BPEL, as in reality it's generally too low level for end users to use 
effectively. The primary language would be 
RuleFlow or jPDL, but we are also looking at BPEL support (product 
requirements driven). So we have to make a choice between jBPM or 
Drools 5.0. The latter option looks more suitable for our requirement 
which provides tightly integrated rule support, but lack of BPEL 
support currently is making the decision tougher. 
If you are going to choose a BPEL product, make sure you 
choose one that supports BPEL 2.0, or you'll be shooting yourself in 
the foot, Apache ODE is the more complete BPEL 2.0 engine. 





Thanks
Umesh


Legal Notice: This transmission, including any attachments, is 
confidential, proprietary, and may be privileged. It is intended 
solely for the intended recipient. If you are not the intended 
recipient, you have received this transmission in error and you are 
hereby advised that any review, disclosure, copying, 
distribution, or use of this transmission, or any of the information 
included therein, is unauthorized and strictly prohibited. If 
you have received this transmission in error, please immediately notify 
the sender by reply and permanently delete all copies of this transmission and its attachments





___
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




___
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___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users