Processing with BrightForms

Contents Hide

This chapter will discuss in detail BrightForms, the Bright Software application tools execution engine.


BrightForms is the form execution engine that processes the application definitions created using BrightBuilder. An application definition contains the description for the forms, reports, database, data exchange rules and the bitmap images used in an application.

BrightForms has a local database to store the end-users data thus allowing them to work offline in the field. It provides a rich application environment that does not confine the user by the limitations of the browser. From a user perspective, BrightForms is a full-fledged application designed to accommodate the occasionally connected communications model. BrightForms is optimised for GSM networks by minimising the air time and also minimised for packet based GRPS and 3G networks by minimising the data to be transmitted.

Synchronising data to and from the server installed at the back office is a built-in feature of BrightForms, which allows for data integrity both for server and client. It also has a built-in application deployment and update framework, which allows the system administrator to manage project updates while providing rich presentation and content to the mobile field users.

BrightForms can also act as a thin-client application such that it accesses the server tables directly online.

BrightForms is provided both for Windows (2003, 2008, XP, Vista, Windows 7, Windows 8, Windows 10), Windows Mobile, Windows CE, Windows Phone, Android and iOS operating systems.

BrightForms Application

The following diagram shows the interrelationship of the different Bright Software tools in conjunction with BrightForms.

Figure 1: BrightForms and related system objects

BrightForms executes the XML application definition produced in BrightBuilder to create the form user interface thus allowing the users to access the local database or remote database through synchronisation. Upon execution of the project, it will create the local database, and the following files:

Data in BrightForms utilises the industry standard SQLite for local storage, but also supports various databases including MS Access over ADO in previous versions. BrightForms uses industry standard SOAP to communicate with the Mobile Data Gateway over http for data synchronisation and application distribution. It also supports data encryption and security using SSL. And supports compression for optimisation.

To use the built-in distribution application feature, end user field applications are first deployed (stored) to the server. The system administrator determines which project and the version of the project each user in the field should have on their devices. BrightForms handles this application updates without the user knowing that it is taking place. Upon connection to the server, BrightForms will inform the user that there was an update made to the application.

It also has a built-in tracing module to provide the application designer with a tool to identify the bugs and issues in the application being executed. Simply turn the tracing module on, execute the application and open the trace file to discover these bugs and issues.

In summary, BrightForms' feature set is as follows:

BrightForms and Databases

BrightForms can access a database either locally or remotely. The BrightForms local database is SQLite by default across all platforms.  Depending on the platform, SQL Server Compact, MS Access and Server Direct Access options may also be provided in legacy versions.

Figure 2: BrightForms and database engines

Creating the local database

Upon initial execution of a project, BrightForms will create the local database. Windows Mobile, CE, Windows Phone/Desktop apps, Android and iOS based devices will create databases of the type defined in their Project Settings if their type is SQL Server Compact, SQLite, or MS Access. Server Direct Access will not create any tables locally or on the server.

Please note, that the omission of trailing string whitespace which occurs with legacy SQL Server Compact and MS Access databases is not replicated in the SQLite database implementation. Therefore, differing results may be returned by queries run on different database types.

Altering the local database

Every time BrightForms connects with the server, a check is performed to see if a newer version of the project is ready for distribution to the user. If so, then BrightForms will receive the new application definition file, and prompt the user to close and restart the application for the updates to take effect, as shown by the dialog below,

When the user restarts the application, BrightForms checks for any database changes. If the database definition is different from the existing local database, BrightForms will upgrade the database, changed tables are altered to reflect the new database definitions. This allows database modifications such as adding or deleting columns or changing column data types, even if the local user tables already exist and have records.

BrightForms follows a set of rules in order to perform the database modifications.

If the table has existing data, BrightForms will check if the Primary Key has been changed or not. If the primary key has been modified, BrightForms will drop the table and recreate it. Otherwise, BrightForms uses the ALTER TABLE statements to add new columns, drop deleted columns, or modify existing columns provided that the database engine used supports Alter Column data type. If not, modified columns are dropped and recreated again.

If anything goes wrong during the alterations of the table, the table will be simply dropped and recreated. For instance, when changing a column from String to Int. If the string column has non-numeric strings, conversion will fail hence ALTER COLUMN will fail.

Dropping of tables will always occur for SQLite tables for type changes, as the ALTER statement does not exist.

IMPORTANT NOTE: Be aware of any consequences before attempting to alter the database.

Accessing the server tables

BrightForms will not create a local database file when Server Direct Access database type is used but will connect with the mobile data gateway to directly access the server tables. When using Server Direct Access, queries should still have the same settings as when using a local database. BrightForms will automatically create the necessary connections and queries do not need to be online queries. Additionally there is no need for synchronisation with Direct Access as the application directly interacts with the server database and there is no local database to synchronise with.

BrightForms' Demo Mode

BrightForms' demo mode is designed to give a preview of BrightForms to developers, whereby they can trial the product and functionality at no cost.

Almost all functionality, including being able to receive and send data, read and write multiple records and interface with device peripherals may be achieved, despite BrightForms being in demo mode. This allows developers to easily observe and experiment with the power of BrightForms, BrightServer and BrightBuilder, and become accustomed with interacting with the BrightXpress Mobility Suite.

There are still, however, a small number of restrictions in demo mode:

Exceeding any limitation will pop up a dialog reflecting this state, and cancel the operation.

A valid license key inputted into BrightForms' settings will remove any restrictions imposed by demo mode.

When in demo mode, a license key may be retrieved and assigned at any time from the server, via Synchronisation. This may be achieved by simply entering or confirming the server details in BrightForms' settings, then tapping the Synchronise option in the Help Menu. For more information on licensing devices, please refer to the Mobile License Deployment chapter in the appendix.

Once synchronised and valid key obtained, BrightForms' full functionality will be activated.

BrightForms Loader Program

Brightforms on a Windows Mobile device is run via the Loader Program. The Loader Program is a special application that checks if there were any BrightForms executable updates, such as those specified when distributing Bright Software Projects to servers.

If there are any BrightForms upgrade or executable files that need to be run, then the Loader Program will install the upgrades prior to running the mobile application on the device. The image below shows the Loader Program starting BrightForms.

The BrightForms executable files MUST be saved in the proper folders when distributed to the devices, thus care must be taken when deploying BrightForms files to the server.