BackgroundData Listeners are business rules invoked when data in the database changes. Examples include:
ExampleFor demonstration purposes, the Person.config file contains a data listener called Login, that creates a Message bound to a Person when they log in. Person.config entries include: <Statement Name="LoginListener" Query="SELECT PersonID FROM Person WHERE LastLogin >= @FromDate"/> and <DataListeners> <Listener Name="Login" Statement="LoginListener" Class="Message" Operation="Save" Parameters="Object=Person&ObjectID={PersonID}&Message=Testing&BodyText=Whatever here"/> </DataListeners> To schedule this listener, navigate to: Person.ashx/Schedule/Listen?Listeners=Login&Schedule=Daily at 9am This will queue the listener to execute daily at 9am, dynamically creating an appropriate schedule. Each time the listener is run, the schedule will be available to the listener, and the listener will update the schedule with the last run date, thus keeping track of the last time the listener was run. This schedule last run date will be passed to the data listener's statement as a FromDate parameter.To unit test this listener directly, navigate to: Person.ashx/Listen?Listeners=Login&From=9/4/2012 -- change the date to something more appropriate for your database ConfigurationData listeners may be defined from the UI via Design > Configuration > Modules > {Module} > Listeners tab. Each Listener element includes the following properties:
Defining a data listener does not run the data listener; something else must trigger the execution of the listener. This may be done via:
|
Quandis Business Objects 3 > QBO 3 Blog >