Re: [rules-users] Guvnor errors stay forever

2011-07-05 Thread Michael Anstis
Please raise a new JIRA for the first problem (HTTP500). Please include an
example rule that causes the failure.

The second issue, I believe, is the same as
https://issues.jboss.org/browse/GUVNOR-1465.

With kind regards,

Mike

On 4 July 2011 22:18, Justin Case send_lotsa_spam_h...@yahoo.com wrote:

 Hi all,

 Here's a funny thing I experience:
 I declare a function and do the mistake of verifying it before editing
 anything,
 while it's still a template (so it has chevrons). The verify obviously
 fails -
 but with a HTTP error 500! Server crashed?? Indeed I can see in the
 console:
at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
 [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_12]
 Caused by: java.lang.RuntimeException: Verifier Errors:
[ERR 102] Line 1:9 mismatched input '' in function
[ERR 102] Line 1:36 mismatched input '' in function calculateAge
[ERR 102] Line 1:46 mismatched input '' in function calculateAge
Parser returned a null Package
 I see quite a few JIRAs about incomplete exception handling - GUVNOR-741,
 GUVNOR-690, GUVNOR-536, should I add the above to any of them?

 Whatever, an error is an error, but here comes the real problem:

 After the above I come to realize that each analysis of a package keeps
 adding
 the results of the previous ones, so the Errors/Warnings list just grows
 and
 grows. An old error will always come again even though the item it refers
 to is
 not even existing anymore (so I cannot analyse/verify anything reliably). I
 renamed the above function, I edited it so it doesn't have the chevrons,
 its
 code can be validated fine, but nevertheless Guvnor keeps throwing the same
 error 500 and the JBoss console keeps complaining about the ld function
 calculateAge and its chevrons each time I verify or analyse. And it does
 that by
 repeating the message for each retry once more. Either the error list is
 not
 cleaned after the verify, or some artifacts live too long. Logout and
 relogon
 keeps the list, but restarting JBoss solves the problem.
 .
 I really have the feeling GUVNOR-1499 has the same underlying problem...

 For the record: I'm on 5.2.0.Final on JBoss 6, Java 6 on Windows XP.

 Thank you very much,
 JC
 ___
 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] Using Enumeration for long lists

2011-07-05 Thread lansyj
Hi, 

We are planning to use Drools for a Blacklist validation logic which
requires us to manage very long list (could be tens of thousands of IDs).
Can we use the native Drools enumeration for this? Would this be an optimal
implementation?

The other option we were thinking of was to have a list managed separately
in our core application and have in lucene indexed such that Drools rule
checks against the index. But, as you can see, it creates a lot of
development as well as maintenance overhead.

Thanks in advance for any tips on this topic.

Best Regard

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140051.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] Retrieving Enumerated List from Drools

2011-07-05 Thread lansyj
Hi, 

We have a custom CMS which we use to manage content like banner images, and
other personalization content. 

We would be using Drools to define user segments and would be associating a
unique code and short name to it - code for the system and short name for
the business users.

Now, is there a way for our custom CMS to be able to retrieve the enumerated
list (basically all possible values of that data element) such that it can
be used for mapping content in the CMS?

Any tip would be helpful.

Best Regards

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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] Using Enumeration for long lists

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 10:39, lansyj lans...@gmail.com wrote:

 Hi,

 We are planning to use Drools for a Blacklist validation logic which
 requires us to manage very long list (could be tens of thousands of IDs).
 Can we use the native Drools enumeration for this?


What do you mean by native Drools enumeration?



 Would this be an optimal
 implementation?


IDs such as phone numbers or email addresses are strings, so what sort of
access do you need that's not efficiently feasible with a hash map or hash
set? Detailed knowledge of the value disrtibution of your IDs might be used
for an optimum hash function, but that's a technicality.

-W



 The other option we were thinking of was to have a list managed separately
 in our core application and have in lucene indexed such that Drools rule
 checks against the index. But, as you can see, it creates a lot of
 development as well as maintenance overhead.

 Thanks in advance for any tips on this topic.

 Best Regard

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140051.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] Using Enumeration for long lists

2011-07-05 Thread Swindells, Thomas
How complex are the blacklist rules that you are planning to have?
From what you have described it sounds like it is just substring/startswith 
matches?
If this is the case then you may be better just to query lucene or the database
directly as you'll result in a very flat extremely wide graph that drools isn't 
going
to be able to optimize at all - it will basically just iterate over every 
string doing the
string comparison.
Lucene/the database are likely to be much more optimized and efficient for this.

If on the other hand your blacklist logic is much more complicated, taking into
account multiple criteria such as username, time of day, source ip address,
phase of the moon etc then drools may be easier to optimize development
speed and maintainance,.

Thomas

 -Original Message-
 From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
 boun...@lists.jboss.org] On Behalf Of lansyj
 Sent: 05 July 2011 09:39
 To: rules-users@lists.jboss.org
 Subject: [rules-users] Using Enumeration for long lists

 Hi,

 We are planning to use Drools for a Blacklist validation logic which requires 
 us
 to manage very long list (could be tens of thousands of IDs).
 Can we use the native Drools enumeration for this? Would this be an optimal
 implementation?

 The other option we were thinking of was to have a list managed separately
 in our core application and have in lucene indexed such that Drools rule
 checks against the index. But, as you can see, it creates a lot of development
 as well as maintenance overhead.

 Thanks in advance for any tips on this topic.

 Best Regard

 -lj

 --
 View this message in context: http://drools.46999.n3.nabble.com/Using-
 Enumeration-for-long-lists-tp3140051p3140051.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


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

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


Re: [rules-users] Retrieving Enumerated List from Drools

2011-07-05 Thread Wolfgang Laun
Please understand that you are reporting from a domain that *you* know well
using terms that are familiar to *you*.

It's not clear to me what sort of objects you would insert; which values
participate in what operation; and why you need rules in the first place.

-W


On 5 July 2011 10:46, lansyj lans...@gmail.com wrote:

 Hi,

 We have a custom CMS which we use to manage content like banner images, and
 other personalization content.

 We would be using Drools to define user segments and would be associating a
 unique code and short name to it - code for the system and short name for
 the business users.

 Now, is there a way for our custom CMS to be able to retrieve the
 enumerated
 list (basically all possible values of that data element) such that it can
 be used for mapping content in the CMS?

 Any tip would be helpful.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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] Retrieving Enumerated List from Drools

2011-07-05 Thread Michael Anstis
Hi,

Can you explain how you'd use ...Drools to define user segments and would
be associating a unique code and short name to it... so we can understand
how you expect to be ...able to retrieve the enumerated list?

Thanks,

Mike

On 5 July 2011 09:46, lansyj lans...@gmail.com wrote:

 Hi,

 We have a custom CMS which we use to manage content like banner images, and
 other personalization content.

 We would be using Drools to define user segments and would be associating a
 unique code and short name to it - code for the system and short name for
 the business users.

 Now, is there a way for our custom CMS to be able to retrieve the
 enumerated
 list (basically all possible values of that data element) such that it can
 be used for mapping content in the CMS?

 Any tip would be helpful.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140076.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] Using Enumeration for long lists

2011-07-05 Thread lansyj
Hi, 

I understand Drools does support enumerated lists of values for checking
conditions and assigning consequences. Am i mistaken?

The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
validation would be just the basic full word match.

Best Regards

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.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] Using Enumeration for long lists

2011-07-05 Thread Michael Anstis
Guvnor supports enumerated lists of values that can be included in rules.

Drools itself (the rule engine) provides for the compilation and execution
of rules; ultimately written in plain text - Guvnor provides a UI layer of
abstraction over the text generation that allows use of enumerations.

You can use Java enumerations in Drools rule definitions, but you still need
to write the rules using such enumerations.

On 5 July 2011 09:54, lansyj lans...@gmail.com wrote:

 Hi,

 I understand Drools does support enumerated lists of values for checking
 conditions and assigning consequences. Am i mistaken?

 The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
 validation would be just the basic full word match.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.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] Using Enumeration for long lists

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 10:54, lansyj lans...@gmail.com wrote:

 Hi,

 I understand Drools does support enumerated lists of values for checking
 conditions and assigning consequences. Am i mistaken?


It's using a Rete network, and I've never heard enumerated lists of values
in any description of the involved algorithms. Where does this come from?


 The ID would be a numeric value of 8 or 12 bytes in length. The Blacklist
 validation would be just the basic full word match.


Basically a subset of positive long values; if area codes are involved,
distribution is not regular (even within a certain number of  digits). But a
hash lookup on the String value should give you good performance.

   Subscriber( $addr: address )
   Blacklist( set contains $addr )
then
   refuse...

-W



 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Using-Enumeration-for-long-lists-tp3140051p3140095.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] Retrieving Enumerated List from Drools

2011-07-05 Thread lansyj
Hi, 

Sorry for the minimal information.

We have a B2C application which is basically into eCommerce. You can
consider it another amazon or ebay.

And one thing we do today in a very crude way is personalize the appearance
and content (ie., products, pricing of products, banner images, etc) based
on the user profile. For example, on Valentine's day if the user is a male,
he gets to see gifts for a female and vice versa.

So, as part of a Solution revamp, we have decided to use Drools to manage
product visibility by having a rule which says... if the user is male, dont
show this but show that as a basic example. Now, there are certain
functionalities we have as core in our Content Management System (like a
custom Joomla or Drupal) which we wouldnt want to migrate entirely to
Drools. So, we would define the segments in Drools and map such segments to
the existing entities.

eg: Segment can be Male vs Female with Segment Codes SEG_MALE and SEG_FEMALE
as an example where SEG_MALE and SEG_FEMALE are two possible values in an
enumerated list. Now, this being the situation, we want to be able to
retrieve this list of enumerated values into our CMS so that we can map them
to existing entities like banner images.

Hope this helps.

Best Regards

-lj

--
View this message in context: 
http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.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] Retrieving Enumerated List from Drools

2011-07-05 Thread Michael Anstis
OK, I'd see your use as something like this:-

1. Define the rules (you give an example of)
2. At runtime insert appropriate facts into a KnowledgeSession
3. The rules return some indicator of the appropriate customisation
required

If this makes sense, you should probably read about using Globals (to return
a list of customisations out of WM) or StatelessSessions (which sounds
more appropriate, for scalability).

On 5 July 2011 10:09, lansyj lans...@gmail.com wrote:

 Hi,

 Sorry for the minimal information.

 We have a B2C application which is basically into eCommerce. You can
 consider it another amazon or ebay.

 And one thing we do today in a very crude way is personalize the appearance
 and content (ie., products, pricing of products, banner images, etc) based
 on the user profile. For example, on Valentine's day if the user is a male,
 he gets to see gifts for a female and vice versa.

 So, as part of a Solution revamp, we have decided to use Drools to manage
 product visibility by having a rule which says... if the user is male, dont
 show this but show that as a basic example. Now, there are certain
 functionalities we have as core in our Content Management System (like a
 custom Joomla or Drupal) which we wouldnt want to migrate entirely to
 Drools. So, we would define the segments in Drools and map such segments to
 the existing entities.

 eg: Segment can be Male vs Female with Segment Codes SEG_MALE and
 SEG_FEMALE
 as an example where SEG_MALE and SEG_FEMALE are two possible values in an
 enumerated list. Now, this being the situation, we want to be able to
 retrieve this list of enumerated values into our CMS so that we can map
 them
 to existing entities like banner images.

 Hope this helps.

 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.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] Retrieving Enumerated List from Drools

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 11:09, lansyj lans...@gmail.com wrote:

 Hi,

 Sorry for the minimal information.

 We have a B2C application which is basically into eCommerce. You can
 consider it another amazon or ebay.

 And one thing we do today in a very crude way is personalize the appearance
 and content (ie., products, pricing of products, banner images, etc) based
 on the user profile. For example, on Valentine's day if the user is a male,
 he gets to see gifts for a female and vice versa.


Sounds as if my wife would like me to shop there  ;-)



 So, as part of a Solution revamp, we have decided to use Drools to manage
 product visibility by having a rule which says... if the user is male, dont
 show this but show that as a basic example. Now, there are certain
 functionalities we have as core in our Content Management System (like a
 custom Joomla or Drupal) which we wouldnt want to migrate entirely to
 Drools. So, we would define the segments in Drools and map such segments to
 the existing entities.

 eg: Segment can be Male vs Female with Segment Codes SEG_MALE and
 SEG_FEMALE
 as an example where SEG_MALE and SEG_FEMALE are two possible values in an
 enumerated list.


Could be Java enum values or just String values, I suppose.


 Now, this being the situation, we want to be able to
 retrieve this list


Let's call it Collection


 of enumerated values into our CMS so that we can map them
 to existing entities like banner images.


There are several ways of extracting all values of a field of the full set
of facts of a given type.

You can do it in a rule, creating a List or a Set. Or you can run a query.

There is nothing mysterious about the Working Memory of Drools. It's a bunch
of objects and rules and queries operate on them according to your fancy
programming.



 Hope this helps.


And I hope to have allayed your fears ;-)

-W



 Best Regards

 -lj

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Retrieving-Enumerated-List-from-Drools-tp3140076p3140125.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] Guvnor errors stay forever

2011-07-05 Thread Justin Case
From: Michael Anstis michael.ans...@gmail.com
Please raise a new JIRA for the first problem (HTTP500). Please include an 
example rule that causes the failure.

I will do all that as soon as I will be able to login to JIRA (can't do much 
about Sorry, an error occurred trying to log you in - please try again.). 
Nevertheless I think a 4th issue related to the same thing - unhandled Verifier 
errors  - is going to split the efforts...

Thank you very much,
JC

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


Re: [rules-users] check whether a key is present in global Map, i.e. mimicking containsKey() behavior

2011-07-05 Thread esstrata
Hi,

  I found a possible cause from StatefulKnowledgeSession API:

/Also, it is a good practice to set your globals before inserting your facts
or starting your processes. Rules engines evaluate rules at fact insertion
time, and so, if you are using a global to constraint a fact pattern, and
the global is not set, you may receive a NullPointerException./

I did so and I no longer get the compilation error. However, 'eval'
construction is not working in LHS. I'm shifting to insert items from maps
into WM directly.

Cheers


esstrata wrote:
 
 Hello,
 
   I'm using Drools 5.1.1 in a JavaSE 6 project.
 
 I can't get running a rule where a value obtained from WM is check for
 existence as a key of a global Map.
 
 I have a map of the type ProductTextCode - Product, where keys are String
 and values Product
 /global Map productMap/
 
 Then in a rule a I want a condition where each String in WM is tested
 against map keyset.
 /
 rule Product ID not in products map
 dialect mvel  
 when
 $pid : String()   
 = Here goes the condition =
 then
 System.out.println(Invalid product id:  + $pid)
   retract ($pid)
 end
 /
 
 So far I've tried with productMap.containsKey($pid) but a get a MVEL error
 as it takes 'containsKey' as a property.
 
 Please help. Thank you.
 

esstrata wrote:
 
 Hello,
 
   I'm using Drools 5.1.1 in a JavaSE 6 project.
 
 I can't get running a rule where a value obtained from WM is check for
 existence as a key of a global Map.
 
 I have a map of the type ProductTextCode - Product, where keys are String
 and values Product
 /global Map productMap/
 
 Then in a rule a I want a condition where each String in WM is tested
 against map keyset.
 /
 rule Product ID not in products map
 dialect mvel  
 when
 $pid : String()   
 = Here goes the condition =
 then
 System.out.println(Invalid product id:  + $pid)
   retract ($pid)
 end
 /
 
 So far I've tried with productMap.containsKey($pid) but a get a MVEL error
 as it takes 'containsKey' as a property.
 
 Please help. Thank you.
 


--
View this message in context: 
http://drools.46999.n3.nabble.com/check-whether-a-key-is-present-in-global-Map-i-e-mimicking-containsKey-behavior-tp3137610p3140218.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] check whether a key is present in global Map, i.e. mimicking containsKey() behavior

2011-07-05 Thread esstrata
Hi,

  I checked and I was correctly using session.setGlobal. No idea why this
happens

Thank you

--
View this message in context: 
http://drools.46999.n3.nabble.com/check-whether-a-key-is-present-in-global-Map-i-e-mimicking-containsKey-behavior-tp3137610p3140225.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] org.hibernate.exception.LockAcquisitionException: could not delete:

2011-07-05 Thread Jose
Hi All,

   When i tried to execute the rule in multi threaded environment, i got
the below mentioned Error logs...

I just tried to execute the rule flow with 2 thread, always 1 got executed
successfully and one fails with the following error log.


ERROR LOG:
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
Hibernate: delete from ProcessInstanceInfo where InstanceId=? and OPTLOCK=?
2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 100] [RMI TCP
Connection(6)-10.50.53.32]: WARN: : SQL Error: 60, SQLState: 61000
2011/07/04 11:20:06.475{UTC} [JDBCExceptionReporter :
JDBCExceptionReporter.java: logExceptions: 101] [RMI TCP
Connection(6)-10.50.53.32]: ERROR: : ORA-00060: deadlock detected while
waiting for resource
2011/07/04 11:20:06.475{UTC} [AbstractFlushingEventListener :
AbstractFlushingEventListener.java: performExecutions: 324] [RMI TCP
Connection(6)-10.50.53.32]: ERROR: : Could not synchronize database state
with session
org.hibernate.exception.LockAcquisitionException: could not delete:
[org.drools.persistence.processinstance.ProcessInstanceInfo#8130]
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:112)..

Thanks,
Jose.

--
View this message in context: 
http://drools.46999.n3.nabble.com/org-hibernate-exception-LockAcquisitionException-could-not-delete-tp3140240p3140240.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] Drools Clustering

2011-07-05 Thread dan.dobrescu
Hi,
I've searched the forum, but I couldn't find nothing useful about my
question..
I've got a little problem.. So, I've implemented in Drools some rules,
mostly triggered by two external events... EVENTA, and EVENTB. My
applications is clustered, so it's possible that EVENTA is inserted from
NODE1 and EVENTB from NODE2. But in this case, I'll have different facts in
both sessions, and it's possible that my rules don't fire. Has drools
implemented clustering for statefull sessions? or how should I do, because
if both session are containing the same facts, the rules will be triggered
twice... I'd like a behavior similar to Quartz.. 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-Clustering-tp3140305p3140305.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] Absence Pattern question

2011-07-05 Thread wendy
Hi,
  I'm having trouble writing an absence pattern.  What I'm trying to do is
detect when there is an A followed by no Bs for 3+minutes.  I don't care if
there is more than one A.  What I'm running into is that when I try to use
'over window:time' the time within drools is the end time of the window.  So
this means I need to write the no Bs for 3+ min first:

not( $b: B() over window:time(3m))

then try to find the A before it:

$now: Long() from RuleUtilityFunctions.getSessionClockTime()
$a: A( this before [3m] $now)

then I should have to check to make sure that I don't have any Bs between
$a's time and the start of the no B window:

not( B( time = $a.time,
   time = $now))

This is not working.  I think that it has something to do with my function
to get the session clock time (RuleUtilityFunctions.getSessionClockTime())
and how things get evaluated within the Rete engine.  Because it does not
seem like $now is getting re-evaluated on future calls that pass the $b
condition.  If I replace $now with the call to getSessionClockTime()
everything just seems to get weird.  

I've tried to write the rule forward too.  Look for A followed by no B but
that does not seem to work because A is matched at the current time and the
rule triggers because there is no B because the future B data has not be
inserted into working memory yet.

What is the right way to write this rule?   Is there a way to get the start
and end time of the time window that met the over window:time() condition?

Thank you,
Wendy


--
View this message in context: 
http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140377.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] sliding window combination ?

2011-07-05 Thread Andre
thx Wendy

i have done it this way, but what is wrong with that function (which is a
static java method)

import function
de.tarent.abiege.drools.util.DroolsUtils.requestsAreMatchingSubjectsforID
rule Request Received Rule
dialect mvel
when
$actual: ContextRequestType()

ArrayList( size = 1 )
  from collect( $expected : ContextRequestType(
requestsAreMatchingSubjectsforID(expected,$actual, ID1)) over
window:time(1m) )

then
   
   System.out.println(Request Received Rule  Works );
   SubjectCacheEntry entry = new SubjectCacheEntry(new Subject(), new
Date(System.currentTimeMillis()+ 4000));
   channels[AuthZBlocking].send(entry);
end

Unable to Analyse Expression
requestsAreMatchingSubjectsforID($expected,$actual, ID1):
[Error: unable to resolve method using strict-mode:
de.tarent.abiege.drools.util.DroolsUtils.requestsAreMatchingSubjectsforID(de.tarent.abiege.jaxb.generated.xacml.context.ContextRequestType,
de.tarent.abiege.jaxb.generated.xacml.context.ContextRequestType,
java.lang.String)]
[Near : {... requestsAreMatchingSubjectsfor }]




--
View this message in context: 
http://drools.46999.n3.nabble.com/sliding-window-combination-tp3132340p3140409.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] Absence Pattern question

2011-07-05 Thread Wolfgang Laun
Try a rule with a timer:

rule AnoB
timer( int: 3m )
when
$a: A( status == waiting for B )
not B( this after $a )
then
modify( $a ){ setStatus( no B within 3m after me ) }
end

Untested.
-W


On 5 July 2011 13:00, wendy w.mungo...@yahoo.com wrote:

 Hi,
  I'm having trouble writing an absence pattern.  What I'm trying to do is
 detect when there is an A followed by no Bs for 3+minutes.  I don't care if
 there is more than one A.  What I'm running into is that when I try to use
 'over window:time' the time within drools is the end time of the window.
  So
 this means I need to write the no Bs for 3+ min first:

 not( $b: B() over window:time(3m))

 then try to find the A before it:

 $now: Long() from RuleUtilityFunctions.getSessionClockTime()
 $a: A( this before [3m] $now)

 then I should have to check to make sure that I don't have any Bs between
 $a's time and the start of the no B window:

 not( B( time = $a.time,
   time = $now))

 This is not working.  I think that it has something to do with my function
 to get the session clock time (RuleUtilityFunctions.getSessionClockTime())
 and how things get evaluated within the Rete engine.  Because it does not
 seem like $now is getting re-evaluated on future calls that pass the $b
 condition.  If I replace $now with the call to getSessionClockTime()
 everything just seems to get weird.

 I've tried to write the rule forward too.  Look for A followed by no B but
 that does not seem to work because A is matched at the current time and the
 rule triggers because there is no B because the future B data has not be
 inserted into working memory yet.

 What is the right way to write this rule?   Is there a way to get the start
 and end time of the time window that met the over window:time() condition?

 Thank you,
 Wendy


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140377.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] Absence Pattern question

2011-07-05 Thread Michael Anstis
Won't that just make the rule activate after 3 minutes?

rule AnoB
when
$a: A( status == waiting for B )
not B( this after [3m] $a )
then
modify( $a ){ setStatus( no B within 3m after me ) }
end

Is this any good?

Also untested ;)

2011/7/5 Wolfgang Laun wolfgang.l...@gmail.com

 Try a rule with a timer:

 rule AnoB
 timer( int: 3m )
 when
 $a: A( status == waiting for B )
 not B( this after $a )
 then
 modify( $a ){ setStatus( no B within 3m after me ) }
 end

 Untested.
 -W



 On 5 July 2011 13:00, wendy w.mungo...@yahoo.com wrote:

 Hi,
  I'm having trouble writing an absence pattern.  What I'm trying to do is
 detect when there is an A followed by no Bs for 3+minutes.  I don't care
 if
 there is more than one A.  What I'm running into is that when I try to use
 'over window:time' the time within drools is the end time of the window.
  So
 this means I need to write the no Bs for 3+ min first:

 not( $b: B() over window:time(3m))

 then try to find the A before it:

 $now: Long() from RuleUtilityFunctions.getSessionClockTime()
 $a: A( this before [3m] $now)

 then I should have to check to make sure that I don't have any Bs between
 $a's time and the start of the no B window:

 not( B( time = $a.time,
   time = $now))

 This is not working.  I think that it has something to do with my function
 to get the session clock time (RuleUtilityFunctions.getSessionClockTime())
 and how things get evaluated within the Rete engine.  Because it does not
 seem like $now is getting re-evaluated on future calls that pass the $b
 condition.  If I replace $now with the call to getSessionClockTime()
 everything just seems to get weird.

 I've tried to write the rule forward too.  Look for A followed by no B but
 that does not seem to work because A is matched at the current time and
 the
 rule triggers because there is no B because the future B data has not be
 inserted into working memory yet.

 What is the right way to write this rule?   Is there a way to get the
 start
 and end time of the time window that met the over window:time() condition?

 Thank you,
 Wendy


 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140377.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


[rules-users] Can we use a Collection in LHS maintained in Guvnor

2011-07-05 Thread Prasad
Hi All,

Is there a way in which we can use a collection in LHS of a rule (to be used
in contains, memberof) , which can be managed in Guvnor containing big list
of elements (may be 10,000).

Having this in a Database is an option but considering the maintenance of
the list where in a user(who doesn't have Database Knowledge) has to update
the list frequently, can this collection be maintained in Guvnor and used in
LHS of a rule.

Thanks,
NP

--
View this message in context: 
http://drools.46999.n3.nabble.com/Can-we-use-a-Collection-in-LHS-maintained-in-Guvnor-tp3140532p3140532.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] Absence Pattern question

2011-07-05 Thread wendy
Thanks,
  This did it:

rule AnoB
timer(int: 3m)
  when

   $a: A()
  not($b: B( this after[-1ms] $a))  
then 

 

I needed to add [-1ms] so it would not match things with A and B at the same
exact time.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140552.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] Absence Pattern question

2011-07-05 Thread Wolfgang Laun
On 5 July 2011 14:19, wendy w.mungo...@yahoo.com wrote:

 Thanks,
  This did it:

 rule AnoB
 timer(int: 3m)
  when

$a: A()
  not($b: B( this after[-1ms] $a))
 then

  

 I needed to add [-1ms] so it would not match things with A and B at the
 same
 exact time.


Hmm, truly a borderline case :)

Thanks for the feedback!
-W



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Absence-Pattern-question-tp3140377p3140552.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] sliding window combination ?

2011-07-05 Thread Andre
sry but was my fault , as always.. 
the rule is working ...

--
View this message in context: 
http://drools.46999.n3.nabble.com/sliding-window-combination-tp3132340p3140672.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] Drools and ArrayList

2011-07-05 Thread wendy
Have you tried using the accumulate function?

//taken from the link below and modified a bit to use count.. (it is
untested)

rule Count the number of items in the order
when
$order : Order()
$total : Number( ) 
 from accumulate( OrderItem( order == $order),  count( ) )
then
 System.out.println(There are +$total+  number of items in the order);

end


http://docs.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/4.3/html/JBoss_Rules_Reference_Guide/ch05s05s02s10.html
 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-and-ArrayList-tp3140821p3141665.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] Guvnor 5.2.0-Final in Tomcat 6.0.32 fail to compile rules

2011-07-05 Thread Michael Anstis
Hi,

Can you provide your object model too please?

Thanks,

Mike

On 5 July 2011 17:59, pamerida elp...@hotmail.com wrote:

 Thanks Mike,

 My rule definition is (the image cause is defined with the guided editor
 from Guvnor)

 http://drools.46999.n3.nabble.com/file/n3141579/drools.jpg

 and the result source:

 rule prueba
 dialect mvel
 when
  Cuscar( UNB.size() == 0 )
 then
 end

 Cuscar is defined in my model and it contains an ArrayList called UNB (with
 is getters and setters), Guvnor seems to recognize everything OK because it
 let me select the correct options for the type ArrayList from the drop down
 menu, but when i click the validate option it throws me this error:

 [prueba] Unable to wire compiled classes, probably related to compilation
 failures:[Error: no such identifier: UNB] [Near : {... UNB.size() }] ^
 [Line: 1, Column: 1]

 the identifier that doesnt seems to recognize is size(), I have already
 tryed this rule:

 rule prueba
 dialect mvel
 when
Cuscar( UNB == null )
 then
 end

 and it compiles just fine... I wonder if it has something to do with the
 strict mode that I posted in my first message?...

 Thanks so much for your help :)



 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Guvnor-5-2-0-Final-in-Tomcat-6-0-32-fail-to-compile-rules-tp3139077p3141579.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] Guvnor 5.2.0-Final in Tomcat 6.0.32 fail to compile rules

2011-07-05 Thread pamerida
Heres my model:

http://drools.46999.n3.nabble.com/file/n3142257/rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar
rules-drools-model-1.0.0-SNAPSHOT-jar-with-dependencies.jar 

the class used in the rules is this:

package gt.gob.sat.aduana.carga.rules.edifact.cuscar;

import java.io.*;
import java.util.Iterator;
import java.util.List;
import gt.gob.sat.aduana.carga.rules.edifact.common.*;

public class Cuscar
implements Serializable
{

private static final long serialVersionUID = 1L;
private List UNB;
private List UNH;
private List BGM;
private List segmentGroup1;
private List segmentGroup2;
private List FTX;
private List segmentGroup4;
private List GIS;
private List segmentGroup5;
private List CNT;
private List segmentGroup7;
private List segmentGroup17;
private List UNT;
private List UNZ;

public Cuscar()
{
}

public List getBGM() {
return BGM;
}

public void setBGM(List bGM) {
BGM = bGM;
}

public List getSegmentGroup1() {
return segmentGroup1;
}

public void setSegmentGroup1(List segmentGroup1) {
this.segmentGroup1 = segmentGroup1;
}

public List getSegmentGroup2() {
return segmentGroup2;
}

public void setSegmentGroup2(List segmentGroup2) {
this.segmentGroup2 = segmentGroup2;
}

public List getFTX() {
return FTX;
}

public void setFTX(List fTX) {
FTX = fTX;
}

public List getSegmentGroup4() {
return segmentGroup4;
}

public void setSegmentGroup4(List segmentGroup4) {
this.segmentGroup4 = segmentGroup4;
}

public List getGIS() {
return GIS;
}

public void setGIS(List gIS) {
GIS = gIS;
}

public List getSegmentGroup5() {
return segmentGroup5;
}

public void setSegmentGroup5(List segmentGroup5) {
this.segmentGroup5 = segmentGroup5;
}

public List getCNT() {
return CNT;
}

public void setCNT(List cNT) {
CNT = cNT;
}

public List getSegmentGroup7() {
return segmentGroup7;
}

public void setSegmentGroup7(List segmentGroup7) {
this.segmentGroup7 = segmentGroup7;
}

public List getSegmentGroup17() {
return segmentGroup17;
}

public void setSegmentGroup17(List segmentGroup17) {
this.segmentGroup17 = segmentGroup17;
}


public List getUNH() {
return UNH;
}

public void setUNH(List uNH) {
UNH = uNH;
}

public List getUNT() {
return UNT;
}

public void setUNT(List uNT) {
UNT = uNT;
}

public List getUNZ() {
return UNZ;
}

public void setUNZ(List uNZ) {
UNZ = uNZ;
}

public List getUNB() {
return UNB;
}

public void setUNB(List uNB) {
UNB = uNB;
}



Thank you...


--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-5-2-0-Final-in-Tomcat-6-0-32-fail-to-compile-rules-tp3139077p3142257.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] Question about deploying Guvnor is SAP NetWeaver

2011-07-05 Thread Patricia Bogoevici






p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 
14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Tahoma; min-height: 16.0px}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Tahoma}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 14.0px; font: 13.0px 
Tahoma; min-height: 16.0px}
span.s1 {font: 13.0px Tahoma}





I am running Gunvor 5.1, and try to deploy this build in SAP NetWeaver 7.3 The 
SAP server is using JDK6. The error I get when deploying is this:  Caused by: 
com.sap.engine.library.bytecode.cf.CFException: Invalid constant pool tag, 60 
at index 41.


I checked SAP user forum, and I found one old post re migrating some J2EE 
applications from JBoss 4.2.3 but there was no fix for that.


I know that this looks like a NetWeaver issue, but I wonder if anybody else 
tried to deploy Guvnor in SAP server, or has any NetWeaver deployment 
experience that can share. Also, if anybody ran into this issue (Invalid 
constant pool tag, 60 at index 41.) can tell how did they fix it? It might help 
in my case.


I would appreciate if someone has any input here.


Thanks,
Patricia___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] get inserted facts

2011-07-05 Thread Ruault Gaetan
Hi,

I use drools in stateless Session  like this :

session.execute( my_facts_list) ;

and i have many rules like this

when
Type1(filter1 =1)
Then
Insert( new Fact()) ;


Could you explain how it's possible to retrieve my new facts in java code ?


Thanks.

Gaetan


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


Re: [rules-users] get inserted facts

2011-07-05 Thread Nathan Bell
Without knowing your use cases, or what you intended to do with the
facts once you retrieve them, I'd suggest that you could simply add them
to a global list and examine the list contents after rule processing.
For example:

 

import java.util.List;

 

global List results;

 

rule IWantToTrackMyConsequenceFacts

when 

Type1(filter1 =1) 

then

Fact someFact = new Fact();

insert(someFact);

results.add(someFact);

end

 

 

Prior to executing the rule(s) you will have to set that global variable
to a valid list object with something like this:

 

knowledgeSession.setGlobal(results, new ArrayList());

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ruault Gaetan
Sent: Tuesday, July 05, 2011 5:13 PM
To: Rules Users List
Subject: [rules-users] get inserted facts

 

Hi,

 

I use drools in stateless Session  like this :

 

session.execute( my_facts_list) ;

 

and i have many rules like this

 

when 

Type1(filter1 =1) 

Then

Insert( new Fact()) ;

 

 

Could you explain how it's possible to retrieve my new facts in java
code ?

 

 

Thanks.

 

Gaetan

 

 

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


[rules-users] Classloading error with AspectJ and Drools 5.2.0.Final

2011-07-05 Thread Steven Williams
Hi,

I have just upgraded to Drools 5.2.0.Final and am getting a weird error when
running unit tests.

   java.lang.NullPointerException

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
ClassLoaderWeavingAdaptor.java:251)

at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
DefaultWeavingContext.java:130)

at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
ClassLoaderWeavingAdaptor.java:161)

at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
Aj.java:271)

at
org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
Aj.java:276)

at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)

at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)

at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
ClassPreProcessorAgentAdapter.java:54)

at sun.instrument.TransformerManager.transform(TransformerManager.java:169)

at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:365
)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
JavaDialectRuntimeData.java:570)

at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:258)

at org.drools.util.CompositeClassLoader$CachingLoader.load(
CompositeClassLoader.java:241)

at org.drools.util.CompositeClassLoader.loadClass(
CompositeClassLoader.java:88)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:405)

at org.drools.rule.JavaDialectRuntimeData.wire(
JavaDialectRuntimeData.java:396)

at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
JavaDialectRuntimeData.java:237)

at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
DialectRuntimeRegistry.java:132)

at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)

at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)

at org.drools.compiler.PackageBuilder.addPackageFromDrl(
PackageBuilder.java:360)

at org.drools.compiler.PackageBuilder.addKnowledgeResource(
PackageBuilder.java:538)

at org.drools.builder.impl.KnowledgeBuilderImpl.add(
KnowledgeBuilderImpl.java:28)

at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
KnowledgeBaseBuilder.java:108)

at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:69)

at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
KnowledgeBaseBuilder.java:54)


I have traced the problem to org.drools.rule.
JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
whereas AspectJ expects it to at least return an empty enumeration - hence
the NPE. Interestingly the problem does not occur when running our server,
however we can't upgrade unless our unit tests pass and we can't easily turn
off aspectj for these.

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


[rules-users] How to update the working memory of a nested object attribute

2011-07-05 Thread Wishing Carebear
Hi,
My rules update the nested object attributes :eligibilityScore which is used
in another rule downstream.

Only the Client object is sent as fact, the nested object is derived using
the from keyword (list of services)

rule  Rule 8 EligibilityRating
agenda-group  EligibilityRating
no-loop true
salience 5
//dialect  mvel
when
$client : Client(type == Preferred)
$policy : Service(productType == Vehicle Insurance) from
$client.service
then
System.out.println( Rule 8 ER = type == preferred:+
$policy.getId() + : -50);
int eScore = $policy.getEligibilityScore() - 50;
   * $policy.setEligibilityScore(eScore);* // how to let the downstream
rule know that this atribute value is updated without letting this current
rule go into infinite loop
end

Any suggestion is greatly appreciated
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] How to change database configuration from derby to oracle?

2011-07-05 Thread Deepak Cherukuri
Dear All,

Firstly, before deploying the Drools guvnor in weblogic11g , I set the
repository configuration in components.xml.below is the path i mentioned for
repositoryConfiguration

component name=repositoryConfiguration
property name=homeDirectoryE:/GuvnorRepo//property

Deployed the Drools guvnor in weblogic11g , and in E drive GuvnorRepo folder
has created with 3 sub folders workspaces,repository,version and
repository.xml.
Now i updated the repository.xml for changing the database from derby to
oracle.
Below are the changes
PersistenceManager
class=org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManage
r 
param name=driver value=oracle.jdbc.driver.OracleDriver/ 
param name=url value=jdbc:oracle:thin:@rsa10gserver:1525:ifpub34/ 
param name=user value=drools_repository/ 
param name=password value=drools_repository/ 
param name=schema value=oracle/ 
param name=schemaObjectPrefix value=version_/ 
param name=tableSpace value=/ 
param name=errorHandling value=/ 
/PersistenceManager

Now i restarted the weblogic11g and it successfully deployed and entered
into the login page and but i could not see any rules in the left navigation
page.

Is there any other procedure rather than what I have done?

Whether I should import/export new repository.xml ?

Please help me regarding this.

 

 

Thanks  Regards

 

Deepak Cherukuri | Software Engineer

Value Momentum Software Services Pvt Ltd(SEZUnit),

HitechCity2, Gachibowli(V)

Hyderabad 500 081

 mailto:deepak.cheruk...@valuemomentum.biz
deepak.cheruk...@valuemomentum.biz 

 Cell: +91 95537 - 95999

 http://www.valuemomentum.com/ http://www.valuemomentum.com

cid:image003.jpg@01CA595B.191D0A30

 

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


Re: [rules-users] Classloading error with AspectJ and Drools 5.2.0.Final

2011-07-05 Thread Steven Williams
Clarification to this - it does also happen when we run our server. So this
is preventing us from upgrading to 5.2

My guess is that getResources should return getParent().getResources()
rather than null.

regards
Steve

On Wed, Jul 6, 2011 at 1:42 PM, Steven Williams stevearoo...@gmail.comwrote:

 Hi,

 I have just upgraded to Drools 5.2.0.Final and am getting a weird error
 when running unit tests.

 java.lang.NullPointerException

 at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.parseDefinitions(
 ClassLoaderWeavingAdaptor.java:251)

 at org.aspectj.weaver.loadtime.DefaultWeavingContext.getDefinitions(
 DefaultWeavingContext.java:130)

 at org.aspectj.weaver.loadtime.ClassLoaderWeavingAdaptor.initialize(
 ClassLoaderWeavingAdaptor.java:161)

 at
 org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.initialize(
 Aj.java:271)

 at
 org.aspectj.weaver.loadtime.Aj$ExplicitlyInitializedClassLoaderWeavingAdaptor.getWeavingAdaptor(
 Aj.java:276)

 at org.aspectj.weaver.loadtime.Aj$WeaverContainer.getWeaver(Aj.java:254)

 at org.aspectj.weaver.loadtime.Aj.preProcess(Aj.java:90)

 at org.aspectj.weaver.loadtime.ClassPreProcessorAgentAdapter.transform(
 ClassPreProcessorAgentAdapter.java:54)

 at sun.instrument.TransformerManager.transform(TransformerManager.java:169
 )

 at sun.instrument.InstrumentationImpl.transform(
 InstrumentationImpl.java:365)

 at java.lang.ClassLoader.defineClass1(Native Method)

 at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)

 at java.lang.ClassLoader.defineClass(ClassLoader.java:616)

 at org.drools.rule.JavaDialectRuntimeData$PackageClassLoader.fastFindClass(
 JavaDialectRuntimeData.java:570)

 at org.drools.util.CompositeClassLoader$CachingLoader.load(
 CompositeClassLoader.java:258)

 at org.drools.util.CompositeClassLoader$CachingLoader.load(
 CompositeClassLoader.java:241)

 at org.drools.util.CompositeClassLoader.loadClass(
 CompositeClassLoader.java:88)

 at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

 at org.drools.rule.JavaDialectRuntimeData.wire(
 JavaDialectRuntimeData.java:405)

 at org.drools.rule.JavaDialectRuntimeData.wire(
 JavaDialectRuntimeData.java:396)

 at org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(
 JavaDialectRuntimeData.java:237)

 at org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(
 DialectRuntimeRegistry.java:132)

 at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:796)

 at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:751)

 at org.drools.compiler.PackageBuilder.addPackageFromDrl(
 PackageBuilder.java:360)

 at org.drools.compiler.PackageBuilder.addKnowledgeResource(
 PackageBuilder.java:538)

 at org.drools.builder.impl.KnowledgeBuilderImpl.add(
 KnowledgeBuilderImpl.java:28)

 at au.com.promedicus.rules.KnowledgeBaseBuilder.addPackagesFromList(
 KnowledgeBaseBuilder.java:108)

 at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
 KnowledgeBaseBuilder.java:69)

 at au.com.promedicus.rules.KnowledgeBaseBuilder.build(
 KnowledgeBaseBuilder.java:54)


 I have traced the problem to org.drools.rule.
 JavaDialectRuntimeData$PackageClassLoader.getResources. This returns null
 whereas AspectJ expects it to at least return an empty enumeration - hence
 the NPE. Interestingly the problem does not occur when running our server,
 however we can't upgrade unless our unit tests pass and we can't easily turn
 off aspectj for these.

 regards
 Steve

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