currently 'accumulate' only works on single column, eventually we hope to have it working with multipe patterns - but it's not in the near future road map. Unless a community member wants to work on the feature :)

Mark
Olenin, Vladimir (MOH) wrote:

This is as a follow up for the previous question…. It looks like I made a wrong assumption that ‘accumulate’ can work on multiple columns:

 

                        Integer ( intValue > 0) from accumulate (

                                    Record ( f1 == $f1, f2 < 10, $value1 : value )

                                    Record ( f1 == $f1, f2 >= 10, $value2 : value )

                                    Init ( int sum = 0; ),

                                    Action ( sum += $value1 - $value2 ),

                                    Result ( new Integer (sum) )

                        )

 

I’m getting an error (‘then’ is expected or smth like that at the point where the second ‘Record’ is defined) and the only way to remove the error is to declare one and only one Column constraint… So, it is not possible then to use multiple columns in ‘accumulate’? If not, then it would be even more interesting to get some idea on how to approach the kind of problem I mentioned in the previous post…..

 

Thanks,

 

Vlad


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