Mapping Business Activities and Tasks Using Orchestration
A mobile application consists of a number of business activities and tasks that mobile workers use to perform their jobs. The activities and tasks are usually specific to the responsibilities of the individual worker. For example, a salesperson places orders, a service technician registers time and materials, and a warehouse worker picks orders. The mobile device should be tailored to the role of the individual user or group of users.
On the mobile device, the application consists of different screen sequences the worker can navigate to support the activities. The mobile worker can view information, enter data, and submit requests to the business solution.
Working with Business Scenarios
The following is a simple business scenario for a mobile sales worker. Two typical activities for this type of worker can be:
-
Creating new customers.
-
Viewing details about existing customers.
The following illustration describes how to create a new customer. The worker is led through a sequence of tasks for adding general details about the customer, such as name and e-mail address, a credit limit, and a contact person. When completed, the information is sent to the business system for processing.
The following illustration describes how to view details of an existing customer. The worker is presented with a screen that shows details of a customer, such as contact and credit limit information, found in the database.
A business activity can consist of one or more tasks. In Mobile Device SDK, these tasks are defined using tasklets. A tasklet is a self-contained business component that performs a specific function. Building a mobile application involves arranging the sequence and data flow between tasklets to support the business logic needed for the mobile worker.
It is important to notice that the same tasklets are used in both of the previous scenarios. The difference is that in the first scenario, the tasklets are arranged in a wizard that enables the user to enter data. In the second scenario, the tasklets are read-only and accessed from soft keys.
Mapping Business Logic in the Application with UserRole.xml
With Mobile Device SDK, the business logic of an application is described using the UserRole.xml file. The UserRole.xml file is a structured XML file that controls the interaction between tasklets. There are three main elements in the UserRole.xml file: orchestrations, tasklets, and actions. The following diagram illustrates the hierarchy of these elements in the UserRole.xml file.
-
An orchestration defines a single business activity for the application. An orchestration controls the interaction of one or more tasklets. A mobile application can consist of more than one orchestration.
-
A tasklet is a programmed .NET framework assembly that performs a task within a business activity.
-
An action controls the sequence and flow between tasklets.
The following is a simplified version of a UserRole.xml file for the sample scenarios shown at the start of this section.
<userRole xmlns="http://schemas.microsoft.com/Dynamics/Mobile/2007/04/Flow">
<orchestrations>
<orchestration text="Customer detail">
<tasklets>
<tasklet name="CustomerDetailTasklet">
<actions>
<open text="Contact" tasklet="CustomerContactDetailTasklet">
</open>
<open text="Credit Limit" tasklet="CustomerCreditLimitDetailTasklet">
</open>
</actions>
</tasklet>
<tasklet name="CustomerContactDetailTasklet">
</tasklet>
<tasklet name="CustomerCreditLimitDetailTasklet">
</tasklet>
</tasklets>
</orchestration>
<orchestration text="New Customer">
<wizardSteps>
<wizardStep tasklet="CustomerDetails" />
<wizardStep tasklet="CreditLimit" />
<wizardStep tasklet="ContactDetails" />
</wizardSteps>
<actions>
<exitOrchestration text="Cancel"/>
</actions>
<tasklets>
<!-- Credit Details -->
<tasklet name="CustomerDetails" text="Customer Details" type="CustomerDetailTasklet.CustomerDetailTasklet, CustomerDetailTasklet">
<actions>
<next priority="2" text="Next" validate="true">
</next>
</actions>
</tasklet>
<!-- Credit Limit -->
<tasklet name="CreditLimit" text="Credit Limit" type="CustomerCreditLimitDetailTasklet.CustomerCreditLimitDetailTasklet, CustomerCreditLimitDetailTasklet ">
<actions>
<previous priority="1" text="Previous" />
<next priority="2" text="Next">
</next>
</actions>
</tasklet>
<!-- Contact Details -->
<tasklet name="ContactDetails" text="Contact Details" type="CustomerContactDetailTasklet.CustomerContactDetailTasklet, CustomerContactDetailTasklet">
<actions>
<previous priority="1" text="Previous">
</previous>
<exitOrchestration text="Finish"/>
</actions>
</tasklet>
</tasklets>
</orchestration>
</orchestrations>
</userRole>