FW.postEvent

FW.postEvent(eventV3IO)

posts an event. There are help functions to make it easier.

The eventV3IO complies to the definition found herearrow-up-right

When creating a date, we first check if the string matches known ISO 8601arrow-up-right formats, we then check if the string matches the RFC 2822arrow-up-right Date time format before dropping to the fall back of new Date(string) if a known format is not found.

Example:

let event = new EventV3IO("MY_FWOT");
event.addSample("extTemperature", 18) // would crate a parameter if not exists and a sample
event.addSample("extHumidity", 40) // would crate a parameter if not exists and a sample
event.title="Sensor temp="+18;
event.layoutRef = "fw.turnaround-schedule"; // the layout ref
//event.layoutId=4917788; // the ID of the layout associated with the message (if you need it)
event.date = '1973-03-03'; // would set the computedDate
//event.visible=false;
var hour=moment().hours(); // you can use the moment library and the _ library
if (hour>=8&&hour<=19) {
	event.status="flying";
} else {
	event.status="gatein";
}
FW.postEvent(event)

Last updated