Re: [rules-users] Updation of variables within rule table and use of it in other rule table

2012-07-12 Thread Wolfgang Laun
Two options when using update or modify:
 (a) add a Condition x,b == null (or some other value representing
"undefined") to the rule in X
(b) add rule attribute "no-loop true" to the rule in X

-W

On 13/07/2012, debchamps  wrote:
> RuleTable X   
>   Condition  Action
>   x.a == $1 x.b = $param
>   1   2
>   
>   
> RuleTable Y   
>   ConditionAction
>   x.b == $param   System.out.println("HELLO")
>   2   
>
> Now both this rules are in same xls file. So what I want is the b to get
> updated when RuleTable X is used and when RuleTable Y is used the updation
> should reflect when the rules are getting executed.
>
> Is there any way of doing it. I did update() but ended up in infinite loop.
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Updation-of-variables-within-rule-table-and-use-of-it-in-other-rule-table-tp4018647.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Is it possible to serialzie the stateful session without stoping executing rules?

2012-07-12 Thread chrisLi
Thank you very much, laune

--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-it-possible-to-serialzie-the-stateful-session-without-stoping-executing-rules-tp4018645p4018648.html
Sent from the Drools: User forum 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] Updation of variables within rule table and use of it in other rule table

2012-07-12 Thread debchamps
RuleTable X 
Condition  Action
x.a == $1 x.b = $param
1   2


RuleTable Y 
ConditionAction
x.b == $param   System.out.println("HELLO")
2   

Now both this rules are in same xls file. So what I want is the b to get
updated when RuleTable X is used and when RuleTable Y is used the updation
should reflect when the rules are getting executed.

Is there any way of doing it. I did update() but ended up in infinite loop.

Thanks



 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Updation-of-variables-within-rule-table-and-use-of-it-in-other-rule-table-tp4018647.html
Sent from the Drools: User forum 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] Is it possible to serialzie the stateful session without stoping executing rules?

2012-07-12 Thread Wolfgang Laun
Serializing any amount of data while other threads might change that data
entails the risk of creating an inconsistent snapshot. Mutual exclusion
(locking) would be one way, but since there's no progress during this time
anyway you might as well stop the session.

If you have the memory, serialize to a byte[] and write this out to
secondary storage after restarting.

-W



On 13 July 2012 03:23, chrisLi  wrote:

> Hi, droolers,
>
> I need to serialize the session as a snapshot at 23:00 pm every day. So I
> want to do the serialization work
>
> in a different thread with session execution.
>
> Is it possible? Or is there any risk?
>
> Thank you  very much
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Is-it-possible-to-serialzie-the-stateful-session-without-stoping-executing-rules-tp4018645.html
> Sent from the Drools: User forum 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


[rules-users] Is it possible to serialzie the stateful session without stoping executing rules?

2012-07-12 Thread chrisLi
Hi, droolers,

I need to serialize the session as a snapshot at 23:00 pm every day. So I
want to do the serialization work 

in a different thread with session execution.

Is it possible? Or is there any risk?

Thank you  very much 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Is-it-possible-to-serialzie-the-stateful-session-without-stoping-executing-rules-tp4018645.html
Sent from the Drools: User forum 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] Serialization issue with StateKnowledgeSession

2012-07-12 Thread chrisLi
, I looked into Marshaller's API, and find the following method:

StatefulKnowledgeSessionunmarshall(InputStream stream,
KnowledgeSessionConfiguration config, Environment environment) 

which can take a KnowledgeSessionConfiguration parameter. With it we can
configure the deserialized stateful session.

Thank you very much.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Serialization-issue-with-StateKnowledgeSession-tp4018643p4018644.html
Sent from the Drools: User forum 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] Serialization issue with StateKnowledgeSession

2012-07-12 Thread chrisLi
Hi, all

I have a requirement to serialzie a stateful session as a snapshot.

private void serialize(OutputStream out) throws IOException{
System.out.println("writing");
DroolsObjectOutputStream droolsOut = new 
DroolsObjectOutputStream(
(OutputStream) out);
droolsOut.writeLong(counter);
droolsOut.writeLong(clock.getCurrentTime());
droolsOut.writeObject(this.knowledgeBase);

Marshaller marshaller = 
createSerializableMarshaller(this.knowledgeBase);
marshaller.marshall(droolsOut, this.session);

droolsOut.close();
System.out.println("written");
}

I used the above code to serialize the knowledgebase and session into a file
simultaneously and it works well. Then I used the following code to attempt
to deserialize them, but I failed. 

  private void deserialize(InputStream in) throws IOException, 
ClassNotFoundException {
System.out.println("reading");
DroolsObjectInputStream droolsIn = new DroolsObjectInputStream(
(InputStream) in);
this.counter = droolsIn.readLong();
long clockTime = droolsIn.readLong();
this.knowledgeBase = (KnowledgeBase) droolsIn.readObject();

Marshaller marshaller = 
createSerializableMarshaller(this.knowledgeBase);
this.session = marshaller.unmarshall(droolsIn);

this.session.getSessionConfiguration().setOption(ClockTypeOption.get("pseudo"));
this.clock = (PseudoClockScheduler) session.getSessionClock();
this.clock.setStartupTime(clockTime);
droolsIn.close();
System.out.println("read");
}

In my other codes, I set the clock type of session to "pseudo" with a
KnowledgeSessionConfiguration 

instance. However, when I serialized it, it's clock type was "realtime". It
seems that the some of session's

fields were not serialized.

So, I wonder are there any other ways to serialize a session? I heard about
XStream, is it appropriate to 

serialize a session. And how?

Or, are there methods allowing me to set the clock type of a session to
"pseudo" after deserializing it?

Thank you very much!

  



 


--
View this message in context: 
http://drools.46999.n3.nabble.com/Serialization-issue-with-StateKnowledgeSession-tp4018643.html
Sent from the Drools: User forum 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] Planner - Initialized solution & local search

2012-07-12 Thread Garf
I figured out the problem.

DefaultSolver.runSolverPhases() will go through each phase, and will revert
the changes if they're not better. Or, more exactly, here are lines 191-193:

if (it.hasNext()) {
// solverScope.setWorkingSolutionFromBestSolution();
}

Now, if this involved setting the planning variables for the first time,
those will be reverted.

There's a few ways of tackling this, some of which are on the user end, such
as a adding a hard constraint to penalize the solution if the planning
variable isn't set.

Jon

--
View this message in context: 
http://drools.46999.n3.nabble.com/Planner-Initialized-solution-local-search-tp4018594p4018642.html
Sent from the Drools: User forum 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] Compiled rules differ KnowledgeAgent vs ResourceChangeScanner

2012-07-12 Thread lhorton
I did a bad job of linking in the spreadsheet in my prior post, but it seems
to show up ok as link, though it's in the midst of the code snippet.

I wanted to mention, lest people think I don't know how to set up Spring
configs, that my spring xml loads dozens of rules files containing thousands
of rules, and all of them work fine except the one drl file that exhibits
the odd behavior that I'm discussing in this thread.

I'm getting around the problem for now by precompiling the errant rules file
into pkg, and loading that via Spring instead of the drl.  Initial testing
of the pkg indicates it loads properly the first time.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Compiled-rules-differ-KnowledgeAgent-vs-ResourceChangeScanner-tp4018608p4018641.html
Sent from the Drools: User forum 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] Compiled rules differ KnowledgeAgent vs ResourceChangeScanner

2012-07-12 Thread lhorton
I did some more research on this problem but am at a loss for an answer. I'd
appreciate any further ideas for troubleshooting.   

I added some code to my server to display the fields of one of the rules
that does not run until it is reloaded by the resource change scanner.  I
captured the field values before and after the reload of the drl file, and
compared the values of the fields.  The only field in which I can see a
change of value is loadOrder.

This test proved the rule is present in the knowledge base in in the
"before" case (i.e. the rule is there when first loaded, but it does not
fire).

I'm attaching the spreadsheet that compares the fields before (rule did not
fire) and after (rule file reloaded and rule does fire as expected).

This is the code I wrote to capture the field values using reflection.

for (KnowledgePackage knowledgePackage :
workflowKnowledgeBase.getKnowledgePackages()) {
Class clazz = RuleImpl.class;
Field ruleField = clazz.getDeclaredField("rule");
ruleField.setAccessible(true);
for (Rule rule : knowledgePackage.getRules()) {
System.out.println(rule.getPackageName() + " " + rule.getName() 
+ " ");
Rule innerRule = (Rule) ruleField.get(rule);
Field[] fields = innerRule.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
if (field.getType().isArray() && field.get(innerRule) 
!= null) {
String[] strs = (String[]) field.get(innerRule);
StringBuffer buf = new StringBuffer();
http://drools.46999.n3.nabble.com/file/n4018640/rulesTest.xls rulesTest.xls 
for (String s : strs) {
buf.append(s);
buf.append(" ");
}
System.out.println("," + field.getName() + "," +
field.getType().getSimpleName() + "," + field.getGenericType() + "," +
buf.toString());
} else {
System.out.println("," + field.getName() + "," +
field.getType().getSimpleName() + "," + field.getGenericType() + "," +
field.get(innerRule));
}
}
}
}


--
View this message in context: 
http://drools.46999.n3.nabble.com/Compiled-rules-differ-KnowledgeAgent-vs-ResourceChangeScanner-tp4018608p4018640.html
Sent from the Drools: User forum 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] Change Scanner does not start

2012-07-12 Thread Antonio Anderson Souza
Dear All,

I discovered why the rules stopped working after ChangeScanner starts the
problem is the issue
JBRULES-2947
.

To fix the problem I changed my models to a POJO package instead of the
Described in the Guvnor (the solution was found in this thread
http://drools.46999.n3.nabble.com/drools-server-resource-change-scanner-notifier-td2649325.html),
after that when I start the Change Scanner by the jsp DroolsServer detects
changes in the rules stored in Guvnor, and fire all rules properly.

The unique problem that persists is the Change Scanner start that i need to
call it in the JSP mannually, I'll automate in the the application start.

Best Regards,

Antonio Anderson Souza

 


Blog  - Twitter -
LinkedIn  -
Facebook



On Wed, Jul 11, 2012 at 7:53 PM, Antonio Anderson Souza <
antonio...@gmail.com> wrote:

> Dear All,
>
> I have an application that use Guvnor 5.4.0 final as the rules repository
> and a DroolsServer 5.4.0 final (with Spring Camel) to provide rule engine
> via a Rest Webservices, all of those apps Running in a JBossAS 7.1.
>
> All of the service are working perfectly, except the
> resource-change-scanner that is configured in the knowledge-services.xml
> [1] as it's described in the documentation.
>
> When Drools-Server are deployed the Change Scanner does not start (I'm
> monitoring the change scanner via Wireshark analyzing the communication
> between DroolServer and Guvnor), I've created an small JSP file [2] that
> invoke the ChangeScanner start method, when i run the JSP the Change
> Scanner start to work (i can see the http requests from Drools Server do
> Guvnor to see if the knowledge base had changed), but after Change Scanner
> started working the rules are not triggered anymore.
>
> So without Change Scanner I've all of the knowledge service running
> properly, but the App is unable to detect rules changes, when I explicitly
> (via JSP) start the Change Scanner all of the knowledge service stopped
> working.
>
> Change Scanner starts automatically?
>
> Does anybody has some idea to help me?
>
> [1]
> 
> http://www.springframework.org/schema/beans";
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>xmlns:drools="http://drools.org/schema/drools-spring";
>xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>http://drools.org/schema/drools-spring
> http://drools.org/schema/drools-spring-1.3.0.xsd";>
>   
>   
>   
>   
> 
>   
> 
>   
>node="node1"/>
> 
>
> [2]
> 
> <%@ page language="java" contentType="text/html; charset=utf-8" %>
> <%
> org.drools.io.ResourceChangeScannerConfiguration sconf =
> org.drools.io.ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
> sconf.setProperty("drools.resource.scanner.interval", "5");
>
> org.drools.io.ResourceFactory.getResourceChangeScannerService().configure(sconf);
> org.drools.io.ResourceFactory.getResourceChangeScannerService().start();
> org.drools.io.ResourceFactory.getResourceChangeNotifierService().start();
> %>
>
> Best Regards,
>
> Antonio Anderson Souza
>
>  
> 
>
> Blog  - Twitter -
> LinkedIn  - 
> Facebook
>
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] FireUntilHalt

2012-07-12 Thread crajor
Thanks for your comment, Edson.

I have been using 5.3.0.Final.  I could easily move to 5.4.0.Final but I
don't see any of the 5.4.x branches at Maven Central.  Is there another
repository that has more up to date releases?

Craig

--
View this message in context: 
http://drools.46999.n3.nabble.com/FireUntilHalt-tp4018610p4018638.html
Sent from the Drools: User forum 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] simple Doubt..usage of modify

2012-07-12 Thread abhinay_agarwal
ok..i get it !!! 


thanks for the help laune !!

--
View this message in context: 
http://drools.46999.n3.nabble.com/simple-Doubt-usage-of-modify-tp4018614p4018636.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
this is the exact code :

rule "Not Threshold Rule"
salience -3
agenda-group "default"
no-loop
//lock-on-active true
dialect "mvel"
when
$a : AccountStatusVO() 
 $h : HashMap(!(this["Aggregate_Balance"]<=5))
then
 drools.setFocus("customer");
drools.getWorkingMemory().clearAgendaGroup("default");
end

rule "Primary Customer"
salience 1
agenda-group "customer"
no-loop
dialect "mvel" 
when
$i : Individual()
$h : HashMap()

then
insert($i.primaryCustomerMapping($h))
drools.setFocus("USIndicia")
 
drools.getWorkingMemory().clearAgendaGroup("customer");

end


rule "Secondary Customer"
salience 0
agenda-group "customer"
no-loop
dialect "mvel" 
when
$i : Individual()
$h : HashMap()
then
insert($i.secondaryCustomerMapping(map))
drools.setFocus("USIndicia")

drools.getWorkingMemory().clearAgendaGroup("customer");

end

rule "Tertiary Customer"
salience -1
agenda-group "customer"
no-loop
dialect "mvel" 
when
$i : Individual()
$h : HashMap()
then
insert($i.tertiaryCustomerMapping($h))
drools.setFocus("USIndicia")
drools.getWorkingMemory().clearAgendaGroup("customer");
end

rule "US Indicia Rule"
salience 1
agenda-group "USIndicia"
no-loop
dialect "mvel"
when
$c : CustomerStatusVO()
 $h : HashMap(this["Primary_Citizenship"] == "USA")
then
$c.setCustIndicia("US Individual")
 drools.setFocus("USIndiciaDocumentsRequired");
drools.getWorkingMemory().clearAgendaGroup("USIndicia");

end


rule "US Indicia Documents Required"
salience 1
agenda-group "USIndiciaDocumentsRequired"
no-loop
 
when
$i : Individual()
$c : CustomerStatusVO()
$h : HashMap(this["Primary_Citizenship"] == "USA")
then
modify( $c )
{
setDocumentsRequired("W-9 Form, Waiver Document");
};
retract($h)
end




>From here you can see that the map in "Not threshold rule" contains the
details about primary, secondary and tertiary customers...

i gotta divide the customers and then fire rule "US indicia" and hence "US
Indicia Documents Required" on them..

once Primary customer work is done..i need to go back and apply both the
rules for "secondary"

and again for tertiary...

if i use : 

rule "Primary Customer"
salience 1
agenda-group "customer"
no-loop
dialect "mvel" 
when
$i : Individual()
$h : HashMap()

then
insert($i.primaryCustomerMapping($h))
drools.setFocus("USIndicia")
 * retract($h)*

drools.getWorkingMemory().clearAgendaGroup("customer");

end


but i need the main map for secondary and tertiary...

can sme1 find a work around...

i need to do evrything in drool rules only...cant use the java class to
insert or retract nething !!


Thanks,
Abhinay

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018635.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
hey laune,

yeah yu are very correct in rule 3, i m using something as 

insert($i.tertiaryCustomerMapping($h))

coz i need a part of the map for further calculations...(calling other rules
from rule 3)

so now what i can do is to use 

retract($h)...after the insert($i.tertiaryCustomerMapping($h))

but the problem is i need the map($h) in rule 2...once i retract the map..i
wont be able to use it any more in my rule "2"...

is there a work around, by which i may be able 2 achieve this ???

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018634.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread Wolfgang Laun
You must have more than one Account or more than one HashMap in your
Working Memory. Other than this, there's no way rule 1 can fire a
second time.

-W



On 12/07/2012, abhinay_agarwal  wrote:
> STACK [MAIN]
>
> when initially the focus is set on agenda-group "1" , rule 1 fires...and it
> should get fire..since its salience value is greater than that of rule
> "2"..
>
> STACK [MAIN, 1]
>
> now when the agenda group is set to 2, rule 3 will fire...itzz al ok..
>
> STACK [MAIN, 1, 2]
>
> since rule 3 has no-loop, so it willl not get-refired !!
>
> STACK [MAIN, 1]
>
> now again the focus is set to agenda-group "1", and the condition of rule
> "1" meets again and it again gets fired..
> BUT, this time is dont want my rule "1" to get fired, i want the rule "2"
> to
> get fired which has lower salience value than rule "1" but is in the same
> agenda-group "1"...
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018631.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] simple Doubt..usage of modify

2012-07-12 Thread Wolfgang Laun
Without modify (or update) the Drools Engine is not aware of the
change caused by the setter. See the Expert manual for further
details.
-W

On 12/07/2012, abhinay_agarwal  wrote:
> what is unclear in my mind is, if we can use something like this :
>
> when
>$c: Customer()
> then
>   $c.setName("abhinay")
>
>
> then y do we use:
>
> when
>$c: Customer()
> then
>   modify($c)
>   {
> setName("abhinay")
>}
>
> I simply dont get the difference !!
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/simple-Doubt-usage-of-modify-tp4018614p4018629.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
STACK [MAIN]

when initially the focus is set on agenda-group "1" , rule 1 fires...and it
should get fire..since its salience value is greater than that of rule "2"..

STACK [MAIN, 1]

now when the agenda group is set to 2, rule 3 will fire...itzz al ok..

STACK [MAIN, 1, 2]

since rule 3 has no-loop, so it willl not get-refired !!

STACK [MAIN, 1]

now again the focus is set to agenda-group "1", and the condition of rule
"1" meets again and it again gets fired..
BUT, this time is dont want my rule "1" to get fired, i want the rule "2" to
get fired which has lower salience value than rule "1" but is in the same
agenda-group "1"...

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018631.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread Michael Anstis
So you're saying a knowledge base consisting of only the following causes
rule 1 to re-fire?

rule "rule1"
agenda-group "1"
salience 0
when
  $a : Account()
   $h : HashMap(!(this["Aggregate_Balance"]<=5))
then
  setFocus("2");
end

Is it *re-firing* or firing for each fact you insert that matches?


On 12 July 2012 10:23, abhinay_agarwal  wrote:

> m still working on it..but those rules will not change anything on which
> rule
> "1" depends..
>
> for the time being you can ignore that rule "2" has a setFocus.Consider the
> rule "2" as
>
> rule "rule2"
>
> agenda-group "1"
> salience -1
> when
>
>$c : Customer()
> then
>$c.setName("Abhinay")
> end
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018628.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] simple Doubt..usage of modify

2012-07-12 Thread abhinay_agarwal
what is unclear in my mind is, if we can use something like this :

when
   $c: Customer()
then
  $c.setName("abhinay")


then y do we use:

when
   $c: Customer()
then
  modify($c)
  {
setName("abhinay")
   }

I simply dont get the difference !!

--
View this message in context: 
http://drools.46999.n3.nabble.com/simple-Doubt-usage-of-modify-tp4018614p4018629.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
m still working on it..but those rules will not change anything on which rule
"1" depends..

for the time being you can ignore that rule "2" has a setFocus.Consider the
rule "2" as

rule "rule2"

agenda-group "1"
salience -1
when

   $c : Customer()
then
   $c.setName("Abhinay")
end




--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018628.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread Michael Anstis
What rules are in agenda-group 3?

On 12 July 2012 09:58, abhinay_agarwal  wrote:

> rule "rule1"
> agenda-group "1"
> salience 0
> when
>
>$a : Account()
>$h : HashMap(!(this["Aggregate_Balance"]<=5))
>
> then
>   setFocus("2")
> end
>
>
>
> rule "rule2"
>
> agenda-group "1"
> salience -1
> when
>$c : Customer()
> then
>setFocus(3)
> end
>
>
> rule "rule3"
> agenda-group "2"
> salience 0
> when
>$c : Customer()
>$h : HashMap(this["customerName"]=="Abhinay" ||
>this["accountType"]=="Single")
> then
>$c.setStatus("OK")
> end
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018625.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] simple Doubt..usage of modify

2012-07-12 Thread Wolfgang Laun
On 12/07/2012, abhinay_agarwal  wrote:
> i had already read about it, but did not get a clear picture..so raised the
> question here..

If you could pinpoint the mistiness it might be possible to clear it up.
-W

>
> Thanks,
> Abhinay
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/simple-Doubt-usage-of-modify-tp4018614p4018620.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
rule "rule1"
agenda-group "1"
salience 0
when

   $a : Account()
   $h : HashMap(!(this["Aggregate_Balance"]<=5))

then
  setFocus("2")
end



rule "rule2"

agenda-group "1"
salience -1
when
   $c : Customer()
then
   setFocus(3)
end


rule "rule3"
agenda-group "2"
salience 0
when
   $c : Customer()
   $h : HashMap(this["customerName"]=="Abhinay" ||
   this["accountType"]=="Single")
then
   $c.setStatus("OK")
end



--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018625.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
i am not using rule 2 or rule 3 to modify anything on which rule 1 depends..

thanks,
Abhinay

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018624.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread Michael Anstis
> or do yu need more data ??

Rules 2 and 3 in their entirety would be a good starting point.

On 12 July 2012 09:27, abhinay_agarwal  wrote:

> rule "rule1"
> agenda-group "1"
> salience 0
> when
>$a : Account()
>$h : HashMap(!(this["Aggregate_Balance"]<=5))
> then
>   setFocus("2")
> end
>
>
> rule "rule2"
> agenda-group "1"
> salience -1
> when
> //something
> then
> //something
> end
>
>
> rule "rule3"
> agenda-group "2"
> salience 0
> when
> //something
> then
> //something
> end
>
> will this help???
>
> or do yu need more data ??
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018621.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Customizing Drools Guvnor

2012-07-12 Thread Michael Anstis
Read the Guvnor user guide?

On 12 July 2012 07:52, arup  wrote:

> Hi all,
>
> Can u tell me how can i add a fresh rule using Rest api to the
> guvnor???
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Customizing-Drools-Guvnor-tp4018616.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
rule "rule1" 
agenda-group "1" 
salience 0 
when 
   $a : Account() 
   $h : HashMap(!(this["Aggregate_Balance"]<=5))
then 
  setFocus("2") 
end 


rule "rule2" 
agenda-group "1" 
salience -1 
when 
//something 
then 
//something 
end 


rule "rule3" 
agenda-group "2" 
salience 0 
when 
//something 
then 
//something 
end 

will this help???

or do yu need more data ??

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618p4018621.html
Sent from the Drools: User forum 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] simple Doubt..usage of modify

2012-07-12 Thread abhinay_agarwal
i had already read about it, but did not get a clear picture..so raised the
question here..

Thanks,
Abhinay

--
View this message in context: 
http://drools.46999.n3.nabble.com/simple-Doubt-usage-of-modify-tp4018614p4018620.html
Sent from the Drools: User forum 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] Rule refiring issue !

2012-07-12 Thread Wolfgang Laun
Rewrite this post without confusing mistakes: "rule1" is duplicate.

Also, not showing the LHS conditions and RHS actions makes it
impossible to say what causes which rule to (re-)fire.

-W


On 12/07/2012, abhinay_agarwal  wrote:
> hey all,
>
> i have a scenario like this..
>
> rule "rule1"
> agenda-group "1"
> salience 0
> when
> //something
> then
> setFocus("2")
> end
>
>
> rule "rule1"
> agenda-group "1"
> salience -1
> when
> //something
> then
> //something
> end
>
>
> rule "rule3"
> agenda-group "2"
> salience 0
> when
> //something
> then
> //something
> end
>
>
> when initially my rule 1 gets fired, it executes its work and sets focus on
> rule 3
>
> After the execution of rule 3, when it goes back to agend-group "1"..the
> rule 1 is fired again..
>
> can i do something to stop the firing of rule 1 again..i want my rule 2 to
> just get fired when the focus is set again to agenda-group "1"..
>
> i have tried using "no-loop" and "lock-on active", but they dont help in my
> case !!
>
> thanks,
> Abhinay
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618.html
> Sent from the Drools: User forum 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


[rules-users] Rule refiring issue !

2012-07-12 Thread abhinay_agarwal
hey all,

i have a scenario like this..

rule "rule1"
agenda-group "1"
salience 0
when
//something
then
setFocus("2")
end


rule "rule1"
agenda-group "1"
salience -1
when
//something
then
//something
end


rule "rule3"
agenda-group "2"
salience 0
when
//something
then
//something
end


when initially my rule 1 gets fired, it executes its work and sets focus on
rule 3

After the execution of rule 3, when it goes back to agend-group "1"..the
rule 1 is fired again..

can i do something to stop the firing of rule 1 again..i want my rule 2 to
just get fired when the focus is set again to agenda-group "1"..

i have tried using "no-loop" and "lock-on active", but they dont help in my
case !!

thanks,
Abhinay

--
View this message in context: 
http://drools.46999.n3.nabble.com/Rule-refiring-issue-tp4018618.html
Sent from the Drools: User forum 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] Planner - Initialized solution & local search

2012-07-12 Thread Geoffrey De Smet



Op 11-07-12 21:56, Garf schreef:
re: /Double check if you aren't calling afterEntityAdded() on the 
non-initialized entities too. Also check that the construction 
heurstics run before the localSearch solver does (the order in which 
they are declared in the config xml matters)./ Checked both. I'll file 
a JIRA bug, but I'm just searching the source some more -- I'm trying 
to verify that DefaultGreedyFitSolverPhase.solve() doesn't exit the 
loop before calling setSolutionInitialized(). Jon

Thanks,

Alternatively, you can also try reproducing it on the pas example, by
only partially initializing the solution in 
PatientAdmissionScheduleSolutionInitializer
and adding a  in 
patientAdmissionScheduleSolverConfig.xml
If you can reproduce it there, I 'll fix it tomorrow on master and 
backport it to 5.4.x (no immediate release planned).


View this message in context: Re: [rules-users] Planner - Initialized 
solution & local search 

Sent from the Drools: User forum mailing list archive 
 at 
Nabble.com.



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


--
With kind regards,
Geoffrey De Smet

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