Mark Proctor | 3 Jul 00:08 2007

[rules-dev] mini task? shape distribution

In the RuleFlow we have shape alignment, which is something I added a 
little while back, we don't have shape distribution - i.e. controlling 
the vertical and horizontal spacing between shapes, like in visio. 
Anyone want to take this task on? Would add a nice bit of polish to the IDE.

Mark
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Felipe Piccolini | 3 Jul 21:31 2007
Picon

[rules-dev] Re: [rules-users] Problem with update(fact)

Edson,

Thanks for the reply... it is nasty... 

Jira created...

Thanks

PD: duplicated email because I forgot to cut the huge-company-signature... :)

On 03-07-2007, at 14:18, Edson Tirelli wrote:


   Felipe,

   Ok, this is a nasty damn bug. :(

   I'm working on a solution for it right now. May I ask you please to open a JIRA for it and attach your code bellow?

   Thank you,
        Edson

2007/7/3, Felipe Piccolini <felipe.piccolini <at> bluesoft.cl>:
I know I already asked this in a previous email, but no answer and diferent subject... so I'll ask again 

I have an issue using update in 2 rules that update the same object... a loop is created even when I try to
avoid the loop adding an extra condition to each rule... Im inserting an ArrayList as a fact too, so I can check
the extra condition...

Can anyone tell me how to fix this?

Consider this:
//-------RULES-----------------------------
package cl.bluesoft.test

#list any import classes here.
import java.util.List
import java.util.ArrayList

import cl.bluesoft.test.rules.Fact

#declare any global variables here

rule "test update A"
    salience 699
    no-loop 
when
$f : Fact($n: number > 0)
$list: ArrayList( this excludes "key1")
then
System.out.println("A-fact number1:"+$f.getNumber()+ " list 1:"+$list);
$list.add( "key1");
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +$list);
end


rule "test update B"
    salience 699
    no-loop  
when
$f : Fact($n: number > 1)
$list: ArrayList( this excludes "key2" )
then
System.out.println( "B-fact number1:"+$f.getNumber()+" list 1:" +$list);
$list.add("key2" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("B-fact number2:" +$f.getNumber()+" list 2:"+$list);
end

//-------FACT-----------------------------
public class Fact implements Serializable {
private static final long serialVersionUID = 331627137981862975L;

private int number;

public Fact(int number){
this.number = number;
}

public Fact(){
this(0);
}

/**
 * <at> return the number
 */
public int getNumber() {
return number;
}

/**
 * <at> param number the number to set
 */
public void setNumber(int number) {
this.number = number;
}

}

//------TEST---------
public class TestUpdateFact implements Serializable {

private static final long serialVersionUID = -574789596641083743L;

/**
* <at> param args
*/
public static void main(String[] args) {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Package pkg = builder.getPackage();
.... 
WorkingMemory session = ruleBase.getStatefulSession();
...etc etc...

List list = new ArrayList();

Fact fact1 = new Fact(1);

session.fireAllRules();

....etc, etc...

}

}

//--------OUTPUT------------
A-fact number1:1 list 1:[]
A-fact number2:2 list 2:[key1]
B-fact number1:2 list 1:[key1]
B-fact number2:3 list 2:[key1, key2]
A-fact number1:3 list 1:[key1, key2]
A-fact number2:4 list 2:[key1, key2, key1]
B-fact number1:4 list 1:[key1, key2, key1]
B-fact number2:5 list 2:[key1, key2, key1, key2]
A-fact number1:5 list 1:[key1, key2, key1, key2]
A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]

.... for ever.....

So I have a loop... only when I use update and both rules...  condition about the
list not containing "key1" and "key2" seems not properly chequed... I dont know...

Can somebody help me? Am I missing something here?

Thanks.

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-users mailing list

                                                                        
Felipe Piccolini M.




_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Edson Tirelli | 3 Jul 22:40 2007

Re: [rules-dev] Re: [rules-users] Problem with update(fact)


   Felipe,

   Thanks. I'm working on it.

   BTW, I forgot to mention, what you are doing to control rules is a not a good way to do it. You should try agenda-group+lock-on-active rule attributes instead.
   Look at the conway's game of life as an example, and maybe help us document the feature... :)

   []s
   Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
Edson,

Thanks for the reply... it is nasty... 

Jira created...

Thanks

PD: duplicated email because I forgot to cut the huge-company-signature... :)

On 03-07-2007, at 14:18, Edson Tirelli wrote:


   Felipe,

   Ok, this is a nasty damn bug. :(

   I'm working on a solution for it right now. May I ask you please to open a JIRA for it and attach your code bellow?

   Thank you,
        Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
I know I already asked this in a previous email, but no answer and diferent subject... so I'll ask again 

I have an issue using update in 2 rules that update the same object... a loop is created even when I try to
avoid the loop adding an extra condition to each rule... Im inserting an ArrayList as a fact too, so I can check
the extra condition...

Can anyone tell me how to fix this?

Consider this:
//-------RULES-----------------------------
package cl.bluesoft.test

#list any import classes here.
import java.util.List
import java.util.ArrayList

import cl.bluesoft.test.rules.Fact

#declare any global variables here

rule "test update A"
    salience 699
    no-loop  
when
$f : Fact($n: number > 0)
$list: ArrayList( this excludes "key1" )
then
System.out.println( "A-fact number1:"+$f.getNumber()+ " list 1:"+$list);
$list.add( "key1" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +$list);
end


rule "test update B"
    salience 699
    no-loop  
when
$f : Fact($n: number > 1)
$list: ArrayList( this excludes "key2" )
then
System.out.println( "B-fact number1:" +$f.getNumber()+" list 1:" +$list);
$list.add("key2" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("B-fact number2:" +$f.getNumber()+ " list 2:"+$list);
end

//-------FACT-----------------------------
public class Fact implements Serializable {
private static final long serialVersionUID = 331627137981862975L;

private int number;

public Fact(int number){
this.number = number;
}

public Fact(){
this(0);
}

/**
 * <at> return the number
 */
public int getNumber() {
return number;
}

/**
 * <at> param number the number to set
 */
public void setNumber(int number) {
this.number = number;
}

}

//------TEST---------
public class TestUpdateFact implements Serializable {

private static final long serialVersionUID = -574789596641083743L;

/**
* <at> param args
*/
public static void main(String[] args) {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Package pkg = builder.getPackage();
.... 
WorkingMemory session = ruleBase.getStatefulSession();
...etc etc...

List list = new ArrayList();

Fact fact1 = new Fact(1);

session.fireAllRules();

....etc, etc...

}

}

//--------OUTPUT------------
A-fact number1:1 list 1:[]
A-fact number2:2 list 2:[key1]
B-fact number1:2 list 1:[key1]
B-fact number2:3 list 2:[key1, key2]
A-fact number1:3 list 1:[key1, key2]
A-fact number2:4 list 2:[key1, key2, key1]
B-fact number1:4 list 1:[key1, key2, key1]
B-fact number2:5 list 2:[key1, key2, key1, key2]
A-fact number1:5 list 1:[key1, key2, key1, key2]
A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]

.... for ever.....

So I have a loop... only when I use update and both rules...  condition about the
list not containing "key1" and "key2" seems not properly chequed... I dont know...

Can somebody help me? Am I missing something here?

Thanks.

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-users mailing list

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Mark Proctor | 4 Jul 03:24 2007

[rules-dev] mini task? execution wizard

It would be nice to right click a DRL and have Eclipse generate a .java 
file using a wizard to load and execute that DRL. The wizard can have 
settings for things like "add audit logger". Anyone want to give this a go?

Mark
_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Michael Neale | 4 Jul 06:45 2007
Picon

[rules-dev] manual for BRMS

Hi All.

There is a chapter on the BRMS (actually a few) - which will be part of the manual. I was thinking, should this be built into the BRMS (as part of the documentation build, a bit like with the IDE).

The options to vote for:

1) No, leave it in the manual as now - it will cause confusion if the same content is in 2 places
2) Put a copy of the whole manual on the BRMS web app, which can "popup" from the front screen of the app
3) Put JUST THE chapter on BRMS into the BRMS app etc?

Thoughts?

Michael.

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Michael Neale | 4 Jul 09:41 2007
Picon

[rules-dev] RuleAgent now available

As part of drools-core, there is a RuleAgent utility for automating runtime deployment. It has been written up in the manual, in the chapter on the BRMS.

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Adrian Paschke | 4 Jul 17:07 2007
Picon

[rules-dev] 2nd CfP RuleML-2007, Springer Confirmed, Submission Deadline Extended to July 20th

        [Apologies if you receive this more than once]

                  The International RuleML Symposium
             on Rule Interchange and Applications (RuleML-2007)

                   October 25-26, 2007, Orlando, Florida

                           http://2007.ruleml.org

Dear Colleagues,

Due to numerous requests about conflicting deadlines, and with Springer
as confirmed publisher, online submissions to RuleML-2007 will be
allowed until July 20 (hard deadline):

Abstract submission before         July 10, 2007
Paper submission due               July 20, 2007
Notification of acceptance         August 6, 2007
Final submissions due              August 23, 2007

The International RuleML Symposium on Rule Interchange and Applications
(RuleML-2007) will take place, October 25-26, 2007, in Orlando, Florida
http://2007.ruleml.org, co-located with The 10th International Business
Rules Forum <http://www.businessrulesforum.com>. RuleML-2007 is devoted
to practical distributed rule technologies and rule-based applications
which need language standards for rules operating in the context of,
e.g., the Semantic Web, Web 2.0/3.0, Intelligent Multi-Agent Systems,
Event-Driven Architectures, Service-Oriented Computing Applications and
Rule-based Enterprise Application Systems. A RuleML-2007 Challenge with
prizes will be organized to demonstrate tools, use cases, and applications.

            Call for Papers:  http://2007.ruleml.org/cfp.pdf

Highlights:

- Accepted papers will be published as Springer LNCS proceedings
- 2 Keynote speakers; Confirmed Keynote by J├╝rgen Angele (Ontoprise):

         "Rule-based Development Support in the Automotive Industry"

- In cooperation with ECCAI (confirmend) and IEEE Computer TCAAS
- Selection of revised papers will be resubmitted to a special journal issue
- Best Paper Award
- Prestigious prizes will be awarded to the first two best applications
of the Challenge
- Panel by world-class scientists and practitioners, featuring topics on
event and rule-based computing and industry success stories

Updates:

1) Modified Challenge Requirements:

"Submissions to the RuleML Challenge 2007 consist of a demo paper of 3-5
pages, describing the demo show case, and a link to more information
about the demo/show case, e.g. a project site, an online demonstration,
a presentation about the demonstration, or a download site for the
demonstration.

The show case should demonstrate the use of rules of various kinds in
interesting and practically relevant ways, preferably (but not
necessarily) embedded into a Web-based or distributed environment."

More information regarding submissions can be found in the RuleML-2007
web site:

http://2007.ruleml.org/index-Dateien/Page787.htm

2) Enhanced Topics:

- Rules in Web 2.0 and Web 3.0
- Rules in Semantic Web Technologies
- Rules in Web Intelligence Research

We invite submissions of full, short and demo papers related (but not
limited) to one or more of the topics listed at:

http://2007.ruleml.org/index-Dateien/Page431.htm

3)  All papers and demos will  be carefully peer-reviewed by 3 PC
members of the Program Committee:

http://2007.ruleml.org/index-Dateien/Page508.htm

Sincerely,

General Chair

Said Tabet, Inferware Corp.
stabet AT ruleml.org

Program Co-Chairs

Adrian Paschke, Technical University Munich, Germany
paschke AT in.tum.de
Yevgen Biletskiy, University of New Brunswick, Canada
biletski AT unb.ca

Challenge Co-Chairs

Alexander Kozlenkov, Betfair Ltd., London, UK
alex.kozlenkov AT betfair.com
Ralph Hodgson, TopQuadrant, Inc., Mountain View, USA
rhodgson AT topquadrant.com

Panel Chair

John Hall, Model Systems, UK
john.hall AT modelsys.com

Publicity Chair

Suzette Stoutenburg, MITRE Corporation, USA
suzette AT mitre.org

_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Felipe Piccolini | 4 Jul 14:10 2007
Picon

Re: [rules-dev] Re: [rules-users] Problem with update(fact)

...Always change the huge signature... sorry...

Edson,

   I tried what you said, but it is not the same... cant get the expected result.

With agenda-group the can control de flow, but outside the rules (auto-focus didnt work well),
and before that I prefer to use rule-flow-group (and use the GUI).

What Im trying to get is a set of rules that dont depend on flows or sequences to work together, because
this set of rules can be large and I dont want the business user have to check all rules to know how to write
the next rule... they must be writen in an independent way, but work together...

lock-on-active didnt work either to get that result, because when I use it stops activations, so the update(fact) actually
has no effect on other rules... I need to put wm.setFocus("group1");wm.setFocus("group2");..etc. at the java code...
I dont want to do that...

Maybe you can help me...

an example will be this...(pseudo code)

rule "base vacation days"
when
e: Employee( yearsInCompany > 1)
then
e.setVacationDays(10);
update(e);
end

rule "seniors extra vacation days"
when
e: Employee( yearsInCompany > 4, vd: vacationDays)
then
e.setVacationDays(vd+2);
update(e);
end

rule "old-employee extra vacation days"
when
e: Employee( yearsInCompany > 10, vd: vacationDays)
then
e.setVacationDays(vd+4);
update(e);
end

....and so on....

So I need the business ppl write this rules without knowing the rest of the rules... I think this is
the idea of having a rule-system...

Thanks.


On 03-07-2007, at 16:40, Edson Tirelli wrote:


   Felipe,

   Thanks. I'm working on it.

   BTW, I forgot to mention, what you are doing to control rules is a not a good way to do it. You should try agenda-group+lock-on-active rule attributes instead.
   Look at the conway's game of life as an example, and maybe help us document the feature... :)

   []s
   Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
Edson,

Thanks for the reply... it is nasty... 

Jira created...

Thanks

PD: duplicated email because I forgot to cut the huge-company-signature... :)

On 03-07-2007, at 14:18, Edson Tirelli wrote:


   Felipe,

   Ok, this is a nasty damn bug. :(

   I'm working on a solution for it right now. May I ask you please to open a JIRA for it and attach your code bellow?

   Thank you,
        Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
I know I already asked this in a previous email, but no answer and diferent subject... so I'll ask again 

I have an issue using update in 2 rules that update the same object... a loop is created even when I try to
avoid the loop adding an extra condition to each rule... Im inserting an ArrayList as a fact too, so I can check
the extra condition...

Can anyone tell me how to fix this?

Consider this:
//-------RULES-----------------------------
package cl.bluesoft.test

#list any import classes here.
import java.util.List
import java.util.ArrayList

import cl.bluesoft.test.rules.Fact

#declare any global variables here

rule "test update A"
    salience 699
    no-loop  
when
$f : Fact($n: number > 0)
$list: ArrayList( this excludes "key1" )
then
System.out.println( "A-fact number1:"+$f.getNumber()+ " list 1:"+$list);
$list.add( "key1" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +$list);
end


rule "test update B"
    salience 699
    no-loop  
when
$f : Fact($n: number > 1)
$list: ArrayList( this excludes "key2" )
then
System.out.println( "B-fact number1:" +$f.getNumber()+" list 1:" +$list);
$list.add("key2" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("B-fact number2:" +$f.getNumber()+ " list 2:"+$list);
end

//-------FACT-----------------------------
public class Fact implements Serializable {
private static final long serialVersionUID = 331627137981862975L;

private int number;

public Fact(int number){
this.number = number;
}

public Fact(){
this(0);
}

/**
 * <at> return the number
 */
public int getNumber() {
return number;
}

/**
 * <at> param number the number to set
 */
public void setNumber(int number) {
this.number = number;
}

}

//------TEST---------
public class TestUpdateFact implements Serializable {

private static final long serialVersionUID = -574789596641083743L;

/**
* <at> param args
*/
public static void main(String[] args) {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Package pkg = builder.getPackage();
.... 
WorkingMemory session = ruleBase.getStatefulSession();
...etc etc...

List list = new ArrayList();

Fact fact1 = new Fact(1);

session.fireAllRules();

....etc, etc...

}

}

//--------OUTPUT------------
A-fact number1:1 list 1:[]
A-fact number2:2 list 2:[key1]
B-fact number1:2 list 1:[key1]
B-fact number2:3 list 2:[key1, key2]
A-fact number1:3 list 1:[key1, key2]
A-fact number2:4 list 2:[key1, key2, key1]
B-fact number1:4 list 1:[key1, key2, key1]
B-fact number2:5 list 2:[key1, key2, key1, key2]
A-fact number1:5 list 1:[key1, key2, key1, key2]
A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]

.... for ever.....

So I have a loop... only when I use update and both rules...  condition about the
list not containing "key1" and "key2" seems not properly chequed... I dont know...

Can somebody help me? Am I missing something here?

Thanks.

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-users mailing list

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list

                                                                        
Felipe Piccolini M.




_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Felipe Piccolini | 3 Jul 23:09 2007
Picon

Re: [rules-dev] Re: [rules-users] Problem with update(fact)

Ok, I'll look at those features... and when I get them working I'll be pleased to help documenting them :) with examples...

Thanks.

On 03-07-2007, at 16:40, Edson Tirelli wrote:


   Felipe,

   Thanks. I'm working on it.

   BTW, I forgot to mention, what you are doing to control rules is a not a good way to do it. You should try agenda-group+lock-on-active rule attributes instead.
   Look at the conway's game of life as an example, and maybe help us document the feature... :)

   []s
   Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
Edson,

Thanks for the reply... it is nasty... 

Jira created...

Thanks

PD: duplicated email because I forgot to cut the huge-company-signature... :)

On 03-07-2007, at 14:18, Edson Tirelli wrote:


   Felipe,

   Ok, this is a nasty damn bug. :(

   I'm working on a solution for it right now. May I ask you please to open a JIRA for it and attach your code bellow?

   Thank you,
        Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
I know I already asked this in a previous email, but no answer and diferent subject... so I'll ask again 

I have an issue using update in 2 rules that update the same object... a loop is created even when I try to
avoid the loop adding an extra condition to each rule... Im inserting an ArrayList as a fact too, so I can check
the extra condition...

Can anyone tell me how to fix this?

Consider this:
//-------RULES-----------------------------
package cl.bluesoft.test

#list any import classes here.
import java.util.List
import java.util.ArrayList

import cl.bluesoft.test.rules.Fact

#declare any global variables here

rule "test update A"
    salience 699
    no-loop  
when
$f : Fact($n: number > 0)
$list: ArrayList( this excludes "key1" )
then
System.out.println( "A-fact number1:"+$f.getNumber()+ " list 1:"+$list);
$list.add( "key1" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +$list);
end


rule "test update B"
    salience 699
    no-loop  
when
$f : Fact($n: number > 1)
$list: ArrayList( this excludes "key2" )
then
System.out.println( "B-fact number1:" +$f.getNumber()+" list 1:" +$list);
$list.add("key2" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("B-fact number2:" +$f.getNumber()+ " list 2:"+$list);
end

//-------FACT-----------------------------
public class Fact implements Serializable {
private static final long serialVersionUID = 331627137981862975L;

private int number;

public Fact(int number){
this.number = number;
}

public Fact(){
this(0);
}

/**
 * <at> return the number
 */
public int getNumber() {
return number;
}

/**
 * <at> param number the number to set
 */
public void setNumber(int number) {
this.number = number;
}

}

//------TEST---------
public class TestUpdateFact implements Serializable {

private static final long serialVersionUID = -574789596641083743L;

/**
* <at> param args
*/
public static void main(String[] args) {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Package pkg = builder.getPackage();
.... 
WorkingMemory session = ruleBase.getStatefulSession();
...etc etc...

List list = new ArrayList();

Fact fact1 = new Fact(1);

session.fireAllRules();

....etc, etc...

}

}

//--------OUTPUT------------
A-fact number1:1 list 1:[]
A-fact number2:2 list 2:[key1]
B-fact number1:2 list 1:[key1]
B-fact number2:3 list 2:[key1, key2]
A-fact number1:3 list 1:[key1, key2]
A-fact number2:4 list 2:[key1, key2, key1]
B-fact number1:4 list 1:[key1, key2, key1]
B-fact number2:5 list 2:[key1, key2, key1, key2]
A-fact number1:5 list 1:[key1, key2, key1, key2]
A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]

.... for ever.....

So I have a loop... only when I use update and both rules...  condition about the
list not containing "key1" and "key2" seems not properly chequed... I dont know...

Can somebody help me? Am I missing something here?

Thanks.

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-users mailing list

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list



Atentamente,
______________________
Felipe Piccolini Marfull
Jefe de Proyectos
Agustina 1141 Piso 8-B
Santiago

 

Fono    +(56 2) 68830837
E-mail felipe.piccolini <at> bluesoft.cl






_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev
Felipe Piccolini | 4 Jul 13:42 2007
Picon

Re: [rules-dev] Re: [rules-users] Problem with update(fact)

Edson,

   I tried what you said, but it is not the same... cant get the expected result.

With agenda-group the can control de flow, but outside the rules (auto-focus didnt work well),
and before that I prefer to use rule-flow-group (and use the GUI).

What Im trying to get is a set of rules that dont depend on flows or sequences to work together, because
this set of rules can be large and I dont want the business user have to check all rules to know how to write
the next rule... they must be writen in an independent way, but work together...

lock-on-active didnt work either to get that result, because when I use it stops activations, so the update(fact) actually
has no effect on other rules... I need to put wm.setFocus("group1");wm.setFocus("group2");..etc. at the java code...
I dont want to do that...

Maybe you can help me...

an example will be this...(pseudo code)

rule "base vacation days"
when
e: Employee( yearsInCompany > 1)
then
e.setVacationDays(10);
update(e);
end

rule "seniors extra vacation days"
when
e: Employee( yearsInCompany > 4, vd: vacationDays)
then
e.setVacationDays(vd+2);
update(e);
end

rule "old-employee extra vacation days"
when
e: Employee( yearsInCompany > 10, vd: vacationDays)
then
e.setVacationDays(vd+4);
update(e);
end

....and so on....

So I need the business ppl write this rules without knowing the rest of the rules... I think this is
the idea of having a rule-system...

Thanks.

On 03-07-2007, at 16:40, Edson Tirelli wrote:


   Felipe,

   Thanks. I'm working on it.

   BTW, I forgot to mention, what you are doing to control rules is a not a good way to do it. You should try agenda-group+lock-on-active rule attributes instead.
   Look at the conway's game of life as an example, and maybe help us document the feature... :)

   []s
   Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
Edson,

Thanks for the reply... it is nasty... 

Jira created...

Thanks

PD: duplicated email because I forgot to cut the huge-company-signature... :)

On 03-07-2007, at 14:18, Edson Tirelli wrote:


   Felipe,

   Ok, this is a nasty damn bug. :(

   I'm working on a solution for it right now. May I ask you please to open a JIRA for it and attach your code bellow?

   Thank you,
        Edson

2007/7/3, Felipe Piccolini < felipe.piccolini <at> bluesoft.cl>:
I know I already asked this in a previous email, but no answer and diferent subject... so I'll ask again 

I have an issue using update in 2 rules that update the same object... a loop is created even when I try to
avoid the loop adding an extra condition to each rule... Im inserting an ArrayList as a fact too, so I can check
the extra condition...

Can anyone tell me how to fix this?

Consider this:
//-------RULES-----------------------------
package cl.bluesoft.test

#list any import classes here.
import java.util.List
import java.util.ArrayList

import cl.bluesoft.test.rules.Fact

#declare any global variables here

rule "test update A"
    salience 699
    no-loop  
when
$f : Fact($n: number > 0)
$list: ArrayList( this excludes "key1" )
then
System.out.println( "A-fact number1:"+$f.getNumber()+ " list 1:"+$list);
$list.add( "key1" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("A-fact number2:" +$f.getNumber()+" list 2:" +$list);
end


rule "test update B"
    salience 699
    no-loop  
when
$f : Fact($n: number > 1)
$list: ArrayList( this excludes "key2" )
then
System.out.println( "B-fact number1:" +$f.getNumber()+" list 1:" +$list);
$list.add("key2" );
$f.setNumber($n + 1);
update ($f);
update ($list);
System.out.println("B-fact number2:" +$f.getNumber()+ " list 2:"+$list);
end

//-------FACT-----------------------------
public class Fact implements Serializable {
private static final long serialVersionUID = 331627137981862975L;

private int number;

public Fact(int number){
this.number = number;
}

public Fact(){
this(0);
}

/**
 * <at> return the number
 */
public int getNumber() {
return number;
}

/**
 * <at> param number the number to set
 */
public void setNumber(int number) {
this.number = number;
}

}

//------TEST---------
public class TestUpdateFact implements Serializable {

private static final long serialVersionUID = -574789596641083743L;

/**
* <at> param args
*/
public static void main(String[] args) {
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
Package pkg = builder.getPackage();
.... 
WorkingMemory session = ruleBase.getStatefulSession();
...etc etc...

List list = new ArrayList();

Fact fact1 = new Fact(1);

session.fireAllRules();

....etc, etc...

}

}

//--------OUTPUT------------
A-fact number1:1 list 1:[]
A-fact number2:2 list 2:[key1]
B-fact number1:2 list 1:[key1]
B-fact number2:3 list 2:[key1, key2]
A-fact number1:3 list 1:[key1, key2]
A-fact number2:4 list 2:[key1, key2, key1]
B-fact number1:4 list 1:[key1, key2, key1]
B-fact number2:5 list 2:[key1, key2, key1, key2]
A-fact number1:5 list 1:[key1, key2, key1, key2]
A-fact number2:6 list 2:[key1, key2, key1, key2, key1]
B-fact number1:6 list 1:[key1, key2, key1, key2, key1]
B-fact number2:7 list 2:[key1, key2, key1, key2, key1, key2]
A-fact number1:7 list 1:[key1, key2, key1, key2, key1, key2]
A-fact number2:8 list 2:[key1, key2, key1, key2, key1, key2, key1]
B-fact number1:8 list 1:[key1, key2, key1, key2, key1, key2, key1]

.... for ever.....

So I have a loop... only when I use update and both rules...  condition about the
list not containing "key1" and "key2" seems not properly chequed... I dont know...

Can somebody help me? Am I missing something here?

Thanks.

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-users mailing list
rules-users <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-users mailing list

                                                                        
Felipe Piccolini M.





_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




--
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat <at> www.jboss.com
_______________________________________________
rules-dev mailing list



Atentamente,
______________________
Felipe Piccolini Marfull
Jefe de Proyectos
Agustina 1141 Piso 8-B
Santiago

 

Fono    +(56 2) 68830837
E-mail felipe.piccolini <at> bluesoft.cl






_______________________________________________
rules-dev mailing list
rules-dev <at> lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Gmane