Mobile Xforms

Mobile Xform component (what are we going to call this thing?)

Overview

The function of this component is to display an Xform and allow the user to interact with it in the following ways:

  • enter data
  • view previously entered / default data
  • undo data entry
  • view calculations based on the data (outcomes / belief state / decision support)
  • save form

This component will not be responsible for selecting a form to be filled in but having been passed the location of a form and any default data to place in the form it will display it and allow the user to interact with it.

Sections

This component can be divided into several sections / layers:

  1. Controller: This is the central section in which most of the form logic takes place. This section will maintain the belief state and a history of changes made to the data model.
  2. XML: The xml section is responsible for parsing the Xform and manipulating the form's data model. This section is also responsible for evaluating Xpath and XMLEvent elements on the data model and returning the results to the controller.
  3. User interface: The interface displays the form to the user in whatever state it is given it by the controller and allows the user to interact with the form.

Concepts

Belief state

The belief state (I'm not sure how to describe this concept) of the system can be modelled as an Xpath expression that can be evaluated on the XML model. The result of this evaluation for a particular state of the data model will be the belief state for that set of data.

This state can be calculated and recorded for each change in the data model and stored in a history.

History

The history of the data model must be kept in order to be able to revert changes made to it. This history could be stored as a set of Xpath expressions and the before and after data. The Xpath expression would reference a particular location in the data model.