JSMA event

Overview

What can JSMA event do for me?

Using the JSMA event you can trigger asynchronous processes to Event contents

Index

Methods

The JSMA event provides the following methods:

event.send(url, args)

Starts an asynchronous event with url and args which will be passed as arguments to the receiving contents of type Event. The method returns immediatly.

Example

// MINUTE
var lastCallMinute = portal.get("smp.util.time.lastCallMinute");
  
if (lastCallMinute === null)
{
  lastCallMinute = 0;
}
else
{
  lastCallMinute = parseInt(lastCallMinute);
}
  
if (now - lastCallMinute > 60 * 1000 - 1000)
{
  event.send("/timer/minute", {});
  portal.set("smp.util.time.lastCallMinute", "" + now, { broadcastEvent : false });
}

Parameter url:string (required)

The URL which will be used to search for the matching WebEvents.

Parameter args:string[] (required)

An array of parameters which is overgiven as args to each matching WebEvent.