Application Control
Synchronous
Custom Parameters Accepted
SendEvent allows a script to send an event to another script.
The ability to send events to scripts is possible with the SendEvent action. Sending events is typically associated with providers; this action relies on the same internal mechanism.
SendEvent is capable of sending a triggering event in order to initiate a new script instance, or to send a non-triggering event to a running script instance. The determination of which type of event is sent is based on the presence of the ToGuid action parameter. If empty, the Application Runtime Environment will attempt to route the event as a triggering event to an installed script. If a script matches the event signature of the event, then a new script instance will be initiated and the DestinationGuid result data parameter will be populated with the RoutingGuid of the new script. If instead the ToGuid is the RoutingGuid of an existing script instance, a non-triggering event will be routed to the a running script instance, in which case DestinationGuid serves no purpose since it would be the same value as ToGuid.
Just like an event originating from a provider, an event sent by an application has an event name and 0 or more event parameters associated with it. The event name is specified by populating the EventName action parameter (for example, Metreos.Providers.Http.GotRequest is an example of the event name associated with the built-in HTTP provider). One must use custom action parameters on the action to define event parameters. The combination of the event name and event parameters are used to best match against the event filter criteria of all installed scripts.
One can enable two-way communication between scripts if one sends an event parameter in a SendEvent action which has the value of the originating script's RoutingGuid to the receiving script. The receiving script can then extract that RoutingGuid with a local variable (as one extracts all event parameters), and can then send back an event by supplying the originating script's RoutingGuid as the ToGuid action parameter with its own SendEvent action.
| Parameter Name | .NET Type | Default | Description |
|---|---|---|---|
| EventName * | System.String | The name of the event to send. Along with event parameters defined through custom parameters, the EventName comprises a part of the event signature. | |
| ToGuid | System.String | If not specified, SendEvent will sent a triggering event with the specified EventName and any custom action parameters as event parameters.
If specified, the SendEvent action will instead send a non-triggering event to the script which has a matching RoutingGuid. |
| Parameter Name | .NET Type | Description |
|---|---|---|
| DestinationGuid | System.String | Contains the RoutingGuid belonging to the script to which the event was sent to, if SendEvent was successful. |
Branch Conditions
No description.
No description.