InRule® Deployment Brief: Disconnected Mobile Apps

Use Case
InRule® is often used in applications that support field personnel such as salespeople, service providers and healthcare workers. Increasingly this class of users expects to do their work on tablets instead of PCs. They also bring their own devices to work and expect their mission critical apps to work without network connectivity.

To support these scenarios enterprise architects create hybrid mobile applications that have the ability to run in disconnected mode. Since a hybrid mobile application is simply a web application deployed in a native app container, InRule for JavaScript is a viable option for using a business rule management system (BRMS) in multi-platform, disconnected scenarios. When rules are packaged for distribution by the irDistribution™ service the output is a single JS file that contains the rules, rule engine and API for interacting with the engine.

This deployment brief covers how to architect for mobile apps that pull rule updates on demand when connected to a network. See the “For More Information” section at the end of this brief to locate other related deployment and integration briefs.

Getting Updates from a Deployment Service
The following diagram provides a high-level view of a deployment service architecture. We recommend creating a service to handle update requests instead of having the app call the two services directly.

Step 1

 

The device is running in connected mode and requests a rule update from a custom deployment service you have created. The service can either be accessed via the internet or from an enterprise network and is a good candidate for cloud hosting.
Following is an example of what the call from the app to your deployment service might look like:

 

Step 2

The deployment service retrieves the latest version of the rules from the irCatalog® service as shown in the following C# code. Note that the rules can also be retrieved from a file location. A third option, not shown, is to retrieve the rules as XML from a source control system.

 

Step 3

The deployment service then passes the rule application to the cloud-based irDistribution service via a web service call. The following C# code provides an example of how that could be done.

 

Step 4

The JavaScript that is returned can either be stored in memory or persisted to the device.

For More Information
For more information on how to integrate the JavaScript rule engine into an application, please see InRule Integration Brief: Client-side Rule Execution.

For more information on how to include InRule for JavaScript in a build process, please see InRule Deployment Brief: Deploying JavaScript Rule Changes.

For additional information please visit inrule.com, contact us or reach out to your InRule Account Executive to get in touch with a pre-sales engineer.

Download PDF of Product Brief