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 :=
03. from t in all Temperature(sensorId="T001") retain 3 select mean(t.temperature);
04. stream<float> meanPs :=
05. from p in all Pressure(sensorId="P001") 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-2015 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.