How to Create a Role-Based Mobile Workflow Using Formotus

 

INTRODUCTION

A key feature of Formotus mobile workflows is the ability to dispatch or assign a form to a particular individual or role. A single form can be passed from user to user as needed to complete a business process. In the blog post Hello World: Creating Your First Mobile Workflow Form you can learn  to create a very simple form that users can pass back and forth by specifying each other’s Formotus ID in one of the form fields. (That exercise is recommended before continuing with this one.) 

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

Note:  SharePoint server-side workflows are not in use here. Formotus workflows are created by implementing filtering rules on the mobile app side instead, thereby controlling what items appear in the lists seen by different users.  

REQUIREMENTS

  • iPad, iPhone or Android 2.2+ device (tablet size preferred)
  • InfoPath Designer 2010
  • Access to a SharePoint site with credentials sufficient to publish an InfoPath form template to a form library. If your SharePoint server is on a private network the requirement is that your device can reach both the SharePoint server and the Internet (e.g. www.formotus.com).

    Tip: Formotus is compatible with SharePoint Online, available as part of a 30-day free trial of Office 365
  • A Formotus online account (sign up for a free trial account here).
  • The InfoPath form template used in this tutorial

 

SCENARIO

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

  • The Initiator creates a new job, entering 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.

Here’s the demo form we’ll be using:

iPad.png

RULES

By definition a workflow is 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. Any Approver can grab and approve a job. A job grabbed by one approver cannot be grabbed by another.
  • After a job is approved it must be worked. Only those in the Worker role can see jobs awaiting work. Any Worker can grab and work a job. A job grabbed by one worker cannot be grabbed by another.
  • After a job is worked it must be reviewed. Only those in the Reviewer role can see jobs awaiting review. Any Reviewer can grab and review a job. A job grabbed by one reviewer cannot be grabbed by another.
  • Reviewers will continue to see a job until a Reviewer marks the job closed.

There is no server on which these rules are defined and carried out. Instead, we’ll create four different mobile applications, one for each role, then deploy each application to the users who belong to that role.

It’s not as difficult as it sounds because all four applications use exactly the same InfoPath form, but configured differently in the Formotus console. Let’s get started…

 

STEP 1: PREPARE THE FORM AND PUBLISH IT TO SHAREPOINT

SET SECURITY LEVEL

Disclaimer: The InfoPath trust settings and their relationship to SharePoint servers of various configurations – well, it’s complex and sometimes finicky. If you run into difficulties , it’s not an issue that involves Formotus at all but you should be able to find answers on the Internet or in your IT group.

That said, at a minimum you’ll usually need to make the following change to your security settings. Click the File tab and then the big Form Options button, and select Security and Trust. Then unmark the “Automatically determine” checkbox and choose Full Trust.

This setting will stop assorted errors when running the form on your PC and may be the right setting for SharePoint. The Tutorial form comes with a FormotusTest certificate. When creating your own forms you may need to add your own certificate to the form on your PC.

PROMOTE DISPOSITION FIELDS

This step has already been done in the Tutorial form, but if you create your own form it’s a mandatory step.  

Under  File | Form Options, select Property Promotion. You need to promote all the Disposition fields, along with any other fields you’d like to see as columns on your SharePoint site.

 

PUBLISH TO SHAREPOINT

Now your form is ready to publish to your SharePoint site: File | Publish | SharePoint Server. You should be able to accept all the defaults to create a new Form Library and publish the InfoPath form to it. We recommend you name the new form library ‘Workflow Tutorial’, but that’s not critical.

Tip: When the form finishes publishing and it offers to let you open the SharePoint site, do so. You’ll need to copy and paste that URL a few times.

 

CHANGE SUBMIT DATA CONNECTION

Change the existing data connection to submit to your own SharePoint rather than the Formotus site.

  1. On the InfoPath ribbon click Data | Data Connections | Modify to modify the Main Submit connection.
  2. Replace the existing Document Library URL with your own.
  3. Notice that we’ve constructed the file name to include a timestamp. This assures that each job created has a unique filename on SharePoint.
  4. Finish the Data Connection wizard.
  5. Click File | Quick Publish to propagate this change to SharePoint.

 

STEP 2: DEPLOY A FORM FOR THE INITIATORS, AND CREATE SOME JOBS

The first app we’ll deploy an is one that lets a mobile user create new jobs right on the device.  

Workflow forms always open instances from SharePoint, so this form needs to be a regular non-workflow form that opens a new instance instead. 

  1. Log into your account at secure.formotus.com and click Applications on the left.
  2. Click Upload InfoPath Form
  3. Choose the Upload from SharePoint option:
  4. Paste the URL of your Workflow Tutorial form library, fill in SharePoint credentials, and change the name of the form to New Job Creator.                                   
  5. Click
  6. Finish uploading and publishing the form with default values, then deploy it to yourself any mobile users who will be creating new jobs.

NOW CREATE SOME JOBS

Workflow forms always open existing jobs from SharePoint, so let’s create some jobs on SharePoint. Log in to Forms Central on your device and install the New Job Creator form. Then, at least once, open the form, fill out the Initiator section, and submit it.

Note: Since a new job is really just a new instance of an InfoPath form in a SharePoint library, initiating a job can also be done by clicking Add New in the SharePoint library and using InfoPath to submit a new job.

 

 

STEP 3: DEPLOY A WORKFLOW FORM FOR THE APPROVERS

  1. Log into your account at secure.formotus.com and click Applications on the left.
  2. Click Upload Workflow Form.
  3. Paste the URL of your Workflow Tutorial form library, fill in SharePoint credentials, and change the name of the form to “Jobs for Approval”.

    Note: We’ll be uploading this form several times and giving it different names.
  4. Click Next to go to the Settings page, where we will change only two settings.
  5. Under Create a Second-line Memo, choose the field named Memo from the dropdown. This allows the memo field in the form to be displayed when a form is waiting, just like in the Hello World demo:
  6. Under Show Only Jobs Assigned to a Certain Role, choose AssignedFor from the dropdown menu. (Don’t worry if SharePoint has inserted any extra characters.)
  7. Enter “Approval” in the following text box.

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

  1. Click Publish.
  2. Select yourself (and any users you want to authorize as Approvers) , and click Deploy.
  3. Log into Forms Central on your mobile device and install the new Jobs for Approval form. When you open it, you should see any jobs you created as an Initiator.
  4. Grab at least one job, open it, and approve it. Notice that it disappears from your list, because it is no longer assigned for Approval, it is now assigned for Work.

 

STEP 4: DEPLOY A WORKFLOW FORM FOR THE WORKERS

Note:  This process is the same as Step 3 except the form is named Jobs to Work in and the AssignedFor value is Work.

  1. Log into your account at formotus.com and click Applications on the left.
  2. Click Upload Workflow Form.
  3. Paste the URL of your Workflow Tutorial form library, fill in SharePoint credentials, and change the name of the form to “Jobs to Work”.
  4. Click Next to go to the Settings page.
  5. Under Create a Second-line Memo, choose the field named Memo from the dropdown.
  6. Under Show Only Jobs Assigned to a Certain Role, choose Assigned For from the dropdown menu. (Don’t worry if SharePoint has inserted any extra characters.)
  7. Enter “Work” in the following text box.
  8. Click Publish.
  9. Select yourself (and any users you want to authorize as Workers) , and click Deploy.
  10. Log into Forms Central on your mobile device and install the new Jobs to Work form. When you open it, you should see any jobs you approved.
  11. Grab at least one job to open, complete as a Worker and submit. Notice that it disappears from your list, because it is no longer assigned for Work, it is now assigned for Review.

 

STEP 4: DEPLOY A WORKFLOW FORM FOR THE REVIEWERS

Note:  This process is the same as Step 3 except the form is named Jobs to Review in and the AssignedFor value is Review.

  1. Log into your account at secure.formotus.com and click Applications on the left.
  2. Click Upload Workflow Form.
  3. Paste the URL of your Workflow Tutorial form library, fill in SharePoint credentials, and change the name of the form to “Jobs for Review”.
  4. Click Next to go to the Settings page.
  5. Under Create a Second-line Memo, choose the field named Memo from the dropdown.
  6. Under Show Only Jobs Assigned to a Certain Role, choose Assigned For from the dropdown menu. (Don’t worry if SharePoint has inserted any extra characters.)
  7. Enter “Review” in the following text box.
  8. Click Publish.
  9. Select yourself (and any users you want to authorize as Reviewers) , and click Deploy.
  10. Log into Forms Central on your mobile device and install the new Jobs for Review form. When you open it, you should see any jobs you completed as a Worker.
  11. Grab at least one job to open, complete as a Reviewer and submit. Notice that if you marked the option Close This Job the job disappears from your list, otherwise it doesn’t. We’ll leave it to you to understand the InfoPath rules behind that behavior.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.