Background Procedures

Navigation:  How to Work with Programs > Working with Procedures >

Background Procedures

Previous pageReturn to chapter overviewNext page

 

Overview

 

A Background Procedure is, basically, a standard program that is executed asynchronously, without user interface (ex: no screens or controls). It is used to perform a specific action in the background (in a secondary thread), parallel to the program that called it (main thread).

Background procedures are perfect for recurring and/or time consuming operations that do NOT require operator intervention.

A program running in the foreground (in the main thread) can call several background procedures (each background procedure runs in its own secondary thread).

These procedures can also be designed/executed as Application Services (application services handle application related tasks such as the archive or deletion of useless files, update checks, etc.) or a Device Driver (drivers manage the interaction between the device and an external peripheral, for instance a printer).

 

A background procedure uses a specific set of variables named Background Variables to exchange data with other background procedures and with the program running in the foreground.

Another way to establish an interaction between the background procedure and the foreground application is through actions - you can create actions in the background procedure that, when started, will trigger the required business logic in the foreground application.

For a more detailed information on background procedures, see How to Work with Background Procedures.

 

 

Examples of Background Procedure Usage:

 

Example 1

Background Procedure for Common Asynchronous Operations:

To send data to a WMS (common )

To print a label (common asynchronous operation)

 

Example 2

Background Procedure run as an "Application Service"

To, periodically, clean up unnecessary tables from the Local Database.

To check if there are new messages from the server and notify the foreground application.

 

Example 3

Background Procedure run as a "Device Driver"

To connect a device to a Bluetooth scanner, wait for a scan and, then forward the scanned barcode to the foreground application.