Integrating a workflow into a dashboard form
The workflow you have set up for Rocky Jupiter drivers in the previous section is a very good start, but there are two key issues with it:
-
The list of tasks is duplicated: the driver checks them on the dashboard form, and then accesses them in the workflow forms. It would be much more efficient if the dashboard acted as both reference for the task list and an access point into the workflow.
-
There is nothing stopping the driver from confirming a task while another task is still active (an active task has a status of Confirmed or Loaded). The business process, however, requires no more than one active delivery task per driver at any one time.
The list.Single() method that your
load.rfs
andunload.rfs
workflow scripts call when they access the reference table already make sure that there is no more than one Confirmed- and Loaded-status row. The query statements in the forms, however, will happily return all the active-status tasks they find in the reference table. In this section, you'll see how to prevent this.
First of all, you'll hide the numbered forms on the left-hand side of the screen (and
get rid of 01 - Confirm Task completely), and integrate them into the
dashboard form using a feature of the closebutton
control that you did not
use in the previous section, when you were introduced to closebutton
s.
It turns out that you can not only submit or discard a form with a
closebutton
, but make the mobile device automatically open a new form of
your choosing. Using this feature, you can put closebutton
s inside the
dashboard form that open the form that comes next in the delivery workflow.
You'll also have to make sure that only one active-status delivery task appears in the dashboard form, and that the driver cannot confirm a new task before he or she has completed the current one. It's all going to be fool-proof.