Beyond ‘Hello World’: Creating role-based mobile workflow forms (tutorial)


Ms. Neagu is a noted expert on data applications and XML technologies. Adriana was co-inventor of Microsoft Office InfoPath, and co-holds 4 InfoPath patents.

Workflow example

Our earlier post Hello World teaches you how to create a simple Formotus workflow form that lets individual mobile users pass a job assignment around to each other using SharePoint. Now learn how to define a structured workflow that automatically routes a job from one user role to the next.

In this tutorial you’ll create a structured mobile workflow based on user roles rather than individual user IDs.  This is accomplished by creating differently configured mobile forms to deploy to users belonging to each role.

Note:  SharePoint server-side workflows are not in use here. Formotus workflows are an entirely separate and compatible mechanism, created with rules attached to the mobile form to filter which jobs (i.e. form instances) are available to it. If you are familiar with views in SharePoint, this uses a similar concept.

The Mobile Workflow Scenario

4-role workflow demo

This demo describes a typical mobile workflow scenario, with four  roles:

  • The Initiator creates a new job and enters info about where to go and what to do there.
  • The Approver must authorize the job before it goes to a worker.
  • The Worker does the job and files a field report.
  • The Reviewer verifies everything is in order and closes the job.

The demo form we’ll be using looks like this on iPad (and it works on Android and Windows too, of course):

 Role Based Mobile Workflow Form

Defining the Mobile Workflow Rules

A workflow is all about defining rules that control business processes. So let’s define the rules we want to implement in this demo:

  • Every user belongs to one or more of the four roles.
  • Only an Initiator can create a new job.
  • After a job is initiated it must be approved. Only those in the Approver role can see jobs awaiting approval.
  • After a job is approved it must be worked. Only those in the Worker role can see jobs awaiting work.
  • After a job is worked it must be reviewed. Only those in the Reviewer role can see jobs awaiting review. Reviewers will continue to see a job until a Reviewer marks the job closed.
  • When one user grabs a job it becomes unavailable to other users.

There is no server on which these rules are defined and carried out. Instead, we’ll create four different mobile forms using the Formotus cloud console, one for each role, then deploy each form only to the users who belong to that role. This is not as difficult as it may sound because all four applications are built using exactly the same InfoPath form, but each configured a bit differently in the console.

Workflow example


Tutorial Overview

To complete this tutorial you’ll need a Formotus account (free trial available), InfoPath, a SharePoint site you can publish the InfoPath form to, and an iPad, iPhone or Android mobile device with the Formotus client app installed.

Here are the main steps you will perform in this tutorial:

Step 1: Prepare the Form and Publish it to SharePoint

This is all standard InfoPath and SharePoint procedure. If you already know how to publish InfoPath forms to SharePoint it’s a breeze. If not, here’s your chance to learn.

Step 2: Deploy a Form for the Initiators, and Create Some Jobs

The first application you’ll create and deploy is one that lets an Initiator create new jobs. Then you’ll use it to create some jobs — which are, remember, really just InfoPath form instances in a SharePoint library.

Step 3: Deploy a Workflow Form for the Approvers

Here is the heart of the workflow. The application named Jobs for Approval will only make available forms in which the AssignedFor field’s value is set to “Approval”.  Rules in the InfoPath form itself control the value of the AssignedFor field, which is how we automate control over who the form flows to next.

Step 4: Deploy a Workflow Form for the Workers

This process is just like Step 3 except the form is named Jobs to Work in and the AssignedFor value is “Work”.

Step 5: Deploy a Workflow Form for the Reviewers

Rinse and repeat: Just like Steps 3 except the form is named Jobs to Review in and the AssignedFor value is “Review”.