Re: [rules-users] declared variables in rules loaded to the same knowledge base

2012-02-08 Thread Salina Fung/UFL - ICIL
Thanks for the explanation

So they are the same fact?


Thanks
Salina


- Original Message -
From: Wolfgang Laun
[mailto:wolfgang.l...@gmail.com]
To: sal...@icil.net, Rules Users List
[mailto:rules-users@lists.jboss.org]
Sent: Thu, 09 Feb 2012 15:18:32
+0800
Subject: Re: [rules-users] declared variables in rules loaded to the
same knowledge base


> On 09/02/2012, Salina Fung/UFL - ICIL  wrote:
> > We have 2 rules - rule 1 and rule 2, both have
> > declared variable @role(event)
> 
> This is not a "variable" in the sense of the word as 99.99% use it.
> 
> The "declare EventImpl @role(event)...end tells Drools that
> facts of type EventImpl are facts with extended semantics,
> i.e., a timestamp and duration, and Fusion functions can
> be applied. Read the documentation!
> 
> 
> >
> > In the program with statements to define the rule
> >
> > <<
> > String rule1 = "package test001 import com.icil.event.*; declare EventImpl
> > @role(event) end rule \"test 001\" when Integer() then
> > System.out.println(\"rule test 001: there is an integer\"); end ";
> >
> > String rule2 = "package test002 import com.icil.event.*; declare EventImpl
> > @role(event) end rule \"test 002\" when Integer() then
> > System.out.println(\"rule test 002: there is an integer\"); end ";
> >>>
> >
> > and then  try to load these two into the same knowledge base using Drools
> > 5.3,
> > will get an runtime exception. But Drools 5.2, this is ok, with
> > no error.
> 
> I'm not trying to guess the exception.
> 
> >
> >
> > Then in Drools 5.2
> >
> > We try to print the address of the variable 'event' in the RHS of both
> > rules, the
> > address is the same in both rules, which means they are sharing the same
> > instance?
> 
> "event" is merely a word in the DRL text, recognized and discarded by
> the DRL parser. So I'd be *very* much surprised if you can obtain its
> "address" at runtime, in the RHS.
> 
> It's a pity that you don't show the code with which you print the "address"
> of something. In Java, that's quite an unusual thing to do.
> 
> Please don't report about things without showing them, in full.
> 
> -W
> 
> >
> > Is it the declared variables with the same name in separate
> > rules being loaded in the same knowledge base, will just
> > have ONE instance?
> >
> >
> >
> > Thanks
> > Salina
> >
> 
> >
> 

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


Re: [rules-users] declared variables in rules loaded to the same knowledge base

2012-02-08 Thread Wolfgang Laun
On 09/02/2012, Salina Fung/UFL - ICIL  wrote:
> We have 2 rules - rule 1 and rule 2, both have
> declared variable @role(event)

This is not a "variable" in the sense of the word as 99.99% use it.

The "declare EventImpl @role(event)...end tells Drools that
facts of type EventImpl are facts with extended semantics,
i.e., a timestamp and duration, and Fusion functions can
be applied. Read the documentation!


>
> In the program with statements to define the rule
>
> <<
> String rule1 = "package test001 import com.icil.event.*; declare EventImpl
> @role(event) end rule \"test 001\" when Integer() then
> System.out.println(\"rule test 001: there is an integer\"); end ";
>
> String rule2 = "package test002 import com.icil.event.*; declare EventImpl
> @role(event) end rule \"test 002\" when Integer() then
> System.out.println(\"rule test 002: there is an integer\"); end ";
>>>
>
> and then  try to load these two into the same knowledge base using Drools
> 5.3,
> will get an runtime exception. But Drools 5.2, this is ok, with
> no error.

I'm not trying to guess the exception.

>
>
> Then in Drools 5.2
>
> We try to print the address of the variable 'event' in the RHS of both
> rules, the
> address is the same in both rules, which means they are sharing the same
> instance?

"event" is merely a word in the DRL text, recognized and discarded by
the DRL parser. So I'd be *very* much surprised if you can obtain its
"address" at runtime, in the RHS.

It's a pity that you don't show the code with which you print the "address"
of something. In Java, that's quite an unusual thing to do.

Please don't report about things without showing them, in full.

-W

>
> Is it the declared variables with the same name in separate
> rules being loaded in the same knowledge base, will just
> have ONE instance?
>
>
>
> Thanks
> Salina
>

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


Re: [rules-users] Can I change the value of a global in a rule consequence?

2012-02-08 Thread Wolfgang Laun
Done right, it works.

The variable m you have in a consequence functions very much like a
value parameter, set anew for each execution of each consequence.
Actually, all globals reside in some central repository from where they
are fed into any consequence execution.

Therefore, there is just one way of setting a global.

-W

On 09/02/2012, Shur, Bob  wrote:
> The manual says "It is strongly discouraged to set or change a global value
> from inside your rules..." but it doesn't say it won't work.
>
> I tried this:
>
> 
> global Integer m;
>
> declare DoneInit end
>
> rule "init"
> when
> then
>   insert(new DoneInit());
>   System.out.println("m from Java: " + m);
>   m = 100;
>   System.out.println("m modified in init: " + m);
> end
>
> rule "use it"
> when
>   DoneInit()
> then
>   System.out.println("use m: " + m);
> end
> ==
>
> and got this output:
>
> m from Java: 13
> m modified in init: 100
> use m: 13
>
> Is this the expected behavior?  I'm in a stateless session in case that
> matters.
>
>
> ___
> 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] PermGen space error

2012-02-08 Thread Zhao Yi
Thanks for reply.

I have set the value to -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=1024m,
but it still gets that error.

--
View this message in context: 
http://drools.46999.n3.nabble.com/PermGen-space-error-tp3728264p3728630.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] Performance scaling with fact insertion

2012-02-08 Thread Wolfgang Laun
You realize that the modify negating part of the condition must result in
an immediate retraction of the logical insertion?

During the runs: were there any other rules besides the one you have shown,
especially rules with patterns using AnomalyFact or DataPoint?

AnomalyType =/= AnomalyEnum

-W

On 08/02/2012, St. Lawrence, Zachary  wrote:
> I was running some performance analysis on my rules so I could tune in hopes
> of scaling up from hundreds of thousands of datapoints to millions of
> entries and noticed some alarming performance scaling issues when rules are
> firing and inserting dependent objects.  At first I thought it was one of my
> more complex rules but when I broke down my examples to the simplest
> possible test cases I found that the central problem was that performance
> was not linear with number of facts inserted -- it was polynominal (roughly
> n^2.5).
>
> My simplest test example was basically each fact inserted initially would
> trigger a new logical relationship fact to be inserted.  No fancy logic.
> Also it could not trigger itself recursively.  I tried three approaches :
> logical inserts of new facts, manual inserts/retraction, and update of the
> current fact with new data.
>
> Updates on current fact were roughly linear assuming I prevented re-firing.
> Manual Inserts and retracts scaled with O(n^2.5)
> LogicalInserts were O(n^3)
>
> The documentation suggest insertion of dependent facts to simplify logic.
> But when dealing with tens of thousands of events triggering it did not
> scale sufficiently.  Can anyone tell me what I may have done wrong?  I have
> included rules and data below.
>
> This was on 5.3 using fireAllRules.  The time measured was rule execution
> only and excluded times due to my testing framework.
>
> // SIMPLIFIED RULES FILE
> declare DataPoint
> anomaly : boolean
> entityId : String
> average : double
> predict : double
> predictDev : double
> timestamp : long
> end
>
> declare AnomalyFact
> entityId : String
> anomalyType : AnomalyType
> ruleName : String
> timestamp : long
> end
>
> rule "Traffic Below 4 Deviations"
> no-loop
> when
> $datapoint : DataPoint (
> anomaly==false,
> average < (predict - (predictDev * 4))
> )
> then
> // update self only. This line was always active.
> modify($datapoint) {setAnomaly(true)};
>
> // on logicalInsert test I commented in the following line
> // insertLogical( new AnomalyFact ( $datapoint.getEntityId(),
> AnomalyEnum.LOW, drools.getRule().getName(), $datapoint.getTimestamp()));
>
>
> // on insert test I commented in the following line and added another rule
> to retract any anomaly with no datapoint
> // insert( new AnomalyFact ( $datapoint.getEntityId(), AnomalyEnum.LOW,
> drools.getRule().getName(), $datapoint.getTimestamp()));
> end
>
>
> /* TEST RESULT CONTAINED BELOW
> All data inserted triggered the rule.  I was load testing for worst case
> behavior.
>
> logicalInsert
> n run1 run2 run3
> 5000 1293 1232 1767
> 1 9458 8210 10079
> 15000 24389 31050 24311
> 3 134936
>
> manual insert/retract
> n run1 run2 run3
> 5000 1137 1094 1169
> 1 8090 5862 5616
> 15000 16741 16728 15874
> 3 76034
>
> update on current object only
> n run1 run2 run3
> 5000 417 444 413
> 1 600
> 15000 712 697 688
> 3 999 970 1041 1016 1163
> 6 1420
> 10 1930
>
> Thanks for any help!
> */
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Unable to save or validate facts in Guvnor

2012-02-08 Thread arup
Guvnor 5.1 and it's running on Websphere application server 6.1. 
The error is coming when i'm trying to save or validate anything.
I tried to export thr repository and got this in the console:





[2/9/12 11:58:02:401 IST] 0023 SystemOut O DEBUG 09-02 11:58:02,401
(RepositoryBackupServlet.java:processExportRepositoryDownload:115)  
Starting to process export
[2/9/12 11:58:02:401 IST] 0023 WrappingFileO W  switchFiles TRAS0031W:
Unable to rename file C:\Program
Files\IBM\SDP\runtimes\base_v61\profiles\was61profile1\logs\server1\SystemOut.log
to C:\Program
Files\IBM\SDP\runtimes\base_v61\profiles\was61profile1\logs\server1\SystemOut_12.02.09_11.58.02.log
during log file rollover. Attempting to copy file contents.
[2/9/12 11:58:02:422 IST] 0023 SystemOut O DEBUG 09-02 11:58:02,422
(RepositoryServlet.java:getFileManager:69)   WARNING: RUNNING IN NON SEAM
MODE SINGLE USER MODE - ONLY FOR TESTING AND DEBUGGING !
[2/9/12 11:58:02:457 IST] 0023 SystemOut O ERROR 09-02 11:58:02,455
(RulesRepository.java:exportRulesRepositoryToStream:999) 
java.lang.NullPointerException
at
org.apache.jackrabbit.core.value.BLOBInDataStore.getDataRecord(BLOBInDataStore.java:135)
at
org.apache.jackrabbit.core.value.BLOBInDataStore.getStream(BLOBInDataStore.java:101)
at 
org.apache.jackrabbit.value.BinaryValue.getStream(BinaryValue.java:157)
at 
org.apache.jackrabbit.value.ValueHelper.serialize(ValueHelper.java:679)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportValue(SystemViewExporter.java:122)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportProperty(SystemViewExporter.java:102)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportProperty(SystemViewExporter.java:87)
at
org.apache.jackrabbit.commons.xml.Exporter.exportProperty(Exporter.java:363)
at
org.apache.jackrabbit.commons.xml.Exporter.exportProperties(Exporter.java:268)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportNode(SystemViewExporter.java:77)
at 
org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:294)
at
org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:213)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportNode(SystemViewExporter.java:78)
at 
org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:297)
at
org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:213)
at
org.apache.jackrabbit.commons.xml.SystemViewExporter.exportNode(SystemViewExporter.java:78)
at 
org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:297)
at org.apache.jackrabbit.commons.xml.Exporter.export(Exporter.java:143)
at
org.apache.jackrabbit.commons.AbstractSession.export(AbstractSession.java:543)
at
org.apache.jackrabbit.commons.AbstractSession.exportSystemView(AbstractSession.java:257)
at
org.apache.jackrabbit.commons.AbstractSession.exportSystemView(AbstractSession.java:311)
at
org.drools.repository.RulesRepository.exportRulesRepositoryToStream(RulesRepository.java:994)
at
org.drools.guvnor.server.files.FileManagerUtils.exportRulesRepository(FileManagerUtils.java:249)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.processExportRepositoryDownload(RepositoryBackupServlet.java:118)
at
org.drools.guvnor.server.files.RepositoryBackupServlet.doGet(RepositoryBackupServlet.java:98)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1101)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:569)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
at 
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:118)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompleti

[rules-users] Drools Debugging

2012-02-08 Thread Veera
Hi All,

I have one doubt that is : When i compiling a sample HelloWorld Drools
program it is printing output like :
Hello World
Goodbye cruel world

and i added a simple rule like :  
 rule "test"
when
eval(true)
then
System.out.println( "Hello!!!" );
end 

When i compile the output is :
Hello!!!
Hello World
Goodbye cruel world

But when i debug it is showing output like:
Hello World
Goodbye cruel world
Hello!!!

Can anybody help me how to get the same output when i debug also...

Regards,
Veera


--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Debugging-tp3728574p3728574.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] PermGen space error

2012-02-08 Thread chriscarr
There are several different memory settings, but the "Perm Gen" is related to
this one:  MaxPermSize

These are related to the heap (the normal memory space that we are used to)
-Xms128mThis sets the initial size of the heap
-Xmx1488m   This sets the maximum size of the heap

These are related to the perm gen space (typically used for holding class
defs, etc...)
-XX:PermSize=32m  Similar to the Xms, this is the initial size of
the space
-XX:MaxPermSize=200mSimilar to Xmx, this is the maximum size of the
space

The perm gen space doesn't need to be nearly as big as the heap.

Hope this helps.

Chris C.


--
View this message in context: 
http://drools.46999.n3.nabble.com/PermGen-space-error-tp3728264p3728504.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] declared variables in rules loaded to the same knowledge base

2012-02-08 Thread Salina Fung/UFL - ICIL
We have 2 rules - rule 1 and rule 2, both have
declared variable @role(event)

In the program with statements to define the rule

<<
String rule1 = "package test001 import com.icil.event.*; declare EventImpl
@role(event) end rule \"test 001\" when Integer() then
System.out.println(\"rule test 001: there is an integer\"); end ";

String rule2 = "package test002 import com.icil.event.*; declare EventImpl
@role(event) end rule \"test 002\" when Integer() then
System.out.println(\"rule test 002: there is an integer\"); end ";
>>

and then  try to load these two into the same knowledge base using Drools 5.3,
will get an runtime exception. But Drools 5.2, this is ok, with
no error.


Then in Drools 5.2
 
We try to print the address of the variable 'event' in the RHS of both rules, 
the
address is the same in both rules, which means they are sharing the same 
instance?  

Is it the declared variables with the same name in separate
rules being loaded in the same knowledge base, will just
have ONE instance?



Thanks
Salina

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


Re: [rules-users] PermGen space error

2012-02-08 Thread Zhao Yi

I have use -Xmx -XX:PermSize to increase memory. But it does not help. Does
drools have some limitation about the rules? When I delete some drl files,
the error is gone.

--
View this message in context: 
http://drools.46999.n3.nabble.com/PermGen-space-error-tp3728264p3728331.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] PermGen space error

2012-02-08 Thread Jevon Wright
This is a normal Java error that indicates that Java has run out of
memory. Try increasing the memory available to Java, for example
"-Xms=128m -Xmx=512m". This can be provided as a runtime argument to
your Java runtime.

Cheers
Jevon

On Thu, Feb 9, 2012 at 3:05 PM, Zhao Yi  wrote:
> When I load many rule files in a knowledge base, I always get "PermGen space
> error". Does this relate to drools issue? Any one have this issue before?
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/PermGen-space-error-tp3728264p3728264.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] PermGen space error

2012-02-08 Thread Zhao Yi
When I load many rule files in a knowledge base, I always get "PermGen space
error". Does this relate to drools issue? Any one have this issue before?

--
View this message in context: 
http://drools.46999.n3.nabble.com/PermGen-space-error-tp3728264p3728264.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] Can I change the value of a global in a rule consequence?

2012-02-08 Thread Shur, Bob
The manual says "It is strongly discouraged to set or change a global value 
from inside your rules..." but it doesn't say it won't work.

I tried this:


global Integer m;

declare DoneInit end

rule "init"
when
then
insert(new DoneInit());
System.out.println("m from Java: " + m);
m = 100;
System.out.println("m modified in init: " + m);
end

rule "use it"
when
DoneInit()
then
System.out.println("use m: " + m);
end
==

and got this output:

m from Java: 13
m modified in init: 100
use m: 13

Is this the expected behavior?  I'm in a stateless session in case that matters.


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


[rules-users] Performance scaling with fact insertion

2012-02-08 Thread St. Lawrence, Zachary
I was running some performance analysis on my rules so I could tune in hopes of 
scaling up from hundreds of thousands of datapoints to millions of entries and 
noticed some alarming performance scaling issues when rules are firing and 
inserting dependent objects.  At first I thought it was one of my more complex 
rules but when I broke down my examples to the simplest possible test cases I 
found that the central problem was that performance was not linear with number 
of facts inserted -- it was polynominal (roughly n^2.5).

My simplest test example was basically each fact inserted initially would 
trigger a new logical relationship fact to be inserted.  No fancy logic.  Also 
it could not trigger itself recursively.  I tried three approaches : logical 
inserts of new facts, manual inserts/retraction, and update of the current fact 
with new data.

Updates on current fact were roughly linear assuming I prevented re-firing.
Manual Inserts and retracts scaled with O(n^2.5)
LogicalInserts were O(n^3)

The documentation suggest insertion of dependent facts to simplify logic.  But 
when dealing with tens of thousands of events triggering it did not scale 
sufficiently.  Can anyone tell me what I may have done wrong?  I have included 
rules and data below.

This was on 5.3 using fireAllRules.  The time measured was rule execution only 
and excluded times due to my testing framework.

// SIMPLIFIED RULES FILE
declare DataPoint
anomaly : boolean
entityId : String
average : double
predict : double
predictDev : double
timestamp : long
end

declare AnomalyFact
entityId : String
anomalyType : AnomalyType
ruleName : String
timestamp : long
end

rule "Traffic Below 4 Deviations"
no-loop
when
$datapoint : DataPoint (
anomaly==false,
average < (predict - (predictDev * 4))
)
then
// update self only. This line was always active.
modify($datapoint) {setAnomaly(true)};

// on logicalInsert test I commented in the following line
// insertLogical( new AnomalyFact ( $datapoint.getEntityId(), 
AnomalyEnum.LOW, drools.getRule().getName(), $datapoint.getTimestamp()));


// on insert test I commented in the following line and added another rule to 
retract any anomaly with no datapoint
// insert( new AnomalyFact ( $datapoint.getEntityId(), AnomalyEnum.LOW, 
drools.getRule().getName(), $datapoint.getTimestamp()));
end


/* TEST RESULT CONTAINED BELOW
All data inserted triggered the rule.  I was load testing for worst case 
behavior.

logicalInsert
n run1 run2 run3
5000 1293 1232 1767
1 9458 8210 10079
15000 24389 31050 24311
3 134936

manual insert/retract
n run1 run2 run3
5000 1137 1094 1169
1 8090 5862 5616
15000 16741 16728 15874
3 76034

update on current object only
n run1 run2 run3
5000 417 444 413
1 600
15000 712 697 688
3 999 970 1041 1016 1163
6 1420
10 1930

Thanks for any help!
*/
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] limits on number of rules in Guvnor in a package, loaded in knowledge base

2012-02-08 Thread Michael Anstis
IIRC there was a bug in Drools Expert 5.3 that was not releasing event
listeners correctly that led to a memory leak - it might be related to what
you have experienced. IIRC this was fixed for 5.4.

Are you able to try with Drools suite 5.4.0.beta2?

sent on the move

On 7 Feb 2012 23:16, "vadlam"  wrote:

> Nicolas,
>
> after we run a build and we see that the heap has not been Garbage
> collected, when we try run a second build, it crashes after a few minutes
> because it does not have much memory to complete the build.
>
> could it be the case that the package that gets built is getting stored and
> not released unless the server is restarted?
>
> what is the expectation around a package that has been built in Guvnor.
>
> How long is it retained in Guvnor memory for subsequent access through a
> URL?
>
> The same rules get built in Guvnor 5.2 and memory is subsequently released
> after the build.
>
> so, it looks like there is some kind of leak happening ?
>
> to contest my own theory, when a package which is smaller in size is built
> in Guvnor 5.3, memory is released after the build.
>
> I wonder what could be happening around that 80-85 heap threshold that is
> causing memory to be held back.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/limits-on-number-of-rules-in-Guvnor-in-a-package-loaded-in-knowledge-base-tp3716069p3724291.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] Option Call method on object

2012-02-08 Thread Michael Anstis
Guvnor version?

Repository export demonstrating the problem?

sent on the move

On 8 Feb 2012 15:39, "nada1985"  wrote:

> Hello
>
> I started on Drools guvnor and I have to create business rules in the
> interface Guvnor.J 'have imported the model jar containing the necessary
> objects but I have a problem calling methods, and getters setteres of a
> class.
>
> When I defined the conditions in When section, and  I go to action, I
> choose
> Call method on Command, I do not see the methods of the Command class.
>
> Have you any idea? It blocks me for many days I do not know where does the
> problem.
> thank you
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Option-Call-method-on-object-tp3726315p3726315.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] Unable to save or validate facts in Guvnor

2012-02-08 Thread Michael Anstis
Guvnor version?

Repository export demonstrating the problem?

Both are likely to attract a more helpful reply.

sent on the move

On 8 Feb 2012 08:38, "arup"  wrote:

> Hi,
>
> I can't save or validate any facts or pojo models in my guvnor. The guvnor
> console is coming and i can browse through it but when i'm trying to save
> or
> validate any items i'm getting some errors as below. Is there any
> repository
> related problem??... how can i solve it??
>
>
>
>
>
>
>
> 039 SystemErr R Exception in thread "pool-1-thread-1"
> java.lang.AbstractMethodError:
> org/drools/repository/UserInfo$Command.process(Ljava/lang/String;)V
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
> org.drools.repository.UserInfo.eachUser(UserInfo.java:179)
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
>
> org.drools.guvnor.server.repository.MailboxService.processOutgoing(MailboxService.java:81)
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
>
> org.drools.guvnor.server.repository.MailboxService$3.run(MailboxService.java:127)
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
> [2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
> java.lang.Thread.run(Thread.java:810)
> [2/8/12 13:56:49:155 IST] 003a SystemErr R Exception in thread
> "pool-1-thread-2" java.lang.AbstractMethodError:
> org/drools/repository/UserInfo$Command.process(Ljava/lang/String;)V
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
> org.drools.repository.UserInfo.eachUser(UserInfo.java:179)
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
>
> org.drools.guvnor.server.repository.MailboxService.processOutgoing(MailboxService.java:81)
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
>
> org.drools.guvnor.server.repository.MailboxService$1.run(MailboxService.java:67)
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
> [2/8/12 13:56:49:156 IST] 003a SystemErr R  at
> java.lang.Thread.run(Thread.java:810)
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Unable-to-save-or-validate-facts-in-Guvnor-tp3725241p3725241.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] Truth maintenance and RHS variables

2012-02-08 Thread Wolfgang Laun
Well, we'll have to look at the code, all of it.
-W

On 8 February 2012 18:36, juankera  wrote:

> Sorry... big mistake. I forgot to mention that i'm inserting one StateEvent
> after each rules firing.
>
> So, these are the correct steps:
>
> 1. I'm working with stateful session (no clocks, entry-points or events for
> now).
> 2. I insert one StateEvent fact into working memory
> 3. Rules are fired.
> 4. I can see "yikes¡" in console
> 5. Nothing happens after that.
> 2. I insert one new StateEvent fact into working memory (from code)
> 6. Rules are fired again
> 7. I can see "yikes¡" in console
> 8. Nothing happens after that.
>
> Anyway, my code is as simple as that:
>
> (..)
> ksession.insert((RuleEvent) new StateEvent(item, state));
> ksession.fireAllRules();
> ksession.insert((RuleEvent) new StateEvent(item, state));
> ksession.fireAllRules();
> (...)
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726783.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] Truth maintenance and RHS variables

2012-02-08 Thread juankera
Sorry... big mistake. I forgot to mention that i'm inserting one StateEvent
after each rules firing.

So, these are the correct steps:

1. I'm working with stateful session (no clocks, entry-points or events for
now).
2. I insert one StateEvent fact into working memory
3. Rules are fired.
4. I can see "yikes¡" in console
5. Nothing happens after that.
2. I insert one new StateEvent fact into working memory (from code)
6. Rules are fired again
7. I can see "yikes¡" in console
8. Nothing happens after that. 

Anyway, my code is as simple as that:

(..)
ksession.insert((RuleEvent) new StateEvent(item, state));
ksession.fireAllRules();
ksession.insert((RuleEvent) new StateEvent(item, state));
ksession.fireAllRules();
(...)



--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726783.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 processing blocking when I/O is involved in a BPMN 2.0 Task

2012-02-08 Thread Wolfgang Laun
When a rule fires in the thread running your session and triggers the
Web service, you should dispatch a ServiceCall object into a queue.
Other threads should then handle the pending services. Use a thread
pool for servicing the queue.

-W



On 08/02/2012, Alberto R. Galdo  wrote:
> Hi,
>
> Our setup consists on some BPMN process being executed when a rule
> fires. Our process has a node of type Task for which a handler is available
> at the knowledge session. Our handler invokes a web service and waits (
> blocks ) for the response before completing the task and letting the BPMN
> process continue.
>
> Well, we've inserted a hundred facts in the session that trigger the
> rule that triggers the BPMN process that triggers the web service call ...
> what we are seeing ( using the statistics gathered using JMX and our own
> experience ) is that 100 rule activations are created and only one fires,
> the rest, are "waiting" for the web service to respond. When the web
> service responds then another rule fires, and so on. For an iliterate point
> of view, seems that there's only one thread for it all, drools expert,
> fusion and flow ...
>
> Our session is stateful and we this is how we manage our session:
>
>new Thread(new Runnable()   {
> public void run() {
> session.fireUntilHalt();
> }
> }).start();
>
>
>  How do we get the rules to fire in parallel? Is there any better way
> to get this done ( to get the processes executed in parallel and not
> blocking the execution of the rules)?
>
> Greets,
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule does not fire when JBPM asks to do so in BPMN 2.0 process

2012-02-08 Thread Esteban Aliverti
This is a tricky one :)

What is happening is that you are running the process first and inserting
the process instance later.
When the process is started, it runs until it finds the Rule Task. At that
point, since there is no activation for any of the rules in "jobs
group" (there is no ProcessInstance inserted yet, so there is no activation
for "job complete" rule) the execution continues (since you are already
inside a fireAllRules() invocation) until the process reaches the end or a
wait-state. At that point, the control is returned to the original rule
that started the process and the ProcessInstance is finally inserted.
What you can do is to split the creation of the process instance and its
execution:

rule "New case"
when
$case : Case(processed==false) from entry-point "case stream"

then
modify ($case){
setProcessed(true)
}

[  processing code omitted ... ]

//create the instance, but don't start it yet
ProcessInstance processInstance
= kcontext.getKnowledgeRuntime().createProcessInstance("com.mycompany.Process",
parameters);

//insert the instance in the WM: this will create the activation of
the other rule
insert(processInstance);

//now, start the process

  
kcontext.getKnowledgeRuntime().startProcessInstance(processInstance.getProcessInstance());

end

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2012/2/8 Alberto R. Galdo 

> I'm afraid I can't publish as it is, but I hope this would give you a hint:
>
> myrules.drl:
>
> rule "New case"
> when
> $case : Case(processed==false) from entry-point "case stream"
>
> then
> modify ($case){
> setProcessed(true)
> }
>
> [  processing code omitted ... ]
>
> insert(kcontext.
> getKnowledgeRuntime().startProcess("com.mycompany.Process", parameters));
> end
>
> rule "job complete"
> ruleflow-group "jobs group"
> when
> $processInstance: WorkflowProcessInstance()
> then
> Job job = (Job)$processInstance.getVariable("var");
> update(job);
> end
>
>
>
>
> process.bpmn:
>
> 
> 
>  id="com.mycompany.Process" name="process" >
> [one start node and lots of nodes here, one that ends in the next ]
>
>  name="complete job"/>
>
> [ lots of nodes after, ending in an end node]
>
> 
> 
>
>
>
>
> As you can see the rule "New case" is not in any group and is responsible
> ( if it is the case ) of launching the process, and then that process
> invokes the bussinessrule group "jobs group". As stated, what we see is
> that the rule "job complete" never gets fired.
>
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
> Alberto R. Galdo
> arga...@gmail.com
>
>
>
>
> On Tue, Feb 7, 2012 at 21:16, Mauricio Salatino  wrote:
>
>> ""businessRuleTask" who tries to fire a rule in drools ant that rule
>> are not in the same group" can you share the process definition and
>> the rule?
>>
>> 2012/2/7 Alberto R. Galdo :
>> > Hi,
>> >
>> >The rule that inserts the process which has the node
>> "businessRuleTask"
>> > who tries to fire a rule in drools ant that rule are not in the same
>> group.
>> > In fact, the rule that should be fired is the only rule in that group
>> and
>> > should only be fired by the process itself.
>> >
>> >What we are trying to do is to update the state of a fact inside
>> drools
>> > with information gathered in the BPM process. Maybe I am getting this
>> wrong,
>> > but, Is there another way to accomplish this?
>> >
>> > Greets,
>> >
>> >
>> > Alberto R. Galdo
>> > arga...@gmail.com
>> >
>> >
>> >
>> >
>> > On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino 
>> wrote:
>> >>
>> >> Hi are you using the same rule flow-group in the businessRuleTask and
>> >> in your rule? can you share the rule that you are using?
>> >> remember that the evaluation will be done by the engine as soon as the
>> >> information comes in. The rule flow group will only execute something
>> >> if a rule was activated inside the rule flow group of your
>> >> businessRuleTask.
>> >> Cheers
>> >>
>> >> On Tue, Feb 7, 2012 at 2:23 PM, argaldo  wrote:
>> >> > Hi,
>> >> >
>> >> >  We're running an application that uses Drools + JBPM 5 + Drools
>> >> > integration our set-up can be seen as:
>> >> >
>> >> >  Some rule fires and creates a JBPM process ( a fact gets inserted
>> into
>> >> > drools using "kcontext.getKnowledgeRuntime().startProcess()" ),
>> after a
>> >> > few
>> >> > nodes processed, the JBPM engine arrives to a node of type
>> >> > "businessRuleTask" which in turn tells drools to evaluate a group of
>> >> > rules (
>> >> > which at the moment consists on only one rule ).
>> >> >
>> >> >  Well, the problem is that what we see is that everything runs ok
>> before
>> >> > the businessRuleTask and at the moment when the rule group would be
>> >> > evaluated we could see that in drools the

Re: [rules-users] Truth maintenance and RHS variables

2012-02-08 Thread Wolfgang Laun
On 08/02/2012, juankera  wrote:
> Sorry for the mess, i was trying different things.
>
> 1. I'm working with stateful session (no clocks, entry-points or events for
> now).
> 2. I insert one StateEvent fact into working memory
> 3. Rules are fired.
> 4. I can see "yikes¡" in console
> 5. Nothing happens after that.
> 6. Rules are fired again
> 7. I can see "yikes¡" in console

This shouldn't happen. The first rule is triggered by the arrival of a
StateEvent,
and unless another one is inserted, it should not fire again - not in
the same session.

Looking at *all* of your code might solve this mystery.

-W



> 8. Nothing happens after that.
>
> I'm a newbie, but i understand that it must fire the second rule
> inmediately.
>
> Do you think that the rule engine is really working with this declared
> fact?? Have i missed anything to register this declared fact?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726534.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 processing blocking when I/O is involved in a BPMN 2.0 Task

2012-02-08 Thread Alberto R. Galdo
Hi,

Our setup consists on some BPMN process being executed when a rule
fires. Our process has a node of type Task for which a handler is available
at the knowledge session. Our handler invokes a web service and waits (
blocks ) for the response before completing the task and letting the BPMN
process continue.

Well, we've inserted a hundred facts in the session that trigger the
rule that triggers the BPMN process that triggers the web service call ...
what we are seeing ( using the statistics gathered using JMX and our own
experience ) is that 100 rule activations are created and only one fires,
the rest, are "waiting" for the web service to respond. When the web
service responds then another rule fires, and so on. For an iliterate point
of view, seems that there's only one thread for it all, drools expert,
fusion and flow ...

Our session is stateful and we this is how we manage our session:

   new Thread(new Runnable()   {
public void run() {
session.fireUntilHalt();
}
}).start();


 How do we get the rules to fire in parallel? Is there any better way
to get this done ( to get the processes executed in parallel and not
blocking the execution of the rules)?

Greets,


Alberto R. Galdo
arga...@gmail.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule does not fire when JBPM asks to do so in BPMN 2.0 process

2012-02-08 Thread Alberto R. Galdo
I'm afraid I can't publish as it is, but I hope this would give you a hint:

myrules.drl:

rule "New case"
when
$case : Case(processed==false) from entry-point "case stream"

then
modify ($case){
setProcessed(true)
}

[  processing code omitted ... ]

insert(kcontext.
getKnowledgeRuntime().startProcess("com.mycompany.Process", parameters));
end

rule "job complete"
ruleflow-group "jobs group"
when
$processInstance: WorkflowProcessInstance()
then
Job job = (Job)$processInstance.getVariable("var");
update(job);
end




process.bpmn:




[one start node and lots of nodes here, one that ends in the next ]



[ lots of nodes after, ending in an end node]







As you can see the rule "New case" is not in any group and is responsible (
if it is the case ) of launching the process, and then that process invokes
the bussinessrule group "jobs group". As stated, what we see is that the
rule "job complete" never gets fired.



Alberto R. Galdo
arga...@gmail.com


Alberto R. Galdo
arga...@gmail.com



On Tue, Feb 7, 2012 at 21:16, Mauricio Salatino  wrote:

> ""businessRuleTask" who tries to fire a rule in drools ant that rule
> are not in the same group" can you share the process definition and
> the rule?
>
> 2012/2/7 Alberto R. Galdo :
> > Hi,
> >
> >The rule that inserts the process which has the node
> "businessRuleTask"
> > who tries to fire a rule in drools ant that rule are not in the same
> group.
> > In fact, the rule that should be fired is the only rule in that group and
> > should only be fired by the process itself.
> >
> >What we are trying to do is to update the state of a fact inside
> drools
> > with information gathered in the BPM process. Maybe I am getting this
> wrong,
> > but, Is there another way to accomplish this?
> >
> > Greets,
> >
> >
> > Alberto R. Galdo
> > arga...@gmail.com
> >
> >
> >
> >
> > On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino 
> wrote:
> >>
> >> Hi are you using the same rule flow-group in the businessRuleTask and
> >> in your rule? can you share the rule that you are using?
> >> remember that the evaluation will be done by the engine as soon as the
> >> information comes in. The rule flow group will only execute something
> >> if a rule was activated inside the rule flow group of your
> >> businessRuleTask.
> >> Cheers
> >>
> >> On Tue, Feb 7, 2012 at 2:23 PM, argaldo  wrote:
> >> > Hi,
> >> >
> >> >  We're running an application that uses Drools + JBPM 5 + Drools
> >> > integration our set-up can be seen as:
> >> >
> >> >  Some rule fires and creates a JBPM process ( a fact gets inserted
> into
> >> > drools using "kcontext.getKnowledgeRuntime().startProcess()" ), after
> a
> >> > few
> >> > nodes processed, the JBPM engine arrives to a node of type
> >> > "businessRuleTask" which in turn tells drools to evaluate a group of
> >> > rules (
> >> > which at the moment consists on only one rule ).
> >> >
> >> >  Well, the problem is that what we see is that everything runs ok
> before
> >> > the businessRuleTask and at the moment when the rule group would be
> >> > evaluated we could see that in drools the rule gets created,
> activated,
> >> > but
> >> > never fired.
> >> >
> >> >  We did some debug and realized that the reason the rule group never
> got
> >> > fired is because this check in RuleFlowGroupImpl.java ( method
> >> > setActive(boolean) ):
> >> >
> >> >if ( this.list.isEmpty() ) {
> >> >if ( this.autoDeactivate ) {
> >> >// if the list of activations is empty and
> >> >// auto-deactivate is on, deactivate this group
> >> >WorkingMemoryAction action = new
> DeactivateCallback(
> >> > this );
> >> >this.workingMemory.queueWorkingMemoryAction( action
> >> > );
> >> >}
> >> >}
> >> >
> >> >
> >> >   The problem is that at the moment when drools calls setActive() and
> >> > performs the check, this.list is in fact empty and autoDeactivate is
> >> > true by
> >> > default ). Then drools enqueues a deactivation task afterwords, which
> >> > deactivates the rule *before* even firing it.
> >> >
> >> >From now on, things get a little weirder, every subsequent
> invocation
> >> > of
> >> > the method setActive ( in response of bussinessRuleTask from our
> >> > bussiness
> >> > process ) runs ok as that list now is not empty ( has one rule ).
> >> >
> >> >Seems a race condition to me, but,...,  Is there any way to
> >> > deactivate
> >> > autodeactivation by default? Are we doing something wrong? Bug report?
> >> >
> >> > Greets,
> >> >
> >> > --
> >> > View this message in context:
> >> >
> http://drools.46999.n3.nabble.com/Rule-does-not-fire-when-JBPM-asks-to-do-so-in-BPMN-2-0-process-tp3723183p3723183.html
> >> > Sent from the Drools: User forum mailing list archive at Nabble.com.
> >> > __

Re: [rules-users] Rule does not fire when JBPM asks to do so in BPMN 2.0 process

2012-02-08 Thread argaldo
I'm afraid I can't publish as it is, but I hope this would give you a hint:

myrules.drl:

rule "New case"
when
$case : Case(processed==false) from entry-point "case stream"

then
modify ($case){
setProcessed(true)
}

[  processing code omitted ... ]


insert(kcontext.getKnowledgeRuntime().startProcess("com.mycompany.Process",
parameters));
end

rule "job complete"
ruleflow-group "jobs group"
when
$processInstance: WorkflowProcessInstance()
then
Job job = (Job)$processInstance.getVariable("var");
update(job);
end




process.bpmn:




[one start node and lots of nodes here, one that ends in the next ]



[ lots of nodes after, ending in an end node]







As you can see the rule "New case" is not in any group and is responsible (
if it is the case ) of launching the process, and then that process invokes
the bussinessrule group "jobs group". As stated, what we see is that the
rule "job complete" never gets fired.



Alberto R. Galdo
arga...@gmail.com

On Tue, Feb 7, 2012 at 21:18, salaboy [via Drools] <
ml-node+s46999n3723757...@n3.nabble.com> wrote:

> ""businessRuleTask" who tries to fire a rule in drools ant that rule
> are not in the same group" can you share the process definition and
> the rule?
>
> 2012/2/7 Alberto R. Galdo <[hidden 
> email]>:
>
>
> > Hi,
> >
> >The rule that inserts the process which has the node
> "businessRuleTask"
> > who tries to fire a rule in drools ant that rule are not in the same
> group.
> > In fact, the rule that should be fired is the only rule in that group
> and
> > should only be fired by the process itself.
> >
> >What we are trying to do is to update the state of a fact inside
> drools
> > with information gathered in the BPM process. Maybe I am getting this
> wrong,
> > but, Is there another way to accomplish this?
> >
> > Greets,
> >
> >
> > Alberto R. Galdo
> > [hidden email] 
> >
> >
> >
> >
> > On Tue, Feb 7, 2012 at 19:23, Mauricio Salatino <[hidden 
> > email]>
> wrote:
> >>
> >> Hi are you using the same rule flow-group in the businessRuleTask and
> >> in your rule? can you share the rule that you are using?
> >> remember that the evaluation will be done by the engine as soon as the
> >> information comes in. The rule flow group will only execute something
> >> if a rule was activated inside the rule flow group of your
> >> businessRuleTask.
> >> Cheers
> >>
> >> On Tue, Feb 7, 2012 at 2:23 PM, argaldo <[hidden 
> >> email]>
> wrote:
> >> > Hi,
> >> >
> >> >  We're running an application that uses Drools + JBPM 5 + Drools
> >> > integration our set-up can be seen as:
> >> >
> >> >  Some rule fires and creates a JBPM process ( a fact gets inserted
> into
> >> > drools using "kcontext.getKnowledgeRuntime().startProcess()" ), after
> a
> >> > few
> >> > nodes processed, the JBPM engine arrives to a node of type
> >> > "businessRuleTask" which in turn tells drools to evaluate a group of
> >> > rules (
> >> > which at the moment consists on only one rule ).
> >> >
> >> >  Well, the problem is that what we see is that everything runs ok
> before
> >> > the businessRuleTask and at the moment when the rule group would be
> >> > evaluated we could see that in drools the rule gets created,
> activated,
> >> > but
> >> > never fired.
> >> >
> >> >  We did some debug and realized that the reason the rule group never
> got
> >> > fired is because this check in RuleFlowGroupImpl.java ( method
> >> > setActive(boolean) ):
> >> >
> >> >if ( this.list.isEmpty() ) {
> >> >if ( this.autoDeactivate ) {
> >> >// if the list of activations is empty and
> >> >// auto-deactivate is on, deactivate this group
> >> >WorkingMemoryAction action = new
> DeactivateCallback(
> >> > this );
> >> >this.workingMemory.queueWorkingMemoryAction(
> action
> >> > );
> >> >}
> >> >}
> >> >
> >> >
> >> >   The problem is that at the moment when drools calls setActive() and
> >> > performs the check, this.list is in fact empty and autoDeactivate is
> >> > true by
> >> > default ). Then drools enqueues a deactivation task afterwords, which
> >> > deactivates the rule *before* even firing it.
> >> >
> >> >From now on, things get a little weirder, every subsequent
> invocation
> >> > of
> >> > the method setActive ( in response of bussinessRuleTask from our
> >> > bussiness
> >> > process ) runs ok as that list now is not empty ( has one rule ).
> >> >
> >> >Seems a race condition to me, but,...,  Is there any way to
> >> > deactivate
> >> > autodeactivation by default? Are we doing something wrong? Bug
> report?
> >> >
> >> > Greets,
> >> >
> >> > --
>

Re: [rules-users] Truth maintenance and RHS variables

2012-02-08 Thread juankera
Sorry for the mess, i was trying different things.

1. I'm working with stateful session (no clocks, entry-points or events for
now).
2. I insert one StateEvent fact into working memory
3. Rules are fired.
4. I can see "yikes¡" in console
5. Nothing happens after that.
6. Rules are fired again
7. I can see "yikes¡" in console
8. Nothing happens after that.

I'm a newbie, but i understand that it must fire the second rule
inmediately.

Do you think that the rule engine is really working with this declared
fact?? Have i missed anything to register this declared fact?

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726534.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] Option Call method on object

2012-02-08 Thread nada1985
Hello

I started on Drools guvnor and I have to create business rules in the
interface Guvnor.J 'have imported the model jar containing the necessary
objects but I have a problem calling methods, and getters setteres of a
class.

When I defined the conditions in When section, and  I go to action, I choose
Call method on Command, I do not see the methods of the Command class.

Have you any idea? It blocks me for many days I do not know where does the
problem.
thank you

--
View this message in context: 
http://drools.46999.n3.nabble.com/Option-Call-method-on-object-tp3726315p3726315.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] Migrating repository data from Drools 5.0 to 5.3Final

2012-02-08 Thread jian zhi
Mike,

Is it possible to release a patch of 5.3?

Thanks,
Jian




 From: Michael Anstis 
To: Rules Users List  
Sent: Wednesday, February 8, 2012 3:17 AM
Subject: Re: [rules-users] Migrating repository data from Drools 5.0 to 5.3Final
 

The problem has existed since 5.2 and would potentially affect loading any 
earlier version.
Prior to 5.2 the object model used by the guided decision table did not hold a 
Pattern to which individual condition columns are bound. 
The conversion code groups individual condition columns into the appropriate 
group and moves the underlying column data accordingly (as there was no 
guarantee columns with the same bound name were consecutive).
There was a problem with the creation and insertion of the new Pattern objects 
that relied upon the order of entries in a HashMap being consistent. This has 
now changed.
I know others have been using the new guided decision table with old 
repositories without problem and our unit tests did not detect the problem 
either.
AFAIK this is the first report of any such issue since the release of 5.2's 
betas, however I would be wrong to say there is no risk.
sent on the move
On 8 Feb 2012 01:22, "vadlam"  wrote:

does this issue happen for any previous version of Guvnor data such as 5.0
>or 5.1 or 5.2 exported and imported into a Guvnor 5.3 repository ?
>
>does this mean, we cannot rely on 5.3.0 version of Guvnor code when
>migrating data from a previous version and should rather apply the fix  ?
>
>
>
>--
>View this message in context: 
>http://drools.46999.n3.nabble.com/rules-users-Migrating-repository-data-from-Drools-5-0-to-5-3Final-tp3715772p3724570.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 mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Truth maintenance and RHS variables

2012-02-08 Thread Wolfgang Laun
Use import and simple class names - the mixture is confusing.

Display a little more info in your printlns and show us what the
output really is.

If rule "start monitoring sensors" fires and there's no other rule, then also
rule "nothing for 1m" must fire, immediately.

-W


On 08/02/2012, juankera  wrote:
> Thanks for your help... but i'm still trying to run the most basic
> example...
> with no luck.
>
> I can't see why second rule is not fired... as i understand, it will be
> fired because of first rule action.
>
> But i can't see anything. Any help will be appreciated.
>
>
> declare Monitor
>stateEvent : org.openhab.core.drools.event.StateEvent @key
>itemName : String @key
> end
>
>
> rule "start monitoring sensors"
> when  
>   $se: StateEvent( $in: itemName )
> then
> org.openhab.demo.Monitor m = new Monitor( $se, $in );
> insert( m );
> System.out.println( "yikes¡");
> end
>
>
> rule "nothing for 1m"
> when
> $m: Monitor( $in: itemName )
> then
> System.out.println( "not working: " + $in );
> end
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726201.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] Truth maintenance and RHS variables

2012-02-08 Thread juankera
Thanks for your help... but i'm still trying to run the most basic example...
with no luck.

I can't see why second rule is not fired... as i understand, it will be
fired because of first rule action.

But i can't see anything. Any help will be appreciated.


declare Monitor
   stateEvent : org.openhab.core.drools.event.StateEvent @key
   itemName : String @key
end


rule "start monitoring sensors"
when
$se: StateEvent( $in: itemName ) 
then
org.openhab.demo.Monitor m = new Monitor( $se, $in );
insert( m );
System.out.println( "yikes¡");
end


rule "nothing for 1m"
when
$m: Monitor( $in: itemName ) 
then
System.out.println( "not working: " + $in );
end

--
View this message in context: 
http://drools.46999.n3.nabble.com/rules-users-Truth-maintenance-and-RHS-variables-tp3722632p3726201.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] 5.3.0 NoClassDefFound due to nested property access

2012-02-08 Thread Wolfgang Laun
Is this already known and fixed in 5.4.0? The problem occurs when you
have, e.g.,

   Fact( foo.bar == "baz" )

Stack dump:

Exception in thread "main" java.lang.NoClassDefFoundError: monitor/Monitor
at ASMAccessorImpl_114212541328697624590.getValue(Unknown Source)
at 
org.mvel2.optimizers.dynamic.DynamicGetAccessor.getValue(DynamicGetAccessor.java:73)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:106)
at 
org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
at org.mvel2.MVEL.executeExpression(MVEL.java:954)
at 
org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:100)
at 
org.drools.base.extractors.BaseObjectClassFieldReader.isNullValue(BaseObjectClassFieldReader.java:179)
at 
org.drools.rule.VariableRestriction$ObjectVariableContextEntry.updateFromFactHandle(VariableRestriction.java:338)
at 
org.drools.common.SingleBetaConstraints.updateFromFactHandle(SingleBetaConstraints.java:118)
at org.drools.reteoo.NotNode.modifyRightTuple(NotNode.java:339)
at org.drools.reteoo.BetaNode.modifyObject(BetaNode.java:431)
at 
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:468)
at 
org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:436)
at 
org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:288)
at 
org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:271)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:459)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:363)
at 
org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:298)
at 
monitor.Rule_stop_monitoring.defaultConsequence(Rule_stop_monitoring.java:8)
at 
monitor.Rule_stop_monitoringDefaultConsequenceInvoker.evaluate(Unknown
Source)
at 
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:1091)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1029)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1251)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:708)
at 
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:672)
at 
org.drools.common.Scheduler$ActivationTimerJob.execute(Scheduler.java:90)
at 
org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:46)
at 
org.drools.time.impl.DefaultTimerJobInstance.call(DefaultTimerJobInstance.java:13)
at 
org.drools.time.impl.PseudoClockScheduler.runCallBacks(PseudoClockScheduler.java:203)
at 
org.drools.time.impl.PseudoClockScheduler.advanceTime(PseudoClockScheduler.java:156)
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] [drools-planner] Use other rules engine?

2012-02-08 Thread Geoffrey De Smet
Currently not directly, but if you want to try it, take a look at the 
class SolutionDirector.

Since iLog JRules isn't open source, we can't make it part of our build 
(as it will require non-free libraries to build),
but you're free to host that integration code a separate github project 
and we can link to it.

Supporting Java score calculation, as an alternative to Drools score 
calculation, is on the roadmap:
   https://issues.jboss.org/browse/JBRULES-3367

Note that our Red Hat consultants have much experience migrating from 
iLog JRules to Drools (BRMS).
So if you're open to that or just want to know what the options are, 
contact our BRMS representatives for more information:
   https://engage.redhat.com/forms/jboss-brms-contact-sales

With kind regards,
Geoffrey De Smet


Op 08-02-12 10:10, planner-user schreef:
> Is it possible to user drools-planner on top of another rules engine like
> iLog JRules?
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/drools-planner-Use-other-rules-engine-tp3725305p3725305.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] [drools-planner] Use other rules engine?

2012-02-08 Thread planner-user
Is it possible to user drools-planner on top of another rules engine like
iLog JRules?

--
View this message in context: 
http://drools.46999.n3.nabble.com/drools-planner-Use-other-rules-engine-tp3725305p3725305.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] Unable to save or validate facts in Guvnor

2012-02-08 Thread arup
Hi,

I can't save or validate any facts or pojo models in my guvnor. The guvnor
console is coming and i can browse through it but when i'm trying to save or
validate any items i'm getting some errors as below. Is there any repository
related problem??... how can i solve it??







039 SystemErr R Exception in thread "pool-1-thread-1"
java.lang.AbstractMethodError:
org/drools/repository/UserInfo$Command.process(Ljava/lang/String;)V
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
org.drools.repository.UserInfo.eachUser(UserInfo.java:179)
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
org.drools.guvnor.server.repository.MailboxService.processOutgoing(MailboxService.java:81)
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
org.drools.guvnor.server.repository.MailboxService$3.run(MailboxService.java:127)
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
[2/8/12 13:56:49:148 IST] 0039 SystemErr R  at
java.lang.Thread.run(Thread.java:810)
[2/8/12 13:56:49:155 IST] 003a SystemErr R Exception in thread
"pool-1-thread-2" java.lang.AbstractMethodError:
org/drools/repository/UserInfo$Command.process(Ljava/lang/String;)V
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
org.drools.repository.UserInfo.eachUser(UserInfo.java:179)
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
org.drools.guvnor.server.repository.MailboxService.processOutgoing(MailboxService.java:81)
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
org.drools.guvnor.server.repository.MailboxService$1.run(MailboxService.java:67)
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
[2/8/12 13:56:49:156 IST] 003a SystemErr R  at
java.lang.Thread.run(Thread.java:810)

--
View this message in context: 
http://drools.46999.n3.nabble.com/Unable-to-save-or-validate-facts-in-Guvnor-tp3725241p3725241.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] 5.3 ruleflow question

2012-02-08 Thread Esteban Aliverti
"ruleflow" term is kind of deprecated since jBPM5 emerged as a separate
project :) The correct term now should be "process" or "business process".
These are the minimal dependencies you need if you want to use processes
and rules in your applications:


org.drools
knowledge-api
5.4.0-SNAPSHOT
jar


org.drools
drools-core
5.4.0-SNAPSHOT


org.drools
drools-compiler
5.4.0-SNAPSHOT


org.jbpm
jbpm-bpmn2
5.3.0-SNAPSHOT


org.jbpm
jbpm-flow
5.3.0-SNAPSHOT


org.jbpm
jbpm-flow-builder
5.3.0-SNAPSHOT


Please note that org.jbpm artifact's versions (5.3.0-SNAPSHOT) are
different from org.drools  (5.4.0-SNAPSHOT)

Best Regards,



Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


2012/2/7 St. Lawrence, Zachary 

> I am trying to use ruleflows to test a different approach to a problem but
> I am having problems finding the right implementing jars for use in my
> maven imports.
>
> In 5.2 the needed builder classes were in jbpm-flow-builder.  But 5.3
> doesn't have that package.  How does one use ruleflows in the most recent
> release of drools?
>
> Zack
>
> ___
> 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] Migrating repository data from Drools 5.0 to 5.3Final

2012-02-08 Thread Michael Anstis
The problem has existed since 5.2 and would potentially affect loading any
earlier version.

Prior to 5.2 the object model used by the guided decision table did not
hold a Pattern to which individual condition columns are bound.

The conversion code groups individual condition columns into the
appropriate group and moves the underlying column data accordingly (as
there was no guarantee columns with the same bound name were consecutive).

There was a problem with the creation and insertion of the new Pattern
objects that relied upon the order of entries in a HashMap being
consistent. This has now changed.

I know others have been using the new guided decision table with old
repositories without problem and our unit tests did not detect the problem
either.

AFAIK this is the first report of any such issue since the release of 5.2's
betas, however I would be wrong to say there is no risk.

sent on the move

On 8 Feb 2012 01:22, "vadlam"  wrote:

> does this issue happen for any previous version of Guvnor data such as 5.0
> or 5.1 or 5.2 exported and imported into a Guvnor 5.3 repository ?
>
> does this mean, we cannot rely on 5.3.0 version of Guvnor code when
> migrating data from a previous version and should rather apply the fix  ?
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/rules-users-Migrating-repository-data-from-Drools-5-0-to-5-3Final-tp3715772p3724570.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