[rules-users] Decision tables / Templates and Change Sets

2009-06-10 Thread Malenfant, Andre
Now a question on Change Sets:

 

Can a change set contain rule templates and their corresponding decision
table?

 

The way do use templates, as I have done at least and found in the
documentation, is to use an ExternalSpreadSheetCompiler to generate the
final rules using the templates and decision tables. After this is done,
the resulting DRL is added to the builder.

 

Is there a way to specify that in the change set so the compilation
(dtable/spreadsheet) is done automatically (and can be handled by an
agent)?

 

Thanks

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


RE: [rules-users] re: NumberGuessExample

2009-06-10 Thread Malenfant, Andre
Sorry, I gave you instruction for the imports and globals...

 

-  Open the Properties view in Eclipse

-  Select the background of the flow (unselect any selected
items)

-  The Properties view should refresh

-  The package property should be available for edit in the view

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Tak-po Li
Sent: Wednesday, June 10, 2009 4:50 PM
To: Rules Users List
Subject: Re: [rules-users] re: NumberGuessExample

 

 

 

I do not get it.  What I need is to change the text of "com.sample" in
file Guess.rf.  How this can be done in the Drools plugin?

 

Thanks,

 

Tak

 

 

 
http://drools.org/drools-5.0/process";
 xmlns:xs="http://www.w3.org/2001/XMLSchema-instance";
 xs:schemaLocation="http://drools.org/drools-5.0/process
drools-processes-5.0.xsd"
 type="RuleFlow" name="Number Guess" id="Number Guess"
package-name="com.sample" >

  

  
  
  
  

  

 

 

 

 



 

2009/6/10 Mauricio Salatino 

You can change that looking at the properties of the process. Clicking
in the background of the designer. 

 

2009/6/10 Tak-po Li http://takpo.li/> @gmail.com
 >

 

I look at Guess.rf the xml file.  I notice the Package and Import
locations are pointing to the old location.  After I change them to the
new one by hand.  The code works.

 

How can I change the above in Eclipse GUI interface?

 

Thanks,

 

Tak

 



 

2009/6/10 Mauricio Salatino 

java.lang.IllegalArgumentException: Unknown process ID: Number Guess 



That exceptions means that you probably don't add the process definition
to the current knowledgeBuilder.
To see these kind of problems you probably need to add something like
this after KnowledgeBuilder add calls:

if ( kbuilder.hasErrors() ) {

System.err.println( builder.getErrors().toString() );

}





 


2009/6/10 Tak-po Li http://takpo.li/> @gmail.com
 >

 

Mauricio, 

 

I would like to take this example as the base to play around.  That is
what I did:

 

1. Make a project "try" that generates the HellowWorld for me in
Eclipse.

 

2. add directory "log"

 

3. Move file Guess.java to the Java/com/sample directory.  Move
Guess.drl and Guss.rf to rule directory.

 

4. Change Package and Implort location from org/drools/examples to
com/sample in the above three files.

 

Eclipse shows compiler error pointing to ShoppingExample.class.  

 

I did the same to Shopping.java and Shopping.drl and the compiler error
is removed, and the following is the run time error messages:

 

Exception in thread "main" 

java.lang.IllegalArgumentException: Unknown process ID: Number Guess 

at org.drools.common.AbstractWorkingMemory.startProcess(

AbstractWorkingMemory.java:1615) 

at org.drools.common.AbstractWorkingMemory.startProcess(

AbstractWorkingMemory.java:1604) 

at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(

StatefulKnowledgeSessionImpl.java:267) 

at com.sample.NumberGuessExample.main(

NumberGuessExample.java:38)

Could you please point me the right direction?

 

Thanks,

 

Tak

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 

2009/6/10 Mauricio Salatino  

 

This is only a reference to know in which class loader is the
resource... The idea is to know that the resource (in this case:
NumberGuess.drl and NumberGuess.rf) is in the same class loader that the
ShoppingExample.class

2009/6/10 Tak-po Li http://takpo.li/> @gmail.com
 >

 

I am a newbie with Drools rules.  I just download the examples.
I notice in line19 of  NumberGuessExample.java, there are two statement
that referring to ShoppingExample.class.

 

It seems this is different example.  Could someone help me out?

 

Thanks,

 

Tak

 

  

kbuilder.add( ResourceFactory.newClassPathResource( 

"NumberGuess.drl", 

ShoppingExample.

class ), 

ResourceType.

DRL ); 

kbuilder.add( ResourceFactory.newClassPathResource( 

"NumberGuess.rf", 

ShoppingExample.

class ), 

ResourceType.

DRF );

 

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




-- 
- http://salaboy.wordpress.com  
- http://www.jbug.com.ar  
- Salatino "Salaboy" Mauricio -

___
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.

RE: [rules-users] re: NumberGuessExample

2009-06-10 Thread Malenfant, Andre
You have to open the constraints panel on the Split Node of the diagram
(Blue conditional ellipse) in the properties view in Ecplise...

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Tak-po Li
Sent: Wednesday, June 10, 2009 4:08 PM
To: Rules Users List
Subject: Re: [rules-users] re: NumberGuessExample

 

 

I look at Guess.rf the xml file.  I notice the Package and Import
locations are pointing to the old location.  After I change them to the
new one by hand.  The code works.

 

How can I change the above in Eclipse GUI interface?

 

Thanks,

 

Tak

 



 

2009/6/10 Mauricio Salatino 

java.lang.IllegalArgumentException: Unknown process ID: Number Guess 



That exceptions means that you probably don't add the process definition
to the current knowledgeBuilder.
To see these kind of problems you probably need to add something like
this after KnowledgeBuilder add calls:

if ( kbuilder.hasErrors() ) {

System.err.println( builder.getErrors().toString() );

}





 


2009/6/10 Tak-po Li http://takpo.li/> @gmail.com
 >

 

Mauricio, 

 

I would like to take this example as the base to play around.  That is
what I did:

 

1. Make a project "try" that generates the HellowWorld for me in
Eclipse.

 

2. add directory "log"

 

3. Move file Guess.java to the Java/com/sample directory.  Move
Guess.drl and Guss.rf to rule directory.

 

4. Change Package and Implort location from org/drools/examples to
com/sample in the above three files.

 

Eclipse shows compiler error pointing to ShoppingExample.class.  

 

I did the same to Shopping.java and Shopping.drl and the compiler error
is removed, and the following is the run time error messages:

 

Exception in thread "main" 

java.lang.IllegalArgumentException: Unknown process ID: Number Guess 

at org.drools.common.AbstractWorkingMemory.startProcess(

AbstractWorkingMemory.java:1615) 

at org.drools.common.AbstractWorkingMemory.startProcess(

AbstractWorkingMemory.java:1604) 

at org.drools.impl.StatefulKnowledgeSessionImpl.startProcess(

StatefulKnowledgeSessionImpl.java:267) 

at com.sample.NumberGuessExample.main(

NumberGuessExample.java:38)

Could you please point me the right direction?

 

Thanks,

 

Tak

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 

2009/6/10 Mauricio Salatino  

 

This is only a reference to know in which class loader is the
resource... The idea is to know that the resource (in this case:
NumberGuess.drl and NumberGuess.rf) is in the same class loader that the
ShoppingExample.class

2009/6/10 Tak-po Li http://takpo.li/> @gmail.com
 >

 

I am a newbie with Drools rules.  I just download the examples.
I notice in line19 of  NumberGuessExample.java, there are two statement
that referring to ShoppingExample.class.

 

It seems this is different example.  Could someone help me out?

 

Thanks,

 

Tak

 

  

kbuilder.add( ResourceFactory.newClassPathResource( 

"NumberGuess.drl", 

ShoppingExample.

class ), 

ResourceType.

DRL ); 

kbuilder.add( ResourceFactory.newClassPathResource( 

"NumberGuess.rf", 

ShoppingExample.

class ), 

ResourceType.

DRF );

 

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




-- 
- http://salaboy.wordpress.com  
- http://www.jbug.com.ar  
- Salatino "Salaboy" Mauricio -

___
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




-- 
- http://salaboy.wordpress.com  
- http://www.jbug.com.ar  
- Salatino "Salaboy" Mauricio -


___
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] Constaint evaluation

2009-06-10 Thread Malenfant, Andre
Ok, so now I understand that the "immutable" is really a concept but not 
necessarily "enforced". So, the rule conditions get evaluated each time the 
working memory is updated (and not globals) and rules for which the conditions 
are true at each evaluation will fire. The execution of the rules will end when 
there is no more rules for which the conditions are true. Am I correct?

Thanks

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Greg Barton
Sent: Wednesday, June 10, 2009 3:49 PM
To: Rules Users List
Subject: RE: [rules-users] Constaint evaluation


The ideas is that objects in working memory are those that meant to be tracked: 
their changes are made visible to the rules via the insert/update/retract 
methods.  A global is not in working memory, so it's changes cannot be tracked. 
 You can change the contents of a global all day long and the rules would never 
be notified.

It's a similar concept to threads and synchronization.  You can have 
unsynchronized access to member variables in a class when in a multithreaded 
environment, but the results are unpredictable.  Likewise, you can use globals 
in conditions, and change the value of the global as you go, but the results 
are unpredictable.  

--- On Wed, 6/10/09, Malenfant, Andre  wrote:

> From: Malenfant, Andre 
> Subject: RE: [rules-users] Constaint evaluation
> To: "Kris Verlaenen" 
> Cc: "Rules Users List" 
> Date: Wednesday, June 10, 2009, 2:20 PM
> Thanks Kris,
> 
> I will try with code constraints.
> 
> But on the globals subject, I read in the documentation
> that one should not use a global in a rule. I have trouble
> understanding why. I don't think drools clones the global
> object (might not be possible anyway). If my rule
> consequences change the state of a global (this usage is
> considered valid as per the documentation as well) then what
> is the harm of using it in a condition? I could understand
> with immutable objects like String but...
> 
> I can change my code to insert that global in the working
> memory but I would like to understand why I should do so...
> And if I do and the state of that object is changed by a
> consequence of my rules, I have to call update? For the same
> reason? I guess I am trying to understand the underlying
> mechanism.
> 
> Thanks
> 
> 
> -Original Message-
> From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be]
> 
> Sent: Wednesday, June 10, 2009 11:38 AM
> To: Rules Users List; Malenfant, Andre
> Cc: Rules Users List
> Subject: Re: [rules-users] Constaint evaluation
> 
> It depends on what type of constraint you are using.
> 
> If you are using a rule constraint, that constraint will be
> evaluated
> just the same as normal rules.  This means that the
> constraints are
> evaluated when data is inserted / updated / removed. 
> Note that, if you
> want to make sure the engine is using up-to-date
> information, you must
> notify the engine (using update) when you change the data
> in the working
> memory.  Also note that globals are considered
> immutable.  You should
> never write rules that depend on the state of a global and
> where the
> global can be changed.
> 
> If you are using code constraints, the constraint is
> evaluated at the
> point the code constraint is reached.
> 
> Kris
> 
> Quoting "Malenfant, Andre" :
> 
> > I have some trouble understanding how conditions and
> constraints are
> > evaluated:
> > 
> > I have a rule flow split node with constraints on a
> global object.
> > The split node always takes the same path like if the
> constraints are
> > evaluated at the beginning of the execution of the
> process and not
> > when the process flow reaches that split node. What I
> would expect is
> > that the split node constraints takes into account the
> state of the
> > global object as modified by previous rules in the
> flow.
> > 
> > Am I right to think that rules conditions and split
> nodes constraints
> > are evaluated only when inserting/updating objects in
> the working
> > memory? The documentation is not really useful (unless
> I haven't
> > found the appropriate one).
> > 
> > Thanks
> > 
> > André
> > 
> > -Original Message-
> > From: rules-users-boun...@lists.jboss.org
> > [mailto:rules-users-boun...@lists.jboss.org]
> On Behalf Of Malenfant,
> > Andre
> > Sent: Wednesday, June 10, 2009 11:07 AM
> > To: Kris Verlaenen
> > Cc: Rules Users List
> > Subject: RE: [rules-users] Globals in ruleflow
> > 
> &

RE: [rules-users] Constaint evaluation

2009-06-10 Thread Malenfant, Andre
Yes, it does answer my question. Thanks!

-Original Message-
From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
Sent: Wednesday, June 10, 2009 3:54 PM
To: Malenfant, Andre
Cc: Rules Users List
Subject: RE: [rules-users] Constaint evaluation

Globals are mostly used to register a reference to some element so that
it can easily be references from inside rules.  For example, you could
register an element where you add results to in rule consequence, you
can add a reference to an external data service where data can be
retrieved, etc.

Globals are however considered immutable (for performance reasons, so we
do not need to re-evaluate rules that use a global constantly).  If you
have data that your rule conditions reason on and that cannot be
considered immutable, you should insert it as a fact in the session, as
that is just how the algorithm works, it expects data that it needs to
reason on and that is mutable to be in the working memory.

Hope this kinda answers your question.

Kris

Quoting "Malenfant, Andre" :

> Thanks Kris,
> 
> I will try with code constraints.
> 
> But on the globals subject, I read in the documentation that one
> should not use a global in a rule. I have trouble understanding why.
> I don't think drools clones the global object (might not be possible
> anyway). If my rule consequences change the state of a global (this
> usage is considered valid as per the documentation as well) then what
> is the harm of using it in a condition? I could understand with
> immutable objects like String but...
> 
> I can change my code to insert that global in the working memory but
> I would like to understand why I should do so...
> And if I do and the state of that object is changed by a consequence
> of my rules, I have to call update? For the same reason? I guess I am
> trying to understand the underlying mechanism.
> 
> Thanks
> 
> 
> -Original Message-
> From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
> Sent: Wednesday, June 10, 2009 11:38 AM
> To: Rules Users List; Malenfant, Andre
> Cc: Rules Users List
> Subject: Re: [rules-users] Constaint evaluation
> 
> It depends on what type of constraint you are using.
> 
> If you are using a rule constraint, that constraint will be
> evaluated
> just the same as normal rules.  This means that the constraints are
> evaluated when data is inserted / updated / removed.  Note that, if
> you
> want to make sure the engine is using up-to-date information, you
> must
> notify the engine (using update) when you change the data in the
> working
> memory.  Also note that globals are considered immutable.  You
> should
> never write rules that depend on the state of a global and where the
> global can be changed.
> 
> If you are using code constraints, the constraint is evaluated at
> the
> point the code constraint is reached.
> 
> Kris
> 
> Quoting "Malenfant, Andre" :
> 
> > I have some trouble understanding how conditions and constraints
> are
> > evaluated:
> > 
> > I have a rule flow split node with constraints on a global object.
> > The split node always takes the same path like if the constraints
> are
> > evaluated at the beginning of the execution of the process and not
> > when the process flow reaches that split node. What I would expect
> is
> > that the split node constraints takes into account the state of
> the
> > global object as modified by previous rules in the flow.
> > 
> > Am I right to think that rules conditions and split nodes
> constraints
> > are evaluated only when inserting/updating objects in the working
> > memory? The documentation is not really useful (unless I haven't
> > found the appropriate one).
> > 
> > Thanks
> > 
> > André
> > 
> > -Original Message-
> > From: rules-users-boun...@lists.jboss.org
> > [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of
> Malenfant,
> > Andre
> > Sent: Wednesday, June 10, 2009 11:07 AM
> > To: Kris Verlaenen
> > Cc: Rules Users List
> > Subject: RE: [rules-users] Globals in ruleflow
> > 
> > Thanks for trying this for me...
> > 
> > As it turns out, while I was creating a test sample for you I
> > realized
> > that my ruleflow was not loading properly and I forgot to check
> for
> > errors on the builder. Now it works.
> > 
> > Still, the behavior is strange. If my rule doesn't load and even
> > though
> > my DRL loaded, my globals were not available. Since the DRL
> declared
> > the
> > same globals it should not have given me that error.
> > 
> > Thanks
> > 
> &g

RE: [rules-users] Constaint evaluation

2009-06-10 Thread Malenfant, Andre
Thanks Kris,

I will try with code constraints.

But on the globals subject, I read in the documentation that one should not use 
a global in a rule. I have trouble understanding why. I don't think drools 
clones the global object (might not be possible anyway). If my rule 
consequences change the state of a global (this usage is considered valid as 
per the documentation as well) then what is the harm of using it in a 
condition? I could understand with immutable objects like String but...

I can change my code to insert that global in the working memory but I would 
like to understand why I should do so...
And if I do and the state of that object is changed by a consequence of my 
rules, I have to call update? For the same reason? I guess I am trying to 
understand the underlying mechanism.

Thanks


-Original Message-
From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
Sent: Wednesday, June 10, 2009 11:38 AM
To: Rules Users List; Malenfant, Andre
Cc: Rules Users List
Subject: Re: [rules-users] Constaint evaluation

It depends on what type of constraint you are using.

If you are using a rule constraint, that constraint will be evaluated
just the same as normal rules.  This means that the constraints are
evaluated when data is inserted / updated / removed.  Note that, if you
want to make sure the engine is using up-to-date information, you must
notify the engine (using update) when you change the data in the working
memory.  Also note that globals are considered immutable.  You should
never write rules that depend on the state of a global and where the
global can be changed.

If you are using code constraints, the constraint is evaluated at the
point the code constraint is reached.

Kris

Quoting "Malenfant, Andre" :

> I have some trouble understanding how conditions and constraints are
> evaluated:
> 
> I have a rule flow split node with constraints on a global object.
> The split node always takes the same path like if the constraints are
> evaluated at the beginning of the execution of the process and not
> when the process flow reaches that split node. What I would expect is
> that the split node constraints takes into account the state of the
> global object as modified by previous rules in the flow.
> 
> Am I right to think that rules conditions and split nodes constraints
> are evaluated only when inserting/updating objects in the working
> memory? The documentation is not really useful (unless I haven't
> found the appropriate one).
> 
> Thanks
> 
> André
> 
> -Original Message-
> From: rules-users-boun...@lists.jboss.org
> [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Malenfant,
> Andre
> Sent: Wednesday, June 10, 2009 11:07 AM
> To: Kris Verlaenen
> Cc: Rules Users List
> Subject: RE: [rules-users] Globals in ruleflow
> 
> Thanks for trying this for me...
> 
> As it turns out, while I was creating a test sample for you I
> realized
> that my ruleflow was not loading properly and I forgot to check for
> errors on the builder. Now it works.
> 
> Still, the behavior is strange. If my rule doesn't load and even
> though
> my DRL loaded, my globals were not available. Since the DRL declared
> the
> same globals it should not have given me that error.
> 
> Thanks
> 
> -Original Message-
> From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
> Sent: Tuesday, June 09, 2009 5:51 PM
> To: Rules Users List; Malenfant, Andre
> Cc: Rules Users List
> Subject: Re: [rules-users] Globals in ruleflow
> 
> Andre,
> 
> There should be no problem in using the same global in both your
> rules
> and processes.
> 
> I have tried a simple example as you described but have not been able
> to
> reproduce the problem.  Could you send me a self-contained example
> that
> shows the issue?
> 
> Kris
> 
> Quoting "Malenfant, Andre" :
> 
> > I am experimenting with rule flows and I get the following error:
> > 
> > Unexpected global [myglobal]
> > 
> > When calling setGlobal on the session.
> > 
> > This code works without the workflow (globals declared in the drl)
> > but
> > fails when I include the rule flow. I declared the same globals in
> > the
> > rule flow in the header section.
> > 
> > ___
> > rules-users mailing list
> > rules-users@lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> > 
> 
> 
> 
> 
> 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] Constaint evaluation

2009-06-10 Thread Malenfant, Andre
I have some trouble understanding how conditions and constraints are evaluated:

I have a rule flow split node with constraints on a global object. The split 
node always takes the same path like if the constraints are evaluated at the 
beginning of the execution of the process and not when the process flow reaches 
that split node. What I would expect is that the split node constraints takes 
into account the state of the global object as modified by previous rules in 
the flow.

Am I right to think that rules conditions and split nodes constraints are 
evaluated only when inserting/updating objects in the working memory? The 
documentation is not really useful (unless I haven't found the appropriate one).

Thanks

André

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Malenfant, Andre
Sent: Wednesday, June 10, 2009 11:07 AM
To: Kris Verlaenen
Cc: Rules Users List
Subject: RE: [rules-users] Globals in ruleflow

Thanks for trying this for me...

As it turns out, while I was creating a test sample for you I realized
that my ruleflow was not loading properly and I forgot to check for
errors on the builder. Now it works.

Still, the behavior is strange. If my rule doesn't load and even though
my DRL loaded, my globals were not available. Since the DRL declared the
same globals it should not have given me that error.

Thanks

-Original Message-
From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
Sent: Tuesday, June 09, 2009 5:51 PM
To: Rules Users List; Malenfant, Andre
Cc: Rules Users List
Subject: Re: [rules-users] Globals in ruleflow

Andre,

There should be no problem in using the same global in both your rules
and processes.

I have tried a simple example as you described but have not been able to
reproduce the problem.  Could you send me a self-contained example that
shows the issue?

Kris

Quoting "Malenfant, Andre" :

> I am experimenting with rule flows and I get the following error:
> 
> Unexpected global [myglobal]
> 
> When calling setGlobal on the session.
> 
> This code works without the workflow (globals declared in the drl)
> but
> fails when I include the rule flow. I declared the same globals in
> the
> rule flow in the header section.
> 
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 




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] Globals in ruleflow

2009-06-10 Thread Malenfant, Andre
Thanks for trying this for me...

As it turns out, while I was creating a test sample for you I realized
that my ruleflow was not loading properly and I forgot to check for
errors on the builder. Now it works.

Still, the behavior is strange. If my rule doesn't load and even though
my DRL loaded, my globals were not available. Since the DRL declared the
same globals it should not have given me that error.

Thanks

-Original Message-
From: Kris Verlaenen [mailto:kris.verlae...@cs.kuleuven.be] 
Sent: Tuesday, June 09, 2009 5:51 PM
To: Rules Users List; Malenfant, Andre
Cc: Rules Users List
Subject: Re: [rules-users] Globals in ruleflow

Andre,

There should be no problem in using the same global in both your rules
and processes.

I have tried a simple example as you described but have not been able to
reproduce the problem.  Could you send me a self-contained example that
shows the issue?

Kris

Quoting "Malenfant, Andre" :

> I am experimenting with rule flows and I get the following error:
> 
> Unexpected global [myglobal]
> 
> When calling setGlobal on the session.
> 
> This code works without the workflow (globals declared in the drl)
> but
> fails when I include the rule flow. I declared the same globals in
> the
> rule flow in the header section.
> 
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 




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] Globals in ruleflow

2009-06-08 Thread Malenfant, Andre
I am experimenting with rule flows and I get the following error:

Unexpected global [myglobal]

When calling setGlobal on the session.

This code works without the workflow (globals declared in the drl) but
fails when I include the rule flow. I declared the same globals in the
rule flow in the header section.

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


RE: [rules-users] Templates / Generated rules debugging

2009-06-08 Thread Malenfant, Andre
Perfect!

B.T.W. I realized I can debug if I have drools sources and add a breakpoint at 
a strategic spot... Thanks

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ingomar Otter
Sent: Monday, June 08, 2009 12:47 PM
To: Rules Users List
Subject: Re: [rules-users] Templates / Generated rules debugging

Yes, check this out:
http://blog.athico.com/2008/02/looking-under-drools-skirt.html


Am 08.06.2009 um 18:34 schrieb Malenfant, Andre:

> Is it possible to see the generated Java code for the rules?
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org 
> [mailto:rules-users-boun...@lists.jboss.org 
> ] On Behalf Of Ingomar Otter
> Sent: Monday, June 08, 2009 12:00 PM
> To: Rules Users List
> Subject: Re: [rules-users] Templates / Generated rules debugging
>
>
>> -  Since this is a web application, I cannot debug the rules
> in Eclipse (unless I am missing something)
> You are missing something. :-) That's possible.
>
> However we have found regular debuggers "not to helpful".
> Have a look at the WorkingMemoryLoggers, they can give you a detailed
> insight of what's going on inside Drools, ie.
> * Facts inserted, changed, retracted
> * Activations
> * Rules fired
>
> 4.0.7: 
> http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/apidocs/org/drools/audit/WorkingMemoryFileLogger.html
> (The Drools Eclipse Plugin can be used to view these logs).
>
> To be useful, this requires a usable toString, we have created those
> using apache commmons-lang.
>
> Happy hunting!
>
>  -- Ingomar
>
>
>
> Am 08.06.2009 um 17:46 schrieb Malenfant, Andre:
>
>> Hi,
>>
>>
>>
>> Can some of your share your technique for debugging/troubleshooting
>> rules:
>>
>>
>>
>> Here is the situation:
>>
>>
>>
>> -  I have a web application that uses rules at specific
>> points.
>>
>> -  I use templates and decision tables so the actual rules
>> are compiled by my application using a spread sheet compiler.
>>
>> -  Since this is a web application, I cannot debug the rules
>> in Eclipse (unless I am missing something)
>>
>>
>>
>> I must not be the only one asking this question but I cannot find
>> answers in the archives.
>>
>>
>>
>> Thanks,
>>
>>
>>
>> André Malenfant
>>
>>
>>
>> ___
>> 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


RE: [rules-users] Templates / Generated rules debugging

2009-06-08 Thread Malenfant, Andre
Is it possible to see the generated Java code for the rules?

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ingomar Otter
Sent: Monday, June 08, 2009 12:00 PM
To: Rules Users List
Subject: Re: [rules-users] Templates / Generated rules debugging


 >-  Since this is a web application, I cannot debug the rules  
in Eclipse (unless I am missing something)
You are missing something. :-) That's possible.

However we have found regular debuggers "not to helpful".
Have a look at the WorkingMemoryLoggers, they can give you a detailed  
insight of what's going on inside Drools, ie.
* Facts inserted, changed, retracted
* Activations
* Rules fired

4.0.7: 
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/apidocs/org/drools/audit/WorkingMemoryFileLogger.html
(The Drools Eclipse Plugin can be used to view these logs).

To be useful, this requires a usable toString, we have created those  
using apache commmons-lang.

Happy hunting!

  -- Ingomar



Am 08.06.2009 um 17:46 schrieb Malenfant, Andre:

> Hi,
>
>
>
> Can some of your share your technique for debugging/troubleshooting  
> rules:
>
>
>
> Here is the situation:
>
>
>
> -  I have a web application that uses rules at specific  
> points.
>
> -  I use templates and decision tables so the actual rules  
> are compiled by my application using a spread sheet compiler.
>
> -  Since this is a web application, I cannot debug the rules  
> in Eclipse (unless I am missing something)
>
>
>
> I must not be the only one asking this question but I cannot find  
> answers in the archives.
>
>
>
> Thanks,
>
>
>
> André Malenfant
>
>
>
> ___
> 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] Templates / Generated rules debugging

2009-06-08 Thread Malenfant, Andre
Hi,

 

Can some of your share your technique for debugging/troubleshooting rules:

 

Here is the situation:

 

-  I have a web application that uses rules at specific points.

-  I use templates and decision tables so the actual rules are compiled 
by my application using a spread sheet compiler.

-  Since this is a web application, I cannot debug the rules in Eclipse 
(unless I am missing something)

 

I must not be the only one asking this question but I cannot find answers in 
the archives. 

 

Thanks,

 

André Malenfant

 

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


RE: [rules-users] Default rule

2009-06-04 Thread Malenfant, Andre
Thanks a lot, I am starting to see how I can use that...

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Garner, Shawn
Sent: Thursday, June 04, 2009 5:12 PM
To: Rules Users List
Subject: RE: [rules-users] Default rule


The ruleflow-group and the State Example from the documentation may be what 
you're looking for.

SG

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Malenfant, Andre
Sent: Thursday, June 04, 2009 3:47 PM
To: Rules Users List
Subject: RE: [rules-users] Default rule

Yes, but I will have to have a condition in that rule to prevent it from firing 
if others have. I will have to alter my data model to detect that situation. I 
can fix my problem using the salience parameter but I was wondering if there is 
was a built-in mechanism for that purpose.

I will try with the salience method

Thanks

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ingomar Otter
Sent: Thursday, June 04, 2009 4:28 PM
To: Rules Users List
Subject: Re: [rules-users] Default rule

How about if you create a rule with lowest salience, this will fire  
_after_ all other rules have fired.
Would this help?

Am 04.06.2009 um 22:17 schrieb Malenfant, Andre:

> Anyone knows if it is possible to have a `default` rule that would  
> fire only if others have not?
>
> Also, is there a way, using decision tables in XLS, to look if the  
> value of a field is contained in a list elsewhere in the XLS?
>
> Thanks
>
> André
>
> ___
> 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


-Message Disclaimer-

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to conn...@principal.com and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

While this communication may be used to promote or market a transaction
or an idea that is discussed in the publication, it is intended to provide
general information about the subject matter covered and is provided with
the understanding that The Principal is not rendering legal, accounting,
or tax advice. It is not a marketed opinion and may not be used to avoid
penalties under the Internal Revenue Code. You should consult with
appropriate counsel or other advisors on all matters pertaining to legal,
tax, or accounting obligations and requirements.


___
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] Default rule

2009-06-04 Thread Malenfant, Andre
Yes, but I will have to have a condition in that rule to prevent it from firing 
if others have. I will have to alter my data model to detect that situation. I 
can fix my problem using the salience parameter but I was wondering if there is 
was a built-in mechanism for that purpose.

I will try with the salience method

Thanks

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ingomar Otter
Sent: Thursday, June 04, 2009 4:28 PM
To: Rules Users List
Subject: Re: [rules-users] Default rule

How about if you create a rule with lowest salience, this will fire  
_after_ all other rules have fired.
Would this help?

Am 04.06.2009 um 22:17 schrieb Malenfant, Andre:

> Anyone knows if it is possible to have a `default` rule that would  
> fire only if others have not?
>
> Also, is there a way, using decision tables in XLS, to look if the  
> value of a field is contained in a list elsewhere in the XLS?
>
> Thanks
>
> André
>
> ___
> 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] Default rule

2009-06-04 Thread Malenfant, Andre
Anyone knows if it is possible to have a `default` rule that would fire only if 
others have not?

 

Also, is there a way, using decision tables in XLS, to look if the value of a 
field is contained in a list elsewhere in the XLS?

 

Thanks

 

André

 

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