Offline order functionality

In Mobile WMS there are a couple of ways to work in an offline manor. This is typically not necessary, as registrations of all order lines in an order can be done completely offline with enabling any of this functionality.
However, in some cases where cellular or WiFi coverage is not possible we also have a solution for that.

Single service offline

Choosing this solution will make the application fetch orders and order lines once a page is opened.
The only thing that is required, is to set the operation mode on the service referenced from the order list page to Offline.

<services>
  <service id="Pick" type="Order" orderType="Pick" operationMode="Offline">
    <requests>
      <getOrders>GetPickOrders</getOrders>
      <getOrderLines>GetPickOrderLines</getOrderLines>
      <postOrder>PostPickOrder</postOrder>
    </requests>
  </service>
</services>

When working with the orders they are not posted as regularly done, but instead marked as finished.
That is done by changing a couple of menu items on the order lines page. Set postOrder enabled="false" and finishOrder enabled="true".

<page id="PickLines" type="OrderLines" icon="mainmenupick">
  <title defaultValue="@{PagePickOrderLinesTitle}"/>
  <orderLinesConfiguration>
    <service id="Pick"/>
    <list listId="OrderLines"/>
    <viewRegistrations title="@{OrderLinesRegistrationMenuItem}" navigateTo="ViewRegistrations" enabled="true"/>
    <deleteOrderRegistrations title="@{OrderLinesDeleteAllOrderRegistrationsMenuItem}" enabled="true"/>
    <totePicking allowManualSelection="true">
      <currentTote show="true" useLabelPrefix="false"/>
    </totePicking>
    <scanToSelectBehaviour gs1SearchTerm="Item" behaviour="Auto"/>
    <postOrder enabled="false"/>
    <finishOrder enabled="true"/>
  </orderLinesConfiguration>
</page>

Furthermore for convenience, add the postAllOrders enabled="true". This enables the users to post all finished orders in one go.

<page id="Pick" type="OrderList" icon="mainmenupick">
  <title defaultValue="@{PagePickOrderListTitle}" />
  <orderListConfiguration automaticOrderSelectionAfterFilter="true">
    <service id="Pick" />
    <filter configurationKey="PickOrderFilters" />
    <list listId="Orders" />
    <onOrderSelected navigateTo="PickLines" />
    <unlockOrder title="@{ReleaseOrderMenuItem}" menuPlacement="1"/>
    <postAllOrders enabled="true"/>
  </orderListConfiguration>
</page>

Advanced offline functionality

The advanced offline functionality is a bit more tricky to setup, but makes the users able to work completely offline from the time they log in.
It works by defining which services should be accessible without connectivity after login. After successful login the updateMode="Always|Manual|OnNoOrders" attribute defines whether orders and lines require manual action to be downloaded.
Opposed to the planned services, adhoc services will only display registrations of adhoc pages which are setup to utilize offline functionality. However, all adhoc registrations will be displayed side by side despite registration type.

It requires a special offline management page to be configured. The services referenced in this page also needs to be set to operationMode="Offline", which is done in the service section in application.cfg.

<page id="OfflineManagementPage" type="OfflineManagement" icon="icon">
  <title defaultValue="Order Overview" />
  <offlineManagementConfiguration updateMode="OnNoOrders">
    <offlineServices>
      <offlineService serviceId="Receive">
        <list listId="OfflineManagementOrderList"/>
        <onItemSelected navigateTo="Receive" />
      </offlineService>
      <offlineService serviceId="Pick">
        <list listId="OfflineManagementOrderList"/>
        <onItemSelected navigateTo="Pick" />
      </offlineService>
      <adhocRegistrationService> <!-- All offline adhoc registrations regardless of type will be listed if this section is enabled. -->
        <list listId="OfflineManagementAdhoc" />
        <onItemSelected navigateTo="ViewAllPendingRegistrations"/>
        <requests>
          <submit>UploadAdhocRegistrations</submit>
        </requests>
      </adhocRegistrationService>
    </offlineServices>
  </offlineManagementConfiguration>
</page>

Each service, and subsequent page which uses that service, cannot have any filter enabled. This means the service call for getting orders should only return those orders relevant for the user logging in.
So the page configuration for e.g. Receive should look something like the following.

<page id="Receive" type="OrderList" icon="mainmenureceive">
  <title defaultValue="@{PageReceiveOrderListTitle}" />
  <orderListConfiguration automaticOrderSelectionAfterFilter="true">
    <service id="Receive" />
    <filter configurationKey="ReceiveOrderFilters" enabled="false" />
    <list listId="Orders" />
    <onOrderSelected navigateTo="ReceiveLines" />
    <unlockOrder title="@{ReleaseOrderMenuItem}" menuPlacement="1"/>
  </orderListConfiguration>
</page>

Furthermore, in order to have the offline management page displayed when logged in and downloading all orders and order lines, it needs to be set as the startup page from start.cfg.

<loginPage>
  <title defaultValue="Mobile WMS" />
  <loginConfiguration>
    <onLogin>
      <navigateTo id="OfflineManagementPage" />
    </onLogin>
    <credentials enabled="true" username="" password="" domain="" hideDomain="false" allowCachedCredentials="true">
      <scan enabled="true" allowScanDomain="true" allowScanPassword="true" allowScanUserName="true" allowScanEndpoint="true">
        <gs1 enabled="true" />
      </scan>
    </credentials>
  </loginConfiguration>
</loginPage>

Once all offline orders have been completed, the application should be exited until the offline management page. On this page a single button press will upload all registrations to the backend.