Here it is:
private void makeFacts(){
kSession.insert( Integer.valueOf( 1 ) );
kSession.insert( Long.valueOf( 1 ) );
kSession.insert( Integer.valueOf( 0x10010 ) );
kSession.insert( Integer.valueOf( 0x10020 ) );
kSession.insert( Long.valueOf( 0x10010 ) );
kSession.insert( Long.valueOf( 0x10020 ) );
kSession.insert( Integer.valueOf( 0x10000 ) );
kSession.insert( Long.valueOf( 0x100000000L ) );
kSession.insert( Long.valueOf( 0x10000L ) );
}
package shift
############### dialect "mvel"
rule test1
when
$a: Integer( $one: intValue == 1 )
$b: Integer( $shift: intValue )
$c: Integer( $i: intValue, intValue == ($one << $shift ) )
then
System.out.println( "test1 " + $a + " << " + $b + " =
" +
Integer.toHexString( $c ) );
end
rule test2
when
$a: Integer( $one: intValue == 1 )
$b: Long ( $shift: longValue )
$c: Integer( $i: intValue, intValue == ($one << $shift ) )
then
System.out.println( "test2 " + $a + " << " + $b + " =
" +
Integer.toHexString( $c ) );
end
rule test3
when
$a: Long ( $one: longValue == 1 )
$b: Long ( $shift: longValue )
$c: Integer( $i: intValue, intValue == ($one << $shift ) )
then
System.out.println( "test3 " + $a + " << " + $b + " =
" +
Integer.toHexString( $c ) );
end
rule test4
when
$a: Long ( $one: longValue == 1 )
$b: Integer( $shift: intValue )
$c: Integer( $i: intValue, intValue == ($one << $shift ) )
then
System.out.println( "test4 " + $a + " << " + $b + " =
" +
Integer.toHexString( $c ) );
end
##############################
-W
On 22 June 2011 17:26, Michael Anstis <michael.anstis(a)gmail.com> wrote:
The current conversation on IRC might benefit form your simplified
test
case?!?
On 22 June 2011 16:24, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
> Given a scant selection of facts taken from java.lang.Integer and
> java.lang.Long (no value exceeds and a rule base with just 4 rules using
> simple constraints using nothing but the fact values, a single operator
> besides "==", it compiles and executes according to my expectations.
>
> Getting high-spirited, I added
>
> dialect "mvel";
>
> to my DRL file and re-run everything. Lo and behold! Some rules don't fire
> any more!
>
> Is this to be expected? (There is no difference between 5.1.1 and 5.2.x.)
>
> Cheers
> Wolfgang
>
>
> _______________________________________________
> rules-dev mailing list
> rules-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
_______________________________________________
rules-dev mailing list
rules-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev