This is the documentation for the development version.
There are no official binaries for it; build it from the source code in git.
Download links on these pages work only after the release.
For the current release, see version 7.0.
PostEventEx
- PostEventEx(node, event, parameters, tags, originTimestamp, origin): bool
-
Post event on behalf of given node.
Table 1. Parameters node
Node object to send event on behalf of.
event
Integer or String
Event code or name.
parameters
Array or Hash map
Event parameters. Hash map allows to use named parameters - hash map keys will become parameter names. Optional, can be set to null.
tags
Array of Strings
User tags associated with event. Optional, can be set to null.
originTimestamp
Integer
Time as seconds since epoch (1 January 1970 00:00:00 UTC). Optional, can be set to null.
origin
Integer
One of the possible values. Optional, can be set to null. If omitted,
EventOrigin::SYSTEMis used.ReturnTRUEif event was posted successfully orFALSEif not (including unknown event code or name, and missing "send events" access to the node).
// event parameters as array
r = PostEventEx($node, "MY_EVENT", ["text parameter", 123]);
// event parameters as hash map
r = PostEventEx($node, "MY_EVENT", {"someParam":"value", "anotherParam":456});
// null is used to omit originTimestamp
params = {};
params["someParam"] = "some value";
params["anotherParam"] = 42;
tags = [];
tags.append("tag1");
tags.append("tag2");
r = PostEventEx($node, "MY_EVENT", params, tags, null, EventOrigin::NXSL);