com.apama.cumulocity
Event Util
Contains various static actions that are useful for interacting with Cumulocity such as generateReqId().
ensureSMSLength
string static ensureSMSLength(string text)
Truncate a string to max length of 160 characters.- Parameters:
- text
formatTime
string static formatTime(float t)
Format time into human readable form, as used by Cumulocity.- Parameters:
- t - Float that indicates the time you want to format. This value is the number of seconds since the UNIX epoch in UTC. This is the same format used by the currentTime variable. For information about the currentTime variable, see "Getting the current time" in "Developing Apama Applications".
generateReqId
integer static generateReqId()
Use this action for generating all reqIds for use with the Cumulocity API.
inMaintenanceMode
boolean static inMaintenanceMode(com.apama.cumulocity.ManagedObject device)
Determine if ManagedObject is in maintenance mode.- Parameters:
- device
- Returns:
- True if c8y_Availability.status is MAINTENANCE.
replacePlaceholders
string static replacePlaceholders(string value, any e)
Replace placeholders in string from an Event.
Replace #{field} with field values or entries in params from the event. Sub-objects are printed in JSON form. For fields named 'time' or 'timestamp', field values are converted to a human-readable form before replacing.- Parameters:
- value - String containing placeholder values
- e - Event containing values to be substituted.