[rules-users] Rules not firing when facts asserted in a rule RHS in 5.0

2010-12-01 Thread Chris Selwyn
I have been using the open source Drools 5.1 where I have been inserting 
facts in the RHS of a rule and that has been causing subsequent rules to 
fire just fine.

However, I am working at a customer that requires my to use a supported 
product, so I have moved my rules over to JBoss Rules 5.0.2 and I find 
that this does not work any more.

I have a declarative fact type as follows
declare QuestionValidation
 question: String
 state: String
 mandatory: Boolean
 type: String
end

I have an init rule with high salience that inserts a number of 
QuestionValidations into the session.

In order to test what is going on, I created a rule:-
rule 'Test'
dialect 'mvel'
when
 $qv: QuestionValidation()
then
 System.out.println( QuestionValidation found  + $qv.getQuestion() 
+ / + $qv.getState() );
end

This rule never fires if I insert a QuestionValidation in the init rule!

I can see the facts being inserted in the log as follows
[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
 
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true, state=Closed, 
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]

But I don't see any associated ACTIVATION CREATED for this object.

However, if I insert a QuestionValidation fact created in Java by using 
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then the Test 
rule gets fired just fine.

Is there something I am missing? Do I need to to turn on rule chaining 
or something like that? (Surely chaining is on by default).

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


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0

2010-12-01 Thread Wolfgang Laun
We aren't seeing the code where the insertions happen, but I suppose that's
identical to
repeats of
   QuestionValidation qc = new QuestionValidation();
   insert( qv );

I'm sure you've also ascertained that the inserted value:QuestionValidation
is the very same type (including package) as the one used in rule Test.

I would try and use a Java equivalent for the declared class
QuestionValidation,
just to see whether this is at the root of the problem.

-W


On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk wrote:

 I have been using the open source Drools 5.1 where I have been inserting
 facts in the RHS of a rule and that has been causing subsequent rules to
 fire just fine.

 However, I am working at a customer that requires my to use a supported
 product, so I have moved my rules over to JBoss Rules 5.0.2 and I find
 that this does not work any more.

 I have a declarative fact type as follows
 declare QuestionValidation
 question: String
 state: String
 mandatory: Boolean
 type: String
 end

 I have an init rule with high salience that inserts a number of
 QuestionValidations into the session.

 In order to test what is going on, I created a rule:-
 rule 'Test'
 dialect 'mvel'
 when
 $qv: QuestionValidation()
 then
 System.out.println( QuestionValidation found  + $qv.getQuestion()
 + / + $qv.getState() );
 end

 This rule never fires if I insert a QuestionValidation in the init rule!

 I can see the facts being inserted in the log as follows

 [#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
 thread-pool-1; w: 7;|
 OBJECT ASSERTED value:QuestionValidation( mandatory=true, state=Closed,
 question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]

 But I don't see any associated ACTIVATION CREATED for this object.

 However, if I insert a QuestionValidation fact created in Java by using
 kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then the Test
 rule gets fired just fine.

 Is there something I am missing? Do I need to to turn on rule chaining
 or something like that? (Surely chaining is on by default).

 Chris
 ___
 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] Rules not firing when facts asserted in a rule RHS in 5.0

2010-12-01 Thread Wolfgang Laun
A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk wrote:



 I can see the facts being inserted in the log as follows

 [#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
 thread-pool-1; w: 7;|
 OBJECT ASSERTED value:QuestionValidation( mandatory=true, state=Closed,
 question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?



 However, if I insert a QuestionValidation fact created in Java by using
 kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then the Test
 rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

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


Re: [rules-users] Task Server as Jboss Service

2010-12-01 Thread Mauricio Salatino
Hmm it really depends on your scenario.
Mina doesn't have message realibility and a lot of things that HornetQ
provides. But If you are OK with Mina you can use it.


2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 No, I didn't, I just saw some sources in the drools-process-task module. I
 preferred to go with what is in the documentation, wondering that Mina
 transport is the recommended approach.

 2010/12/1 Mauricio Salatino sala...@gmail.com

 did you try the HornetQ integration?
 The main idea was to create a transport agnostic TaskServer, so for each
 implementation you can choose between different technologies depending on
 the situation.
 I'm not sure if there is another effort for this kind of deployment.. if
 no one else answer this mail feel free to propose and contribute with your
 ideas.
 Greetings

 2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 If there's no other way/plans to deploy it, even using HornetQ
 integration, I'll be more than happy to contribute!

 2010/11/30 Mauricio Salatino sala...@gmail.com

 I think that your idea would be a great contribution!

 2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 Hi guys,


 I think that would be great if we could deploy the TaskServer
 (MinaTaskServer) as a JbossMC bean, making possible to administer it using
 admin-console.

 There's any work in this way or other plans to deploy this component?


 Thanks.



 --
 Best regards,

 Cristiano Nicolai

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




 --
 Best regards,

 Cristiano Nicolai

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




 --
 Best regards,

 Cristiano Nicolai

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




-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

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


[rules-users] Drools + Spring without internet

2010-12-01 Thread Anderson Rocha
Hi all,

I realized that to use Drools with Spring I need to be conected to the
internet, but sometimes I am not. There is a way to download the tags of
Drools and configure the applicationContext.xml to seek for them localy?

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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Anderson Rocha
Thank you for your replay.

I downloaded the schemas and configured the applicationContext.xml like
this, consider path to my the path to the file.

beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:drools=http://drools.org/schema/drools-spring;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xsi:schemaLocation=http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

*http://drools.org/schema/drools-springfile:///path/to/my/drools-spring-1.0.0.xsd
*

*http://camel.apache.org/schema/springfile:///path/to/my/camel-spring.xsd;
*

I have a web application, and when I execute it works =) but I have some
unit tests and I initialize the spring with the code

ApplicationContext applicationContext = new
ClassPathXmlApplicationContext(new String[] {applicationContext.xml});

In this case I get the same error I had before. Any ideia?

Anderson

2010/12/1 Mauricio Salatino sala...@gmail.com

 yes you can download the schemas to your hard drive and point the
 applicationContext.xml to them.


 2010/12/1 Anderson Rocha anderson.u...@gmail.com

 Hi all,

 I realized that to use Drools with Spring I need to be conected to the
 internet, but sometimes I am not. There is a way to download the tags of
 Drools and configure the applicationContext.xml to seek for them localy?

 Regards,
 Anderson

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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


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


[rules-users] Question about collect and sliding windows

2010-12-01 Thread Anais Martinez

Hello. I have two questions about collect and sliding windows. I have created
this rule:

rule Active risk
when
 $n:Node()
 $readings: ArrayList(size==80)  from collect(
   Reading( nodeID == $n.nodeID, 
(signalType == SignalType.PLUVIOSITY  value = 10)||
(signalType == SignalType.AIR_TEMPERATURE  value=12)
   ) over window:time(10h))
then
  System.out.println(Active risk in node + $n.getNodeID());
end

And the declarations are the following (Reading and Node are java classes):

declare Reading
@role(event)
@timestamp (timestamp)
end

declare Node
@role(fact)
end


Well, I have probe the rule. I have inserted 100 readings which satisfy the
conditions, in a single time but with different timestamp (I have simulated
that there are a pluviosity reading and a air_temperature reading each 15
minutes), that is, in main:

long init= 129072960L; 
long interval = 1000*60*15;
for (int i=0; i100; i++){
long fecha = init+i*interval;
Reading r1 = new Reading(SignalType.PLUVIOSITY, value1, node);
session.insert(r1);

Reading r2 = new Reading(SignalType.AIR_TEMPERATURE, value1, node);
session.insert(r2);
}

The message is not written (I have fired rules after insertions). 

My questions: 
Has drools any problem if I inserted all readings at same time? (Do I have
to use the pseudo-clock?)
My problem is that the readings will be sent from a server in real system,
and it's possible that the server will send all readings belonging to an
interval of one/two hour/s at same time. 

Thanks.

-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Question-about-collect-and-sliding-windows-tp1999562p1999562.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0

2010-12-01 Thread Chris Selwyn
Yes the package is SWWB2BOutgoing but it looks as though the package 
name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so far is 
that I am getting two (and maybe more) entries for the class 
SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in Java by
using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then the
Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10

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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Geoffrey De Smet
IIRC, there's something in drools-spring we can do, so the xsd's don't 
have to be downloaded from the internet but can be used directly from 
the jar.
It might be a properties file or something in the jar, which says urlX = 
pathYinTheJar.

Op 01-12-10 15:59, Anderson Rocha schreef:
 Thank you for your replay.

 I downloaded the schemas and configured the applicationContext.xml 
 like this, consider path to my the path to the file.

 beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:drools=http://drools.org/schema/drools-spring;
xmlns:camel=http://camel.apache.org/schema/spring;
xsi:schemaLocation=http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 *http://drools.org/schema/drools-spring 
 file:///path/to/my/drools-spring-1.0.0.xsd*
 *http://camel.apache.org/schema/spring 
 file:///path/to/my/camel-spring.xsd*

 I have a web application, and when I execute it works =) but I have 
 some unit tests and I initialize the spring with the code

 ApplicationContext applicationContext = new 
 ClassPathXmlApplicationContext(new String[] {applicationContext.xml});

 In this case I get the same error I had before. Any ideia?

 Anderson

 2010/12/1 Mauricio Salatino sala...@gmail.com mailto:sala...@gmail.com

 yes you can download the schemas to your hard drive and point the
 applicationContext.xml to them.


 2010/12/1 Anderson Rocha anderson.u...@gmail.com
 mailto:anderson.u...@gmail.com

 Hi all,

 I realized that to use Drools with Spring I need to be
 conected to the internet, but sometimes I am not. There is a
 way to download the tags of Drools and configure the
 applicationContext.xml to seek for them localy?

 Regards,
 Anderson

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




 -- 
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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



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

-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] Question about collect and sliding windows

2010-12-01 Thread Wolfgang Laun
A sliding window requires the use of STREAM mode, and you must use a
session clock, pseudo or real-time.

I'm also a worried about size==80; shouldn't you use size = 80?
But this depends on the way you run the session; are you doing this
with fireUntilHalt in a separate thread?

It shouldn't be a problem if the session is run with a real-time clock and
delayed events (with the timestamp in the data, as you apparently have)
arrive and are inserted. Docs say that that this is OK, as long as events
are inserted in each entry-point in chronological order. If there are
different streams, each with individual delays, you may have to use
multiple entry-points.


On 1 December 2010 16:10, Anais Martinez amarti...@iti.upv.es wrote:


 Hello. I have two questions about collect and sliding windows. I have
 created
 this rule:

 rule Active risk
 when
  $n:Node()
  $readings: ArrayList(size==80)  from collect(
   Reading( nodeID == $n.nodeID,
(signalType == SignalType.PLUVIOSITY  value = 10)||
(signalType == SignalType.AIR_TEMPERATURE  value=12)
   ) over window:time(10h))
 then
  System.out.println(Active risk in node + $n.getNodeID());
 end

 And the declarations are the following (Reading and Node are java classes):

 declare Reading
@role(event)
@timestamp (timestamp)
 end

 declare Node
@role(fact)
 end


 Well, I have probe the rule. I have inserted 100 readings which satisfy the
 conditions, in a single time but with different timestamp (I have simulated
 that there are a pluviosity reading and a air_temperature reading each 15
 minutes), that is, in main:

 long init= 129072960L;
 long interval = 1000*60*15;
 for (int i=0; i100; i++){
long fecha = init+i*interval;
Reading r1 = new Reading(SignalType.PLUVIOSITY, value1, node);
session.insert(r1);

Reading r2 = new Reading(SignalType.AIR_TEMPERATURE, value1, node);
session.insert(r2);
 }

 The message is not written (I have fired rules after insertions).

 My questions:
 Has drools any problem if I inserted all readings at same time? (Do I have
 to use the pseudo-clock?)
 My problem is that the readings will be sent from a server in real system,
 and it's possible that the server will send all readings belonging to an
 interval of one/two hour/s at same time.

 Thanks.

 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Question-about-collect-and-sliding-windows-tp1999562p1999562.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Jason Davidson
I had the same issue at startup (i.e. not connected to the internet).
 Anyway, I used the XSD files are bundled in the drools-spring-5.1.1.jar.  I
simply changed my application context schema location to 
http://drools.org/schema/drools-spring
http://drools.org/schema/drools-spring.xsd; and the XSD files are loaded
from the jar file at startup.

On Wed, Dec 1, 2010 at 8:21 AM, Corneil du Plessis corn...@tsctech.comwrote:

 change schema location to that is only contains filenames like

 beans xmlns=http://www.springframework.org/schema/beans;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:drools=http://drools.org/schema/drools-spring;
xmlns:camel=http://camel.apache.org/schema/spring;
 
 xsi:schemaLocation=http://www.springframework.org/schema/beansspring-beans-2.5.xsd
 http://drools.org/schema/drools-spring drools-spring-1.0.0.xsd
 http://camel.apache.org/schema/spring camel-spring.xsd

 Then put the xsd files in same folder as applicationContext.xml


 On 01/12/2010 17:15, Geoffrey De Smet wrote:
  IIRC, there's something in drools-spring we can do, so the xsd's don't
  have to be downloaded from the internet but can be used directly from
  the jar.
  It might be a properties file or something in the jar, which says urlX =
  pathYinTheJar.
 
  Op 01-12-10 15:59, Anderson Rocha schreef:
  Thank you for your replay.
 
  I downloaded the schemas and configured the applicationContext.xml
  like this, consider path to my the path to the file.
 
  beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:drools=http://drools.org/schema/drools-spring;
  xmlns:camel=http://camel.apache.org/schema/spring;
  xsi:schemaLocation=http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
  *http://drools.org/schema/drools-spring
  file:///path/to/my/drools-spring-1.0.0.xsd*
  *http://camel.apache.org/schema/spring
  file:///path/to/my/camel-spring.xsd*
 
  I have a web application, and when I execute it works =) but I have
  some unit tests and I initialize the spring with the code
 
  ApplicationContext applicationContext = new
  ClassPathXmlApplicationContext(new String[] {applicationContext.xml});
 
  In this case I get the same error I had before. Any ideia?
 
  Anderson
 
  2010/12/1 Mauricio Salatinosala...@gmail.commailto:sala...@gmail.com
 
 
   yes you can download the schemas to your hard drive and point the
   applicationContext.xml to them.
 
 
   2010/12/1 Anderson Rochaanderson.u...@gmail.com
   mailto:anderson.u...@gmail.com
 
   Hi all,
 
   I realized that to use Drools with Spring I need to be
   conected to the internet, but sometimes I am not. There is a
   way to download the tags of Drools and configure the
   applicationContext.xml to seek for them localy?
 
   Regards,
   Anderson
 
   ___
   rules-users mailing list
   rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
 
   https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
 
   --
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar
 
- Salatino Salaboy Mauricio -
 
   ___
   rules-users mailing list
   rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
   https://lists.jboss.org/mailman/listinfo/rules-users
 
 
 
  ___
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


[rules-users] Problem deploying Drools V5 as a webservice on Weblogic 10

2010-12-01 Thread P-Yves G

Hello,

I am trying to migrate an application of my company from Drools V4.0.7 to
V5.1.1 (without actually using features brought by v5), and I am currently
experiencing a problem.
The application is called via an Axis web service deployed on a Weblogic 10
server, using JDK v1.5.0_14. I have two ways to test the application:
- A simple java class that sets the facts and calls directly the implemented
method of the web service
- Using soapUI, after having deployed the .war file of my web service on my
Weblogic server.
While in V4, everything works fine, java test and web service test (with
SoapUI) alike, I get the expected results. With V5, the Java test works as
expected, but the web service test fails (I get a
java.lang.reflect.InvocationTargetException without any StackTrace).

I put the server in debug mode and tried to narrow down the problem in
eclipse the best I could. The first difference I noticed, was that the
classloader was different between the two test methods:
- for the java test: Launcher$AppClassLoader
- for the WS test: ChangeAwareClassLoader
However, I don't really know how it affects the execution. After debugging
deeper into the code, I found out the difference: at some point (see stack
below) it seems to get the wrong referent from Reference.class. In the
java test, the referent is an ObjectStreamClass, whereas in the web
service test, it becomes a NoClassDefFoundError...

Where could that come from ? Does it have something to do with the
ClassLoader (I admit this area is out of the bounds of my coding skills) ?

For more details, here is the stack from my java test (some lines excluded)
: 

ObjectStreamClass.lookup(Class, boolean) line: 261  
ObjectStreamClass.initNonProxy(ObjectStreamClass, Class,
ClassNotFoundException, ObjectStreamClass) line: 531
DroolsObjectInputStream(ObjectInputStream).readNonProxyDesc(boolean) line:
1552
DroolsObjectInputStream(ObjectInputStream).readClassDesc(boolean) line: 1466
DroolsObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean) line:
1699
DroolsObjectInputStream(ObjectInputStream).readObject0(boolean) line: 1305  
DroolsObjectInputStream(ObjectInputStream).readObject() line: 348   
HashMapK,V.readObject(ObjectInputStream) line: 1067   
NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not
available [native method]   
NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39  
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
Method.invoke(Object, Object...) line: 585  
ObjectStreamClass.invokeReadObject(Object, ObjectInputStream) line: 946 
DroolsObjectInputStream(ObjectInputStream).readSerialData(Object,
ObjectStreamClass) line: 1809   
DroolsObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean) line:
1719
DroolsObjectInputStream(ObjectInputStream).readObject0(boolean) line: 1305  
DroolsObjectInputStream(ObjectInputStream).readObject() line: 348   
DialectRuntimeRegistry.readExternal(ObjectInput) line: 59   
DroolsObjectInputStream(ObjectInputStream).readExternalData(Externalizable,
ObjectStreamClass) line: 1755   
DroolsObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean) line:
1717
DroolsObjectInputStream(ObjectInputStream).readObject0(boolean) line: 1305  
DroolsObjectInputStream(ObjectInputStream).readObject() line: 348   
Package.readExternal(ObjectInput) line: 197 
DroolsObjectInputStream(ObjectInputStream).readExternalData(Externalizable,
ObjectStreamClass) line: 1755   
DroolsObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean) line:
1717
DroolsObjectInputStream(ObjectInputStream).readObject0(boolean) line: 1305  
DroolsObjectInputStream(ObjectInputStream).readObject() line: 348   
DroolsStreamUtils.streamIn(InputStream, ClassLoader, boolean) line: 205 
DroolsStreamUtils.streamIn(InputStream) line: 174   
FileScanner.readPackage(File) line: 147 
FileScanner.getChangeSet() line: 97 
FileScanner.loadPackageChanges() line: 72   
DirectoryScanner.loadPackageChanges() line: 85  

And here is the stack, at the same point, from my web service (difference in
bold) :

ObjectStreamClass.lookup(Class, boolean) line: 261  
ObjectStreamClass.initNonProxy(ObjectStreamClass, Class,
ClassNotFoundException, ObjectStreamClass) line: 531
DroolsObjectInputStream(ObjectInputStream).readNonProxyDesc(boolean) line:
1552
DroolsObjectInputStream(ObjectInputStream).readClassDesc(boolean) line: 1466
DroolsObjectInputStream(ObjectInputStream).readOrdinaryObject(boolean) line:
1699
DroolsObjectInputStream(ObjectInputStream).readObject0(boolean) line: 1305  
DroolsObjectInputStream(ObjectInputStream).readObject() line: 348   
HashMapK,V.readObject(ObjectInputStream) line: 1067   
GeneratedMethodAccessor2.invoke(Object, Object[]) line: not available   
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object...) line: 585  

[rules-users] scoping spring beans

2010-12-01 Thread Kumar, Ravendra
Hello, 

 

I wonder,  if some spring drools  expert guy  help me to set the
ksession bean's  bean scope like below.

 

drools:ksession kbase=kbase1 type=stateless id=stateless 

property scope=prototype/

/drools:ksession

 

 

Any help will be highly appriciated

 

Thanks,

 

Rav

 

 

 

 

 

 



Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.

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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Geoffrey De Smet
Corneil, that's an imperfect solution because that your IDE won't find 
the xsd's automatically and give you code completion.

The perfect solution IIRC is:
- use the full http...xsd reference in your xmls (just like you do for 
other spring schema's)
- write a patch for drools-spring so it has a properties file to tell 
spring which http...xsd maps to which xsd resource on the classpath

Op 01-12-10 16:21, Corneil du Plessis schreef:
 change schema location to that is only contains filenames like

 beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:drools=http://drools.org/schema/drools-spring;
  xmlns:camel=http://camel.apache.org/schema/spring;
  xsi:schemaLocation=http://www.springframework.org/schema/beans 
 spring-beans-2.5.xsd
 http://drools.org/schema/drools-spring drools-spring-1.0.0.xsd
 http://camel.apache.org/schema/spring camel-spring.xsd

 Then put the xsd files in same folder as applicationContext.xml


 On 01/12/2010 17:15, Geoffrey De Smet wrote:
 IIRC, there's something in drools-spring we can do, so the xsd's don't
 have to be downloaded from the internet but can be used directly from
 the jar.
 It might be a properties file or something in the jar, which says urlX =
 pathYinTheJar.

 Op 01-12-10 15:59, Anderson Rocha schreef:
 Thank you for your replay.

 I downloaded the schemas and configured the applicationContext.xml
 like this, consider path to my the path to the file.

 beans xmlns=http://www.springframework.org/schema/beans;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns:drools=http://drools.org/schema/drools-spring;
  xmlns:camel=http://camel.apache.org/schema/spring;
  xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 *http://drools.org/schema/drools-spring
 file:///path/to/my/drools-spring-1.0.0.xsd*
 *http://camel.apache.org/schema/spring
 file:///path/to/my/camel-spring.xsd*

 I have a web application, and when I execute it works =) but I have
 some unit tests and I initialize the spring with the code

 ApplicationContext applicationContext = new
 ClassPathXmlApplicationContext(new String[] {applicationContext.xml});

 In this case I get the same error I had before. Any ideia?

 Anderson

 2010/12/1 Mauricio Salatinosala...@gmail.commailto:sala...@gmail.com

   yes you can download the schemas to your hard drive and point the
   applicationContext.xml to them.


   2010/12/1 Anderson Rochaanderson.u...@gmail.com
   mailto:anderson.u...@gmail.com

   Hi all,

   I realized that to use Drools with Spring I need to be
   conected to the internet, but sometimes I am not. There is a
   way to download the tags of Drools and configure the
   applicationContext.xml to seek for them localy?

   Regards,
   Anderson

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




   --
- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar

- Salatino Salaboy Mauricio -

   ___
   rules-users mailing list
   rules-users@lists.jboss.orgmailto: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


-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] Question about collect and sliding windows

2010-12-01 Thread Wolfgang Laun
On 1 December 2010 17:19, Anais Martinez amarti...@iti.upv.es wrote:


  What does your thread do after it returns from fireAllRules?

 My thread sleeps five minutes and then it fires again: (intervalLength =
 5*60*1000):


You might as well let the Engine sleep, waiting for news.

If you turn it on, every now and then, you'll get all sorts of delays. Say,
an event arrives 1ms after you've returned from an unsuccessful
fireAllRules()
(there's no fireRules() method, is there?), then you won't get any
reaction
until next time round, i.e., 5 minutes later. This may not be as expected.

Regards
-W



 @Override
public void run(){

while(!end){
try {
Thread.sleep(intervalLength);
int nRules = ksession.fireRules();
if(nRules  0){
logger.debug(nRules +  reglas disparadas.);
}
}
catch (InterruptedException e) {
logger.error(e);
}

}

}

 Well, if the events arrive on schedule it should be OK, but what about the
 delayed arrivals?

 Ah, ok...

 Thank you, again.


 --
 View this message in context:
 http://drools-java-rules-engine.46999.n3.nabble.com/Question-about-collect-and-sliding-windows-tp1999562p277.html
 Sent from the Drools - User mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users

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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Geoffrey De Smet
The key is probably in this file:
   
drools/drools-container/drools-spring/src/main/resources/META-INF/spring.schemas

Op 01-12-10 17:45, Geoffrey De Smet schreef:
 Corneil, that's an imperfect solution because that your IDE won't find
 the xsd's automatically and give you code completion.

 The perfect solution IIRC is:
 - use the full http...xsd reference in your xmls (just like you do for
 other spring schema's)
 - write a patch for drools-spring so it has a properties file to tell
 spring which http...xsd maps to which xsd resource on the classpath

 Op 01-12-10 16:21, Corneil du Plessis schreef:
 change schema location to that is only contains filenames like

 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:drools=http://drools.org/schema/drools-spring;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xsi:schemaLocation=http://www.springframework.org/schema/beans 
 spring-beans-2.5.xsd
 http://drools.org/schema/drools-spring drools-spring-1.0.0.xsd
 http://camel.apache.org/schema/spring camel-spring.xsd

 Then put the xsd files in same folder as applicationContext.xml


 On 01/12/2010 17:15, Geoffrey De Smet wrote:
 IIRC, there's something in drools-spring we can do, so the xsd's don't
 have to be downloaded from the internet but can be used directly from
 the jar.
 It might be a properties file or something in the jar, which says urlX =
 pathYinTheJar.

 Op 01-12-10 15:59, Anderson Rocha schreef:
 Thank you for your replay.

 I downloaded the schemas and configured the applicationContext.xml
 like this, consider path to my the path to the file.

 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:drools=http://drools.org/schema/drools-spring;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 *http://drools.org/schema/drools-spring
 file:///path/to/my/drools-spring-1.0.0.xsd*
 *http://camel.apache.org/schema/spring
 file:///path/to/my/camel-spring.xsd*

 I have a web application, and when I execute it works =) but I have
 some unit tests and I initialize the spring with the code

 ApplicationContext applicationContext = new
 ClassPathXmlApplicationContext(new String[] {applicationContext.xml});

 In this case I get the same error I had before. Any ideia?

 Anderson

 2010/12/1 Mauricio Salatinosala...@gmail.commailto:sala...@gmail.com

yes you can download the schemas to your hard drive and point the
applicationContext.xml to them.


2010/12/1 Anderson Rochaanderson.u...@gmail.com
mailto:anderson.u...@gmail.com

Hi all,

I realized that to use Drools with Spring I need to be
conected to the internet, but sometimes I am not. There is a
way to download the tags of Drools and configure the
applicationContext.xml to seek for them localy?

Regards,
Anderson

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




--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -

___
rules-users mailing list
rules-users@lists.jboss.orgmailto: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


-- 
With kind regards,
Geoffrey De Smet


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


Re: [rules-users] Drools + Spring without internet

2010-12-01 Thread Anderson Rocha
Thank you all. I will try some of these solutions later, and post the results.

2010/12/1, Geoffrey De Smet ge0ffrey.s...@gmail.com:
 The key is probably in this file:

 drools/drools-container/drools-spring/src/main/resources/META-INF/spring.schemas

 Op 01-12-10 17:45, Geoffrey De Smet schreef:
 Corneil, that's an imperfect solution because that your IDE won't find
 the xsd's automatically and give you code completion.

 The perfect solution IIRC is:
 - use the full http...xsd reference in your xmls (just like you do for
 other spring schema's)
 - write a patch for drools-spring so it has a properties file to tell
 spring which http...xsd maps to which xsd resource on the classpath

 Op 01-12-10 16:21, Corneil du Plessis schreef:
 change schema location to that is only contains filenames like

 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:drools=http://drools.org/schema/drools-spring;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xsi:schemaLocation=http://www.springframework.org/schema/beans
 spring-beans-2.5.xsd
 http://drools.org/schema/drools-spring drools-spring-1.0.0.xsd
 http://camel.apache.org/schema/spring camel-spring.xsd

 Then put the xsd files in same folder as applicationContext.xml


 On 01/12/2010 17:15, Geoffrey De Smet wrote:
 IIRC, there's something in drools-spring we can do, so the xsd's don't
 have to be downloaded from the internet but can be used directly from
 the jar.
 It might be a properties file or something in the jar, which says urlX =
 pathYinTheJar.

 Op 01-12-10 15:59, Anderson Rocha schreef:
 Thank you for your replay.

 I downloaded the schemas and configured the applicationContext.xml
 like this, consider path to my the path to the file.

 beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xmlns:drools=http://drools.org/schema/drools-spring;
   xmlns:camel=http://camel.apache.org/schema/spring;

 xsi:schemaLocation=http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 *http://drools.org/schema/drools-spring
 file:///path/to/my/drools-spring-1.0.0.xsd*
 *http://camel.apache.org/schema/spring
 file:///path/to/my/camel-spring.xsd*

 I have a web application, and when I execute it works =) but I have
 some unit tests and I initialize the spring with the code

 ApplicationContext applicationContext = new
 ClassPathXmlApplicationContext(new String[]
 {applicationContext.xml});

 In this case I get the same error I had before. Any ideia?

 Anderson

 2010/12/1 Mauricio
 Salatinosala...@gmail.commailto:sala...@gmail.com

yes you can download the schemas to your hard drive and point
 the
applicationContext.xml to them.


2010/12/1 Anderson Rochaanderson.u...@gmail.com
mailto:anderson.u...@gmail.com

Hi all,

I realized that to use Drools with Spring I need to be
conected to the internet, but sometimes I am not. There is a
way to download the tags of Drools and configure the
applicationContext.xml to seek for them localy?

Regards,
Anderson

___
rules-users mailing list

 rules-users@lists.jboss.orgmailto:rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -

___
rules-users mailing list
rules-users@lists.jboss.orgmailto: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


 --
 With kind regards,
 Geoffrey De Smet


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


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


Re: [rules-users] @role( event ) in guvnor

2010-12-01 Thread John Peterson
Message: 3
Date: Tue, 30 Nov 2010 02:16:05 -0800 (PST)
From: Pankaj Khattar pankaj.khatt...@alcatel-lucent.com
Subject: Re: [rules-users] @role( event ) in guvnor
To: rules-users@lists.jboss.org
Message-ID: 1291112165767-1991857.p...@n3.nabble.com
Content-Type: text/plain; charset=us-ascii


Thanks for the info.

Is there any workaround for the same as i am migerating my existing drl
file
to guvnor  the drl file contains 
@role( event )  @expires( 5m )
-- 
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/role-event-in-guvnor
-tp1991538p1991857.html
Sent from the Drools - User mailing list archive at Nabble.com.

Pankaj,

Try this - go into Guvnor and create a technical rule.  Clear out the
WHEN-THEN (i.e. make it blank).  In the rule editor, type:

declare factName
  @role(event)
  @expires(5m)
end

It should validate without any problems.  I think this might solve your
problem.  The other thing I discovered is that the Guided Editor won't
support entry-points, but you can use the Technical Editor for it, or
you can try to put the verbiage in the DSL translations.



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


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0 - diagnosed with workaround (but not fixed)

2010-12-01 Thread Chris Selwyn

Having spent all day on this one, I have finally got to the bottom of it.

The problem is reproducible if I have /both/ a declarative fact model 
/and/ a function in my rules.
It doesn't matter whether the function is called or not... It's presence 
is enough to  cause the problem.


Any rule that is dependent on the existence of an instance of the 
declarative fact model where the instance is created in the RHS of 
another rule will not fire.


I suspect that this is a bug that has been fixed in 5.1 because I have 
been using this technique in Drools 5.1... It's only since downgrading 
to the (supported) JBoss Rules 5.0 that I have experienced the problem.


Does anyone know if there is a fix in the 5.0 branch?

If I create a real Java class and upload it in a jar file to the 
Guvnor and use that in place of the declarative model then the problem 
does not happen.
This is a workaround in the short term but I would much prefer not to 
have to do this.


Chris Selwyn


On 01/12/2010 15:14, Chris Selwyn wrote:
Yes the package is SWWB2BOutgoing but it looks as though the package 
name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so far 
is that I am getting two (and maybe more) entries for the class 
SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in Java by
using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then
the Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10

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


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0 - diagnosed with workaround (but not fixed)

2010-12-01 Thread Tihomir Surdilovic
Hi Chris, could you attach the repository export xml from your repo that 
I can use to reproduce the issue with? BRMS 5.1 (supported bits) is 
right around the corner and I would be able to tell you if the issue 
still persists with the currently tested bits for 5.1.


Thanks.
Tihomir

On 12/1/10 4:29 PM, Chris Selwyn wrote:

Having spent all day on this one, I have finally got to the bottom of it.

The problem is reproducible if I have /both/ a declarative fact model 
/and/ a function in my rules.
It doesn't matter whether the function is called or not... It's 
presence is enough to  cause the problem.


Any rule that is dependent on the existence of an instance of the 
declarative fact model where the instance is created in the RHS of 
another rule will not fire.


I suspect that this is a bug that has been fixed in 5.1 because I have 
been using this technique in Drools 5.1... It's only since downgrading 
to the (supported) JBoss Rules 5.0 that I have experienced the problem.


Does anyone know if there is a fix in the 5.0 branch?

If I create a real Java class and upload it in a jar file to the 
Guvnor and use that in place of the declarative model then the problem 
does not happen.
This is a workaround in the short term but I would much prefer not to 
have to do this.


Chris Selwyn


On 01/12/2010 15:14, Chris Selwyn wrote:
Yes the package is SWWB2BOutgoing but it looks as though the 
package name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so far 
is that I am getting two (and maybe more) entries for the class 
SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in Java
by using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then
the Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



___
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] Rules not firing when facts asserted in a rule RHS in 5.0 - diagnosed with workaround (but not fixed)

2010-12-01 Thread Chris Selwyn
Having just looked in the Drools JIRA repository, I pretty sure that it 
is the same issue as was reported in JBRULES-2140 
https://jira.jboss.org/browse/JBRULES-2140.

That entry has a repro.

I am interested as to what you mean by right around the corner?

Here is a repro anyway...

QUOTE
package rulestest
global java.util.logging.Logger logger

declare QuestionValidation
question: String
mandatory: Boolean
state: String
type: String
end

function void testfunc() {
System.out.println(testfunc called);

}

rule 'init'
dialect mvel
when
eval(true)
then
QuestionValidation qv = new QuestionValidation();
qv.setState(ss);
qv.setQuestion(qq);
insert(qv);
logger.info(Hello world);

end

rule 'test'
dialect mvel
when
$qv: QuestionValidation()
then
logger.info(Found a qv  + $qv);

end
/QUOTE

If the testfunc is present then the test rule never fires. If it is 
not present then the test rule fires just fine.


Chris

On 01/12/2010 21:47, Tihomir Surdilovic wrote:
Hi Chris, could you attach the repository export xml from your repo 
that I can use to reproduce the issue with? BRMS 5.1 (supported bits) 
is right around the corner and I would be able to tell you if the 
issue still persists with the currently tested bits for 5.1.


Thanks.
Tihomir

On 12/1/10 4:29 PM, Chris Selwyn wrote:

Having spent all day on this one, I have finally got to the bottom of it.

The problem is reproducible if I have /both/ a declarative fact model 
/and/ a function in my rules.
It doesn't matter whether the function is called or not... It's 
presence is enough to  cause the problem.


Any rule that is dependent on the existence of an instance of the 
declarative fact model where the instance is created in the RHS of 
another rule will not fire.


I suspect that this is a bug that has been fixed in 5.1 because I 
have been using this technique in Drools 5.1... It's only since 
downgrading to the (supported) JBoss Rules 5.0 that I have 
experienced the problem.


Does anyone know if there is a fix in the 5.0 branch?

If I create a real Java class and upload it in a jar file to the 
Guvnor and use that in place of the declarative model then the 
problem does not happen.
This is a workaround in the short term but I would much prefer not to 
have to do this.


Chris Selwyn


On 01/12/2010 15:14, Chris Selwyn wrote:
Yes the package is SWWB2BOutgoing but it looks as though the 
package name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so 
far is that I am getting two (and maybe more) entries for the class 
SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in Java
by using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then
the Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



___
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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3291 - Release Date: 12/01/10

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


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0 - diagnosed with workaround (but not fixed)

2010-12-01 Thread Tihomir Surdilovic


On 12/1/10 5:09 PM, Chris Selwyn wrote:
Having just looked in the Drools JIRA repository, I pretty sure that 
it is the same issue as was reported in JBRULES-2140 
https://jira.jboss.org/browse/JBRULES-2140.

That entry has a repro.

thanks for finding


I am interested as to what you mean by right around the corner?


this month

Here is a repro anyway...

QUOTE
package rulestest
global java.util.logging.Logger logger

declare QuestionValidation
question: String
mandatory: Boolean
state: String
type: String
end

function void testfunc() {
System.out.println(testfunc called);

}

rule 'init'
dialect mvel
when
eval(true)
then
QuestionValidation qv = new QuestionValidation();
qv.setState(ss);
qv.setQuestion(qq);
insert(qv);
logger.info(Hello world);

end

rule 'test'
dialect mvel
when
$qv: QuestionValidation()
then
logger.info(Found a qv  + $qv);

end
/QUOTE

If the testfunc is present then the test rule never fires. If it is 
not present then the test rule fires just fine.


Chris

On 01/12/2010 21:47, Tihomir Surdilovic wrote:
Hi Chris, could you attach the repository export xml from your repo 
that I can use to reproduce the issue with? BRMS 5.1 (supported bits) 
is right around the corner and I would be able to tell you if the 
issue still persists with the currently tested bits for 5.1.


Thanks.
Tihomir

On 12/1/10 4:29 PM, Chris Selwyn wrote:
Having spent all day on this one, I have finally got to the bottom 
of it.


The problem is reproducible if I have /both/ a declarative fact 
model /and/ a function in my rules.
It doesn't matter whether the function is called or not... It's 
presence is enough to  cause the problem.


Any rule that is dependent on the existence of an instance of the 
declarative fact model where the instance is created in the RHS of 
another rule will not fire.


I suspect that this is a bug that has been fixed in 5.1 because I 
have been using this technique in Drools 5.1... It's only since 
downgrading to the (supported) JBoss Rules 5.0 that I have 
experienced the problem.


Does anyone know if there is a fix in the 5.0 branch?

If I create a real Java class and upload it in a jar file to the 
Guvnor and use that in place of the declarative model then the 
problem does not happen.
This is a workaround in the short term but I would much prefer not 
to have to do this.


Chris Selwyn


On 01/12/2010 15:14, Chris Selwyn wrote:
Yes the package is SWWB2BOutgoing but it looks as though the 
package name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so 
far is that I am getting two (and maybe more) entries for the class 
SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in Java
by using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation) then
the Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



___
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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3291 - Release Date: 12/01/10



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


Re: [rules-users] Rules not firing when facts asserted in a rule RHS in 5.0 - diagnosed with workaround (but not fixed)

2010-12-01 Thread Tihomir Surdilovic

On 12/1/10 6:04 PM, Tihomir Surdilovic wrote:


On 12/1/10 5:09 PM, Chris Selwyn wrote:
Having just looked in the Drools JIRA repository, I pretty sure that 
it is the same issue as was reported in JBRULES-2140 
https://jira.jboss.org/browse/JBRULES-2140.
Fix for JBRULES-2140 https://jira.jboss.org/browse/JBRULES-2140  will 
be included in the next release of the supported bits (5.1). Since you 
already are using supported bits I assume you know where to check for 
updates.
If you cannot upgrade, open a ticket with JBoss support and request a 
backport fix.



That entry has a repro.

thanks for finding


I am interested as to what you mean by right around the corner?


this month

Here is a repro anyway...

QUOTE
package rulestest
global java.util.logging.Logger logger

declare QuestionValidation
question: String
mandatory: Boolean
state: String
type: String
end

function void testfunc() {
System.out.println(testfunc called);

}

rule 'init'
dialect mvel
when
eval(true)
then
QuestionValidation qv = new QuestionValidation();
qv.setState(ss);
qv.setQuestion(qq);
insert(qv);
logger.info(Hello world);

end

rule 'test'
dialect mvel
when
$qv: QuestionValidation()
then
logger.info(Found a qv  + $qv);

end
/QUOTE

If the testfunc is present then the test rule never fires. If it is 
not present then the test rule fires just fine.


Chris

On 01/12/2010 21:47, Tihomir Surdilovic wrote:
Hi Chris, could you attach the repository export xml from your repo 
that I can use to reproduce the issue with? BRMS 5.1 (supported 
bits) is right around the corner and I would be able to tell you if 
the issue still persists with the currently tested bits for 5.1.


Thanks.
Tihomir

On 12/1/10 4:29 PM, Chris Selwyn wrote:
Having spent all day on this one, I have finally got to the bottom 
of it.


The problem is reproducible if I have /both/ a declarative fact 
model /and/ a function in my rules.
It doesn't matter whether the function is called or not... It's 
presence is enough to  cause the problem.


Any rule that is dependent on the existence of an instance of the 
declarative fact model where the instance is created in the RHS of 
another rule will not fire.


I suspect that this is a bug that has been fixed in 5.1 because I 
have been using this technique in Drools 5.1... It's only since 
downgrading to the (supported) JBoss Rules 5.0 that I have 
experienced the problem.


Does anyone know if there is a fix in the 5.0 branch?

If I create a real Java class and upload it in a jar file to the 
Guvnor and use that in place of the declarative model then the 
problem does not happen.
This is a workaround in the short term but I would much prefer not 
to have to do this.


Chris Selwyn


On 01/12/2010 15:14, Chris Selwyn wrote:
Yes the package is SWWB2BOutgoing but it looks as though the 
package name simple doesn't get reported in the log file.


I have been debugging through this thing and where I've got to so 
far is that I am getting two (and maybe more) entries for the 
class SWWB2BOutgoing.QuestionValidation in the 
ObjectTypeConfigurationRepository.
So my current question is How is this possible? Is it maybe a 
classloader issue?


Chris


On 01/12/2010 12:05, Wolfgang Laun wrote:

A closer look:

On 1 December 2010 11:13, Chris Selwyn ch...@selwyn-family.me.uk 
mailto:ch...@selwyn-family.me.uk wrote:




I can see the facts being inserted in the log as follows

[#|2010-12-01T09:19:16.723+|INFO|sun-appserver2.1|javax.enterprise.system.stream.out|_ThreadID=70;_ThreadName=p:
thread-pool-1; w: 7;|
OBJECT ASSERTED value:QuestionValidation( mandatory=true,
state=Closed,
question=B2B_METER_SERIAL_NUMBER, type=string ) factId: 39|#]


Shouldn't the package name appear in the log as well?


However, if I insert a QuestionValidation fact created in
Java by using
kbase.getFactType(SWWB2BOutgoing, QuestionValidation)
then the Test
rule gets fired just fine.


That is, apparently SWWB2BOutgoing.

-W


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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 
11/30/10




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


No virus found in this message.
Checked by AVG - www.avg.com http://www.avg.com
Version: 10.0.1170 / Virus Database: 426/3290 - Release Date: 11/30/10



___
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


No virus found in 

Re: [rules-users] Task Server as Jboss Service

2010-12-01 Thread Cristiano Nicolai
That's interesting and important as well, I'll give a try with HornetQ...

There's any sample configuration? Which WorkItemHandler must be used...

Thanks

2010/12/1 Mauricio Salatino sala...@gmail.com

 Hmm it really depends on your scenario.
 Mina doesn't have message realibility and a lot of things that HornetQ
 provides. But If you are OK with Mina you can use it.



 2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 No, I didn't, I just saw some sources in the drools-process-task module. I
 preferred to go with what is in the documentation, wondering that Mina
 transport is the recommended approach.

 2010/12/1 Mauricio Salatino sala...@gmail.com

 did you try the HornetQ integration?
 The main idea was to create a transport agnostic TaskServer, so for each
 implementation you can choose between different technologies depending on
 the situation.
 I'm not sure if there is another effort for this kind of deployment.. if
 no one else answer this mail feel free to propose and contribute with your
 ideas.
 Greetings

 2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 If there's no other way/plans to deploy it, even using HornetQ
 integration, I'll be more than happy to contribute!

 2010/11/30 Mauricio Salatino sala...@gmail.com

 I think that your idea would be a great contribution!

 2010/11/30 Cristiano Nicolai cristiano.nico...@gmail.com

 Hi guys,


 I think that would be great if we could deploy the TaskServer
 (MinaTaskServer) as a JbossMC bean, making possible to administer it 
 using
 admin-console.

 There's any work in this way or other plans to deploy this component?


 Thanks.



 --
 Best regards,

 Cristiano Nicolai

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




 --
 Best regards,

 Cristiano Nicolai

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




 --
 Best regards,

 Cristiano Nicolai

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




 --
  - CTO @ http://www.plugtree.com
  - MyJourney @ http://salaboy.wordpress.com
  - Co-Founder @ http://www.jbug.com.ar

  - Salatino Salaboy Mauricio -

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




-- 
Best regards,

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


Re: [rules-users] @role( event ) in guvnor

2010-12-01 Thread Pankaj Khattar

Thanks for the info.
The approach works good except when i try to use sliding window on the fact
name in the rule.

for example:


import com.drools.service.AlertReceivedEvent;

declare AlertReceivedEvent
@role(event)
end

rule Delay Alert
no-loop true
dialect mvel
lock-on-active
when
AlertReceivedEvent( //condition) over window:time(90s) from 
entry-point
NotificationStream
then
// code to be executed
end 


when i try to validate this rule in guvnor then it gives me error as 

[Delay Alert] A Sliding Window behavior can only be assigned to patterns
declared with @role( event ). The pattern '[ClassObjectType
class=com.alu.ae.ais.smp.fm.drools.service.AlertReceivedEvent]' in the rule
'Delay Alert' is not declared as an Event.

please suggest.
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/role-event-in-guvnor-tp1991538p2004356.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users