Hi guys,
Building from the stockticker sample, I have been running my
own average aggregates over time and window length and I have the following
rule…it simply runs a last 10 average and outputs the average(in theory).
rule "show averages"
when
$n
: Number( doubleValue > 0 ) from accumulate (
$mdo : MyDataObject($tm: delayTime) over window:length(10) from entry-point
"DataObject stream",
average( $tm )
)
then
System.err.println($tm);
End
I have set the limit to 0 for the average because I simply
want to have it fire every time, no matter the average(they are all positive)
However I get this error:
Unable to build expression for 'consequence': Failed to
compile: 1 compilation error(s):
- (1,3) unqualified type in strict mode for: $tm '
System.err.println($tm);
' : [Rule name='show averages']
If I have the consequence
System.err.println($n);
Then it outputs the average no problem, but I am trying to
simply output that indifidual value, delayTime which I have stored in $tm is an
integer, so I cannot figure out why I cannot output this value. Similarly
if I simply try as a consequence:
System.err.println($ mdo.delayTime);
I get a similar error.
What am I doing wrong?
Thanks,
Chris