Re: [rules-users] Help -- Conditional Logic in DRL

2009-06-16 Thread Greg Barton

Note to drools devs: I didn't put the original poster up to this. :)

Globals should be considered immutable, so shouldn't be used in this way. You 
could do it with an object asserted in working memory, though.

Just as good, though, you can use this kind of pattern to replicate else logic:

rule EverythingMatches
when
  Condition0
  Condition1
  Condition2
then
  ...
end

rule ElseAtCondition2
when
  Condition0
  Condition1
  !Condition2
then
  ...
end

rule ElseAtCondition1
when
  Condition0
  !Condition1
then
  ...
end

rule ElseAtCondition0
when
  !Condition0
then
  ...
end

--- On Mon, 6/15/09, Scott Reed sr...@avacoda.com wrote:

 From: Scott Reed sr...@avacoda.com
 Subject: Re: [rules-users] Help -- Conditional Logic in DRL
 To: Rules Users List rules-users@lists.jboss.org
 Date: Monday, June 15, 2009, 10:19 PM
 Looks like 5 rules with a global flag
 might work:
 
 global boolean flag = false;
 
 rule name1
 when
   (condition1 == true )
   (flag == false)
 then
   consequence1();
   flag = true;
 end
 
 ...
 
 rule name5
 when
   (condition5 == true )
   (flag == false)
 then
   consequence5();
   flag = true;
 end
 
 Does that work for you?
 
 Vishy [6/15/2009 11:06 PM] wrote:
  Hi All,
 
  I am new to drools...and am trying to figure out as to
 how I can
  represent the following logic in a DRL file.
 
  if (condition1) {
 
    if (condition2) {
 
    } else if (condition3) {
 
    } else if (condition 4) {
 
    } else if (condition 5) {
 
    }
 
  }
 
  In DSL, a typical rule is represented as follows:
 
  rule name
 
  when
    condition is true
  then
    consequence
 
  end
 
  How can I represent the above mentioned if - else
 logic in DSL? Or is
  it not possible?
 
  If it is not, can you please suggest any alternative?
 
  Thanks much!!
  ___
  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] Help -- Conditional Logic in DRL

2009-06-16 Thread Wolfgang Laun
Using a fact as a guard to block alternatives is tricky. For one thing, you
cannot use a single global fact. (When would you reset this fact to the
initial state so that the whole mechanism can work again for the next fact
set to be processed by this rule set?) So, you might consider inserting a
flag fact along with one of the facts playing the key role in all of the
conditions. But what if the participating facts change, and this if set
should be activated again? How would you reset or recreate the flag fact?

Also, the precedence implied by the ordering of the else branches would have
to be expressed in the rules, using salience.

So, the solution Greg has outlined is the one to pursue. As a general rule,
keep in mind that

  if( cond ){
  ...;
  } else {
 assert( ! cond );
 ...;
  }

and

  if( cond1){ if( cond2 ){ assert( cond1  cond2 );...;

Thus, you can collect the precondition for each if branch that is to become
a consequence of a rule, and the corresponding precondition is to be
implemented as the left hand side.

-W





On 6/16/09, Greg Barton greg_bar...@yahoo.com wrote:


 Note to drools devs: I didn't put the original poster up to this. :)

 Globals should be considered immutable, so shouldn't be used in this way.
 You could do it with an object asserted in working memory, though.

 Just as good, though, you can use this kind of pattern to replicate else
 logic:

 rule EverythingMatches
 when
 Condition0
 Condition1
 Condition2
 then
 ...
 end

 rule ElseAtCondition2
 when
 Condition0
 Condition1
 !Condition2
 then
 ...
 end

 rule ElseAtCondition1
 when
 Condition0
 !Condition1
 then
 ...
 end

 rule ElseAtCondition0
 when
 !Condition0
 then
 ...
 end

 --- On Mon, 6/15/09, Scott Reed sr...@avacoda.com wrote:

  From: Scott Reed sr...@avacoda.com
  Subject: Re: [rules-users] Help -- Conditional Logic in DRL
  To: Rules Users List rules-users@lists.jboss.org
  Date: Monday, June 15, 2009, 10:19 PM
  Looks like 5 rules with a global flag
  might work:
 
  global boolean flag = false;
 
  rule name1
  when
(condition1 == true )
(flag == false)
  then
consequence1();
flag = true;
  end
 
  ...
 
  rule name5
  when
(condition5 == true )
(flag == false)
  then
consequence5();
flag = true;
  end
 
  Does that work for you?
 
  Vishy [6/15/2009 11:06 PM] wrote:
   Hi All,
  
   I am new to drools...and am trying to figure out as to
  how I can
   represent the following logic in a DRL file.
  
   if (condition1) {
  
 if (condition2) {
  
 } else if (condition3) {
  
 } else if (condition 4) {
  
 } else if (condition 5) {
  
 }
  
   }
  
   In DSL, a typical rule is represented as follows:
  
   rule name
  
   when
 condition is true
   then
 consequence
  
   end
  
   How can I represent the above mentioned if - else
  logic in DSL? Or is
   it not possible?
  
   If it is not, can you please suggest any alternative?
  
   Thanks much!!
   ___
   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


Re: [rules-users] Drools v5 multithreading questions

2009-06-16 Thread Andrey Nechaev
It's here: https://jira.jboss.org/jira/browse/JBRULES-2125

2009/6/15 Edson Tirelli tire...@post.com


Andrey,

May I ask you please to open a JIRA with the info from your e-mail? I
 will investigate this.

Thanks,
   Edson

 2009/6/15 Andrey Nechaev nechaev.and...@gmail.com

 Hello, All!



 I’m evaluating the new version of Drools (5.0.1), so I’m especially
 interested in multithreading and partitioning options, implemented in Drools
 v5.


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


Re: [rules-users] [#JBRULES-1946] Deserializing a KnowledgeBase object throws a java.io.EOFException

2009-06-16 Thread Przemysław Różycki

Hello Rick,

I confirm, that implementations - DroolsObjectOutputStream and 
DroolsObjectInputStream work well, but it's not applicable in my case, 
because I depend on external component, that is responsible for storing 
my data and it uses standard serialization mechanisms. Of course, I may 
do some workarounds that for example first serialize the stream using 
Drools implementation and then pass it to the external component, but I 
prefer to try to do it as it should be. If I don't manage to, I will 
think about some other ways.


Anyway, thank you for your response and advice.

Best regards,
Przemysław Różycki

Rick Lacy pisze:
I haven't actually tested this with your example yet, but I recall 
having a similar problem.  I notice you are using the raw 
java.io.ObjectInputStream and java.io.ObjectOutputStream.  I think what 
I did was switch to org.drools.common.DroolsObjectInputStream and 
org.drools.common.DroolsObjectOutputStream.  Have you tried it with 
these yet?
 
 
Regards,
 
 
Rick


 
On 6/15/09, *Przemysław Różycki* p.rozy...@amg.net.pl 
mailto:p.rozy...@amg.net.pl wrote:


Hello,

IMHO, this bug still occurs in 5.0.1 final version as well as in
trunk. I put the proper comment and example code in JIRA:
https://jira.jboss.org/jira/browse/JBRULES-1946

I need it working quite quickly, so if the Drools developers plan to
solve it later, then I will try to look at the source code by myself
and find the solution (and share of course).

However I would like to ask if anyone tried to diagnose the problem
earlier and has some thoughts where to look for the cause?

Best regards,
-- 
Przemysław Różycki

Architekt IT
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
tel.: (+48 42) 296 11 82
GSM: (+48) 510 022 612
jid: p.rozy...@amg.net.pl mailto:p.rozy...@amg.net.pl
GG: 145116
www.amg.net.pl http://www.amg.net.pl/


Treść niniejszej wiadomości może być poufna. Jeżeli nie jesteście
Państwo jej adresatem, to rozprowadzanie lub wykorzystywanie
zawartych tu informacji jest zabronione.

This e-mail contains material that is confidential for the sole use
of the intended recipient. Any review, reliance or distribution by
others or forwarding without express permission is strictly
prohibited. If you are not the intended recipient, please contact
the sender and delete all copies.
___
rules-users mailing list
rules-users@lists.jboss.org mailto: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



--
Przemysław Różycki
IT Architect
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Extend Guvnor

2009-06-16 Thread Andy Mei
Hi all,

   Long time user of Drools (dated back in xml syntax days).  We are looking
to revamp our in house rules product which is based on Drools 3.x.  We have
built a Swing thick client that provides similar functionality as Guvnor
such as rule editing, versioning, deployment (with approval system).  One
major feature we do have is rule simulation.  We allow user to simulate
rules and display results while user save or seek approval of their rules
before deploy to production system.  The simulation feature allows user to
run against production or testing environment to ensure it provide correct
results.  I wonder if Guvnor has such extensibility interface build in which
I could add my own functionality such as simulation and result browsing?
Since Guvnor is based on Seam and GWT (i think), I could probably fork the
source and tweak the UI, but I much rather code against an interface
supported by Drools.

  Thoughts? TIA.

PS:  I am curious how are existing Drools user test their rules currently?

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


Re: [rules-users] Help -- Conditional Logic in DRL

2009-06-16 Thread new2drools


Greg,

Thanks much for your suggestion...I think this will help!!

Should have thought of this approach, before posting...

Thanks again!

Greg Barton wrote:
 
 
 Note to drools devs: I didn't put the original poster up to this. :)
 
 Globals should be considered immutable, so shouldn't be used in this way.
 You could do it with an object asserted in working memory, though.
 
 Just as good, though, you can use this kind of pattern to replicate else
 logic:
 
 rule EverythingMatches
 when
   Condition0
   Condition1
   Condition2
 then
   ...
 end
 
 rule ElseAtCondition2
 when
   Condition0
   Condition1
   !Condition2
 then
   ...
 end
 
 rule ElseAtCondition1
 when
   Condition0
   !Condition1
 then
   ...
 end
 
 rule ElseAtCondition0
 when
   !Condition0
 then
   ...
 end
 
 --- On Mon, 6/15/09, Scott Reed sr...@avacoda.com wrote:
 
 From: Scott Reed sr...@avacoda.com
 Subject: Re: [rules-users] Help -- Conditional Logic in DRL
 To: Rules Users List rules-users@lists.jboss.org
 Date: Monday, June 15, 2009, 10:19 PM
 Looks like 5 rules with a global flag
 might work:
 
 global boolean flag = false;
 
 rule name1
 when
   (condition1 == true )
   (flag == false)
 then
   consequence1();
   flag = true;
 end
 
 ...
 
 rule name5
 when
   (condition5 == true )
   (flag == false)
 then
   consequence5();
   flag = true;
 end
 
 Does that work for you?
 
 Vishy [6/15/2009 11:06 PM] wrote:
  Hi All,
 
  I am new to drools...and am trying to figure out as to
 how I can
  represent the following logic in a DRL file.
 
  if (condition1) {
 
    if (condition2) {
 
    } else if (condition3) {
 
    } else if (condition 4) {
 
    } else if (condition 5) {
 
    }
 
  }
 
  In DSL, a typical rule is represented as follows:
 
  rule name
 
  when
    condition is true
  then
    consequence
 
  end
 
  How can I represent the above mentioned if - else
 logic in DSL? Or is
  it not possible?
 
  If it is not, can you please suggest any alternative?
 
  Thanks much!!
  ___
  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
 
 

-- 
View this message in context: 
http://www.nabble.com/HelpConditional-Logic-in-DRL-tp24046912p24055432.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] Web based decision tables

2009-06-16 Thread Dan Seaver

I'm exporting the table and I'd like to use the xml that represents the
web-based decision table to generate the DRL. Copying the source that can be
displayed by Guvnor will not suffice for my purposes.


Michael Rhoden wrote:
 
 Are you exporting the DRL or just using the view source from guvnor? The
 view source doesn't show the model that must be defined, among other
 things. I havent used the eclipse plugin much but Guvnor itself, has it's
 own pseudo model for handling Web Decision tables. When you finally
 generate a package it will generate correct DRL (not BRL/DT) of that
 decision table and should have everything you need to run it outside of
 Guvnor. BRL and DT will always create DRL when you export the package. So
 my guess is you should use KB.add on a DRL resource type. 
 
 -Michael 
 
 - Original Message - 
 From: Dan Seaver dan.sea...@ge.com 
 To: rules-users@lists.jboss.org 
 Sent: Monday, June 15, 2009 3:32:48 PM GMT -06:00 US/Canada Central 
 Subject: [rules-users] Web based decision tables 
 
 
 Can someone tell me the appropriate way to use web-based decision tables? 
 They seem to work fine if I create them in Guvnor, and then build and
 deploy 
 the binary package from Guvnor. However, if I copy the gdst from Guvnor to 
 Eclipse and use KnowledgeBuilder.add to attempt to add the resource as a 
 DTABLE or BRL resource type, I get a NullPointerException or 
 CannotResolveClassException. 
 
 Any help would be appreciated. 
 
 Thanks, 
 Dan 
 -- 
 View this message in context:
 http://www.nabble.com/Web-based-decision-tables-tp24042079p24042079.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
 
 

-- 
View this message in context: 
http://www.nabble.com/Web-based-decision-tables-tp24042079p24055684.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] Extend Guvnor

2009-06-16 Thread Mark Proctor

Andy Mei wrote:

Hi all,

   Long time user of Drools (dated back in xml syntax days).  We are 
looking to revamp our in house rules product which is based on Drools 
3.x.  We have built a Swing thick client that provides similar 
functionality as Guvnor such as rule editing, versioning, deployment 
(with approval system).  One major feature we do have is rule 
simulation.  We allow user to simulate rules and display results while 
user save or seek approval of their rules before deploy to production 
system.  The simulation feature allows user to run against production 
or testing environment to ensure it provide correct results.  I wonder 
if Guvnor has such extensibility interface build in which I could add 
my own functionality such as simulation and result browsing?  Since 
Guvnor is based on Seam and GWT (i think), I could probably fork the 
source and tweak the UI, but I much rather code against an interface 
supported by Drools. 


  Thoughts? TIA.

PS:  I am curious how are existing Drools user test their rules currently?
Guvnor has a simple scenario tester in the QA section. that allows you 
to run some rules against a set of data and asserting the expected results.


I'm currently working on a more complete framework, although just the 
backend api at the moment, for simulation and testing. I hope to have 
something usable in the next few days. I think the initial plan is to 
map it to an DSL in MVEL and also to maybe do a mapping to a spreadsheet 
metaphor. The simulation impl I'm doing will be very complete and allow 
for testing of rules, workflow and event processing. I'll blog about it 
once something is ready.


Not sure how this will plug into guvnor, other than the uploading and 
displaying of spreadsheets. One idea is to have a chronoscope time line, 
which displays all the steps and when they are suppose to happen. If you 
select a step, it shows the MVEL DSL fragment for that step which can be 
edited - just simple text area. After that works, we can probably work 
on various GUI editors for the step segments.


Mark

http://blog.athico.com Drools Blog.


Andy


___
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] 3rd CfP RuleML-2009 - Deadline extended June 28th

2009-06-16 Thread Adrian Paschke
   [Apologies for multiple postings]
   
   Call for Papers
   
 RuleML 2009
  
3rd International Symposium on Rules, Applications and Interoperability
 November 5-7 2009, Las Vegas, Nevada, USA
  
   http://2009.ruleml.org/

  co-located with the 12th Business Rules Forum

 


**
*  Latest News  **
**   Submission Deadline (extended)   June 28th **
*   **
* Keynote by Sandro Hawke, W3C RIF  - The Future of Rule Interchange**
* New categories in the Challenge with prestigious prizes   **  
* Rules standards session, W3C RIF workshop, lunch panel on Web Rules*
* Student grants of the value of up to $1000 plus free registration **
**

Supported by
===
W3C, OMG, ACM, AAAI, ECCAI, IAAIL, ACM, Belgian Business Rules Forum
MIT Sloan CIO Symposium, EPTS, BPM Forum Belgium

Sponsored by
===

Franz Inc
NICTA (National ICT Australia) Ltd
Corporate Semantic Web
Logic Programming Associated Ltd
ruleCore
JBoss
Modelsystems Ltd
===

Overview and Aim
===

The International Symposium on Rules, Applications and Interoperability has
evolved from an annual series of international workshops since 2002,
international conferences in 2005 and 2006, and international symposia since
2007. This year, the 3rd International Symposium on Rules, Applications and
Interoperability (RuleML-2009) takes place in Las Vegas, Nevada, USA,
collocated with the 12th Business Rules Forum, the world's largest Business
Rules event. RuleML-2009 is devoted to practical distributed rule
technologies and rule-based applications which need language standards for
rules (inter)operating in, e.g., the Semantic Web, Multi-Agent Systems,
Event-Driven Architectures, and Service-Oriented Applications. 

The main goal of RuleML-2009 is to stimulate the cooperation and
interoperability between business and research, by bringing together rule
system providers, participants in rule standardization efforts, open source
communities, practitioners, and researchers. The concept of the symposium
has also advanced continuously in the face of extremely rapid progress in
practical rule and event processing technologies. As a result, RuleML-2009
will feature hands-on demonstrations and challenges alongside a wide range
of thematic tracks, and thus will be an exciting venue to exchange new ideas
and experiences on all issues related to the engineering, management,
integration, interoperation and interchange of rules in open distributed
environments such as the Web.

Conference Theme
===

This year, we particularly welcome submissions that address applications of
Web rule technologies for business and information systems. We invite you to
share your ideas, results, and experiences: as an industry practitioner,
rule system provider, technical expert and developer, rule user or
researcher, exploring foundations, developing systems and applications, or
using rule-based systems. We invite high-quality submissions related to (but
not limited to) one or more of the following topics:

Track Topics


Rule Transformation and Extraction
  - Transformation and extraction with rule standards, such as SBVR, RIF and
OCL
  - Extraction of rules from code
  - Transformation and extraction in the context of frameworks such as KDM
(Knowledge Discovery meta-model)
  - Extraction of rules from natural language
  - Transformation or rules from one dialect into another

Rules and Uncertainty
  - Languages for the formalization of uncertainty rules
  - Probabilistic, fuzzy and other rule frameworks for reasoning with
uncertain or incomplete information
  - Handling inconsistent or disparate rules using uncertainty
  - Uncertainty extensions of event processing rules, business rules,
reactive rules, causal rules, derivation rules, association rules, or 
transformation rules

Rules and Norms
  - Methodologies for modeling regulations using both ontologies and rules
  - Defeasibility: modeling rule exceptions and priority relations among 
rule
  - The relationship between rules and legal argumentation schemes
  - Rule language requirements for the isomorphic modeling of legislation
  - Rule based inference 

[rules-users] Guvnor Building pkg error

2009-06-16 Thread Yan Liu
When trying to build a package (even using the sample pkg from drools
Guvnor) I got this - Sorry, a technical error occurred. Please contact a
system administrator.

This is indeed very frustrating as I need to build binary pkgs for my remote
rule agents to access. I found the post here saying it is fixed.
https://jira.jboss.org/jira/browse/GUVNOR-327 No details though.

Can anyone shed some light on this problem if you know how to fix it?

Thanks in advance for your reply.

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


[rules-users] Deploying Guvnor in an Enterprise environment

2009-06-16 Thread Steve Ronderos
Hello Drools Users,

I'm working on deploying Guvnor in an enterprise environment.  There is 
some mention in the JBoss Wikis 
http://www.jboss.org/community/wiki/GuvnorRoadmapFor0809 and 
http://www.jboss.org/community/wiki/Guvnor about lifecycle management of 
assets in Guvnor.  The descriptions in those two articles is somewhat 
brief and does not quite cover all of my requirements. 

We have a need to be able to deploy assets to various dev, staging and 
production servers and define which assets should be deployed in a given 
deploy.  I realize that snapshots and selectors can be leveraged to get 
this kind of functionality, but it does not feel like a robust solution. 
Additionally, we have scenarios where two users might need to edit the 
same asset for two different releases, and test them on different 
environments simultaneously.

Has anyone implemented Guvnor in a Dev, Staging, Production environment 
that could give some pointers on how to manage these concurrent release 
issues?

Thanks,
 
Steve Ronderos___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users