Re: [rules-users] rule with array

2012-02-16 Thread shawn
Thank you~ -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3749524.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

Re: [rules-users] rule with array

2012-02-16 Thread Mark Proctor
On 15/02/2012 18:36, shawn wrote: yeah, I have thought about it. But if I use function, I have to write three for loops. like: /*function Boolean findSubject(Request request) { Pointer sPointer = request.getSubjectPath(); Pointer aPointer = request.getAuthorTable(); for(

Re: [rules-users] rule with array

2012-02-16 Thread shawn
Thanks~~ -- View this message in context: http://drools.46999.n3.nabble.com/rule-with-array-tp3747680p3752097.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org

[rules-users] rule with array

2012-02-15 Thread shawn
Hi, I meet a problem to find an element in an array. First, I have a 2 dimensional array and a 1 dimensional array. I need to compare whether the element in 2 dimensional array is as same as 1 dimensional array. How to solve it? Like: In Java - int [][] A; int [] B; how to iterate array A and

Re: [rules-users] rule with array

2012-02-15 Thread Wolfgang Laun
Consider writing a DRL function that does the test and call it in an inline eval(). -W On 15 February 2012 18:26, shawn youngxiao...@hotmail.com wrote: Hi, I meet a problem to find an element in an array. First, I have a 2 dimensional array and a 1 dimensional array. I need to compare

Re: [rules-users] rule with array

2012-02-15 Thread shawn
yeah, I have thought about it. But if I use function, I have to write three for loops. like: /*function Boolean findSubject(Request request) { Pointer sPointer = request.getSubjectPath(); Pointer aPointer = request.getAuthorTable(); for( int i = 0; i p.length; i++ ) {

Re: [rules-users] rule with array

2012-02-15 Thread shawn
I found someone idea. It's kind of like split array. when Request( $sPath : getSubjectPath() ) // get two dimensional array then for( int i = 0; i $sPath.length; i++ ) { insert( $sPath[i]); } But I don't know how to find the facts

Re: [rules-users] rule with array

2012-02-15 Thread Wolfgang Laun
On 15/02/2012, shawn youngxiao...@hotmail.com wrote: I found someone idea. It's kind of like split array. when Request( $sPath : getSubjectPath() ) // get two dimensional array then for( int i = 0; i $sPath.length; i++ ) { insert( $sPath[i]); } But

[rules-users] rule on Array of custom Object

2009-12-14 Thread stefano corna
hello, im using drools 5.0 on eclipse and i have a problem. i want to use an array of object in my rule condition. now i try to explain: i have my java class with the array attribute - public static class Message { public numbers[] numbersArray;

Re: [rules-users] rule on Array of custom Object

2009-12-14 Thread Swindells, Thomas
...@lists.jboss.org] On Behalf Of stefano corna Sent: 14 December 2009 11:00 To: rules-users@lists.jboss.org Subject: [rules-users] rule on Array of custom Object hello, im using drools 5.0 on eclipse and i have a problem. i want to use an array of object in my rule condition. now i try to explain: i

Re: [rules-users] rule on Array of custom Object

2009-12-14 Thread stefano82
...@lists.jboss.org] On Behalf Of stefano corna Sent: 14 December 2009 11:00 To: rules-users@lists.jboss.org Subject: [rules-users] rule on Array of custom Object hello, im using drools 5.0 on eclipse and i have a problem. i want to use an array of object in my rule condition. now i try to explain: i