[rules-users] Custom Operator - 5.4.0 works but nor not in 5.6.0.

Wolfgang Laun wolfgang.laun at gmail.com
Sat Feb 15 02:47:47 EST 2014


What you write about the error message is not consistent. A "casr to
String" cannot produce an error message "cannot cast primarySite to a
FactHnadle".

-W


On 14/02/2014, mattmadhavan <mmadhavan at facs.org> wrote:
> Hello,
> I have written a drools custom operator called inlist. It takes two strings
> are parameters and works great in 5.4.0.
>
> I can do some thing like this.
>
> rule inList_1
> 	dialect "mvel"	
> when
>     $cp3rRecord  : Cp3rRecord (*primarySite*e inlist ("C500-C505") )
> then
>      System.out.println  ("Fired inList_1");
> end
>
> where primary site is a filed of the type Cp3rRecord and it works great in
> 5.4.0
>
> There is a change in the API from 5.4.0 to 5.6.0
>
> The Old evaluator is:
>
>
> /The new one (Per 5.6.0) is/
>
>
> Note the third parameter! its is changed from Object to a Fact handle
> (*Please see lines 1) and 2)* )
>
> When I extract the Object its returning me the FACT again and it blows off
> when I cast it to String. Any ideas please> I have been stuck on this for a
> day!
>
> I am getting the exception *cannot cast primarySite to a FactHnadle
> *
>
> Can some one throw some light on this one please?
>
> Thanks in advance!
>
> Matt'M
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Custom-Operator-5-4-0-works-but-nor-not-in-5-6-0-tp4028126.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list