Anonymousprnt::Y
Click on images to see them in full screen

Agent Execution

smsROUTER will execute a LotusScript agent if one is specified in Database Update actions.

The following process takes place:

  1. An action is matched by the selection criteria
  2. A Notes document is created in the target database
  3. Fields are created as listed in "Field names"
  4. Additional computations are computed
  5. The new document is saved
  6. The specified agent is executed using the above document as its "Context"

Example
The following shows an Action and a LotusScript agent which runs a Google search as a result of a text message sent with:
  1. A Google search criteria
  2. An email address to send the search result to

Specify the selection criteria below. In this case the token in the text will be #goog xxxx#:


Specify fields and additional computation in the normal way. The agent is added below:


The Google agent
This code shows only the simple structure of the agent and how the data is created by the action passed to it. Data items available for the agent are listed in the comment, too.

Dim s As New NotesSession
Dim parm As NotesDocument

Set parm = s.DocumentContext
with parm
%REM
Your agent main code goes here....
available fields are:
smsbody - complete original text message
sendto - who to send the results to
googlecrit - the Google search criteria
originalNo - phone number of the SMS sender
%END REM
end with

Andfinally, the Agent's property:


Important Notes:
  1. You will need to restart smsROUTER every time you change an agent which is invoked using this mechanism
  2. Do not attempt to save the "Context Document" that is passed to the agent