Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » MobiLink - Server-Initiated Synchronization » Setting up server-initiated synchronization » Listeners » Message handlers » Working with message handlers


Action variables

Action variables allow you to reference parts of a push notification from a message filter or an action. See Initiating actions and Filtering a message.

How action variables are set

Most action variables are set automatically every time a push notification is received. The variable names are similar to the names specified in the message syntax. For example, message sets the $message action variable, while subject sets $subject, sender sets $sender, and content sets $content. See Message syntax.

Using action variables

Action variables are used in the command line when you run the Listener. How they are used is dependent on the message handler, and the action you want to initiate. The following example demonstrates the use of the RUN action command, which is used to initiate the MobiLink client application:

dblsn ... -l "subject=publish;action='RUN dbmlsync.exe @dbmlsync.txt -n $content'"

This message handler filters messages where the subject is textually equivalent to "publish". Once filtered, dbmlsync is run with the -n option, passing the $content action variable as a parameter. Assuming that content references the name of a synchronization publication, dbmlsync uses the publication to synchronize the device database with the consolidated database.

The following example demonstrates the use of an action variable to filter a message:

dblsn ... -l "subject=$content;action='RUN script.bat"

When subject is textually equivalent to content, this message handler filters messages . Once filtered, the device runs a custom batch script.

See also