Apama Documentation : Developing Apama Applications : EPL Streams: A Quick Tour : Processing events using streams : Using inline stream source template expressions
Using inline stream source template expressions
The previous code example can be re-written in a more concise format by writing the stream source template expressions inline, as illustrated below.
01. TemperatureAndPressure tp;
02. stream<float> meanTs := from t in all Temperature(sensorId="T001")
03. retain 3 select mean(t.temperature);
04. stream<float> meanPs := from p in all Pressure(sensorId="P001")
05. retain 3 select mean(p.pressure);
06. from t in meanTs retain 1 from p in meanPs retain 1
07. select TemperatureAndPressure("S001",t,p) : tp {
08. print tp.toString();
09. }
Copyright © 2013-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback