Offline Workflow for Requisitions


Allow for requisition data capture via the web interface with no or intermittent connectivity.


Offline first is a design methodology around making applications work offline by default, and treat online interactions as an enhancement. The OpenLMIS-UI will not be the perfect example of the offline first methodology, but defaults will be set in place so that when the application is used offline it handles errors gracefully. This will include proper error messages, alerting the user they are offline, and indicating which workflows require an internet connection.

This document is not about how the OpenLMIS-UI will be compressed for fast load times in low bandwidth and high-latency environments. 


The release/version is still under discussion.

Diagrams and Patterns

Workflow for 3.0

View wireframe mock-ups

UI Patterns (Current Approach)

UI assumes workflow will go offline

To support an offline first workflow with requisitions, when a person opens a requisition it will be saved offline in their browser. The benefit of this is that a user won't have to remember to save the requisition before they go to do work offline. When they return to a location with an internet connection they will sync their data back to the OpenLMIS Server.

For version 3.0 we will not be creating a robust solution to handle conflicts between a user's local version and the version that is stored online. 

  • Once a user saves a requisition, the requisition will be updated from the OpenLMIS Server unless the user makes any changes to the requisition
  • When a user syncs a requisition that they have edited, the offline requisition will overwrite the requisition saved on the OpenLMIS Server
  • If a user wants to get the latest version of the requisition, they will need to remove their offline copy 

Buttons that require data are disabled when offline

When a user is offline, buttons related to syncing or changing the state of a requisition will be disabled with an icon to indicate to the user that they are offline. Below is a mock up of what this functionality will look like.

Generally, there is a pattern in the OpenLMIS-UI to only show available options and avoid disabled buttons. For offline workflows we chose to go against this pattern because we feel it is important for a user to know what they could do if they were online.

Removing cached requisitions

User navigates to the View Requisitions screen and selects the "Remove Offline Requisitions" button to remove the cache.

<inser the removing of cache through new user login OLMIS-2553>


Open Questions 

Below is a list of questions to be addressed 

Related Story

Automatically saving offline requisition

We feel that when a user edits a requisition page their changes should be saved automatically, and that there should be a subtle alert telling the user their changes have been saved.

If we do automatic saving, it makes sense to remove the dedicated save button, as it will effectively do nothing. The rational for this is to avoid confusion between 'sync' and 'save'. This is similar to how OpenLMIS v2 Distributions functions.

Currently, we are implementing a save button because it's simpler to implement.

Question: Do we want to support automatic saving? Or do we want to have a save button that only means "save offline?"

On   PC committed unanimously said YES, we are doing automatic saving


Show full navigation while offline

In OpenLMIS v2, when the OpenLMIS-UI was offline, the top navigation only showed pages that were available offline.

Do we want to only show pages that will function offline, or show the entire navigation structure style navigation items to look disabled in a similar way to how we are treating offline buttons.

On  PC Committee in consensus that we should show disabled buttons and non-navigable items to the users


Logout disabled when offline

Question: Should a user be able to logout of the OpenLMIS-UI while offline?

Currently we save the user's session in the browser, so the user appears to stay logged in even if they turn off their computer (for a month) and then turn the computer back on. Only when the browser connects to the OpenLMIS server will they be forced to login again.

If the user logs out while offline, they wouldn't be able to log back in unless they go online.

(a) We could make it so a user can logout and log back in while offline -- but this would not be easy to implement.

(b) We could remove the user's ability to logout while offline

(c) We can show a confirmation when logging out while offline, and explain that they cannot log back in

  • Danni: yes they should be able to log out while offline to prevent other computer users from accessing openlmis and there’s reason to have an offline login mechanism for the browser - Nick: good idea and should consider doing that, although it’s technically not trivial - MJ: let’s make sure we look at timelines before deciding on that
  • MJ: Christine will be most impacted by this, so can follow up with you about this - Christine will be leading implementation in Malawi from VR side so will be first impacted with this functionality

 A discussion the open question around the security concern related with the offline login/off feature. In we discussed the options, and decide the way forward is to remove the login/off feature. We are proposing to provide the ability to "End Session" and allow a user to log back in (however only online with internet). However, if a NEW user logs in online in the same browser they will clear the cache (after a warning). More details to come on this. FYI, Christine Lenihan

Closed, reopened
4What is the best way to remove offline versions and let users know they are on an offline version?
  • Kevin: Understand the journey to do that - wondering about the end users we work with understanding what removing an offline copy is - they might not understand difference b/w online and offline - other option would be to remove ‘remove offline copy’ totally, we are not talking about saving a significant amount of data even over 2 years
  • Nick Reid (Unlicensed) and Mary Jo Kochendorfer (Unlicensed) discussed how to remove the cache and how having the check box in the table may not be intuitive to folks. However it is a clean way to do it.
  • Proposal: When in the View Requisitions page, you can remove cached requisitions in the action column on the table.

OLMIS-1643 - Getting issue details... STATUS

5During the Malawi demo, it was raised that they would like more visual cues that the user is offline. We would like to know more about what is desired. There are many options. We could change the navigation bar to a new color. Need more information from the Malawi team on how important this is and what type of visual cues would be useful rather than confusing.Designed a new pattern to indicate to users that they are offline.