Configuring Event Settings in Billing
Any action performed in Billing by a customer or a reseller results in system event. Domain name registration, upgrading subscription, placing order, generating an invoice and others may be considered as system events. In Billing there is a mechanism for handling these events, performing certain task upon event appearance. The mechanism itself represents a set of task handlers – each handler is responsible for certain task(s). Handler's functioning could be logged so that you can see for a handler log and check the actions performed. An event may have a set of parameters that are passed to methods of the associated handlers.
Billing processes the event calls in the following way:
- Task Manager receives event calls and stores them as tasks in the system database.
- Periodically, Task Manager gets a task from the database and runs it.
The event type may contain a number of event handlers each requiring a set of parameters. When Billing posts an event, it passes all or part of these parameters. The Event Manager will pass the corresponding parameters to methods launched by the event handlers.
The Task Manager supports the task and event handler priority model, which allows to:
-
Configure the priority level for tasks by means of the Priority option (on Trigger Event form). The task priority can be overridden by means of the Priority option.
Priority parameter has seven levels (Idle, Very Low, Low, Normal, High, Very High, Realtime). The Idle and Realtime priorities are shown only for some specific tasks. Task distribution principles are the following:
- If there are tasks with the Realtime priority, they replace all the other tasks for processing, so other tasks will be processed only after Realtime tasks are processed.
- If there are no tasks with the Realtime priority, all the tasks are taken in work by the Task Manager but the proportions of the taken tasks depend on their priority. The higher the priority, the bigger the proportion of tasks taken in work.
- Tasks with the Idle priority are executed only if tasks with other priorities are absent.
-
Configure the priority level for event handlers defining the event processing order by means of the Priority option (on Event Handler form).
Priority parameter has seven levels (Idle, Very Low, Low, Normal, High, Very High, Realtime). The Idle and Realtime priorities are shown only for some specific event handlers. All tasks of the event receive the same priority.
Features of Task Manager
- Inheritance of the parent task priority level by the related sub-tasks by means of the Sticky Priority parameter. The Sticky flag allows to process chain of sub-tasks with the same priority as the parent task has (for example, for processing order on all steps). When triggering an event, you can mark it with a sticky flag. All the tasks produced on execution will be posted with the same priority except the priority is specified on PostEvent. If the flag is not set and the priority is not specified on PostEvent, the priority from the EventHandler or the default will be used.
- Deduplication for event handlers by means of the Deduplication attribute. The flag configures the Task Manager not to do the same work twice or more (for example OrderStatusChange and UpdateAccountToPEM tasks). If the option is enabled, task's duplicates (the same task with the same parameters) will be canceled on the task execution. The attribute will be configured automatically on CloudBlue Commerce upgrade to 7.2 for every event handler.
- Lock hint methods for event handlers to differentiate tasks by means of the Lock Hint Method parameter. The tasks that may conflict are marked with lock hints and the Task Manager will not take tasks with the same lock hint for execution simultaneously so that there are no conflicts. Lock hints will be added on calling PostEvent.