Triggering Events
Signal events can be triggered on an ad hoc or periodic basis.
Triggering an Ad Hoc Event
Write code to call an API which in turn, triggers the event.
For example, the code given below triggers ad hoc signals.
eventType = "COB" ;* Record ID of IF.SIGNAL.PARAMETER signalRequests = "" tmp = "" tmp<1> = "COBStarted" tmp<2> = "Yes" tmp<3> = "COB Started on 20190101" signalRequests<-1> = LOWER(tmp) tmp = "" tmp<1> = "jobName" tmp<2> = "Test Job" tmp<3> = "Test Jon Started" signalRequests<-1> = LOWER(tmp) signalResponses ="" responseDetails = "" CALL IntegrationFrameworkService.signal(eventType, signalRequests, signalResponses)
Periodic Trigger
You use periodic triggers to generate signal messages based on frequency. The possible frequency can be D, Dnn, M, Mnn, W, Y, Ynn.
A new TSA service IF.TRIGGER.SIGNAL is introduced to pick a record based on the next run date and generate the messages. Every time after the service runs, it updates the last run date and next run date for the respective signal based on the specified frequency.
Triggering Periodic Events
Follow the steps below to trigger periodic events.
-
Ensure that TSA Service IF.TRIGGER.SIGNAL is running in the background.
-
In the IF.SIGNAL.PARAMETER table, set the FREQUENCY parameter. This determines the frequency by which the signal message is generated. See The IF.SIGNAL.PARAMETER Table for details.
Different Frequency Setting examples.
D Frequency
The following screen capture shows a new record that never been processed.
After the IF.TRIGGER.SIGNAL service completes, the last run date and next date are updated. As the frequency is D, it will run daily.
The screen capture below shows the details on the last time this signal is raised and the next time after this runs once.
D2 Frequency
The signal messages are generated every second day.
M Frequency
The signal messages are generated one month after the last run date.
M3 Frequency
The signal messages are generated on the third day of each month.
W Frequency
The signal messages are generated on each Friday (or the previous working day of the month).
Y Frequency
The signal messages are generated on the last weekend day of the year.
Y6 Frequency
The signal messages are generated on the last weekend day of the fifth month.
In this topic