Designer > Human Tasks > Using the People Activity

Using the People Activity

This chapter begins by discussing people activities. While these topics mention Guide Designer, you will need to read Using Guide Designer User Tasks for information. However, many of the following topics also relate to Guide Designer user tasks.

What is a People Activity

A people activity contains the instructions and data a person needs in order to complete a task. When a business process requires a decision from a person, rather than an invoked service, use a people activity. Within the Process Developer, this is represented as a User Task:
In BPMN, a people activity is implemented as one of the following, depending on whether the activity contains a task or notification:
The People activity starts when a task is sent to potential task owners and is complete when the task’s owner returns data to the process. Once the process receives the data, it can continue to the next execution step.
The following illustration shows a basic People activity, using a custom name, within a BPEL process.
The people activity is built with a task definition and other details through the activity’s Properties view or it can be built using Guide Designer. (See Using Guide Designer User Tasks for more information.)
When a BPEL process is deployed to the server and is instantiated, the task is sent to all potential owners and administrators. Anyone of these can claim ownership, work on, and complete the task.
For more details, see Conceptual Overview of the People Activity.

Conceptual Overview of the People Activity

A People activity is an extension activity that is a construct from the BPEL4-People specification. It contains a task or notification construct from the Human Task (WS-HT) specification.
A People activity can have one task or notification (plus overrides) and uses process variables to send data to the task or notification. It receives data into a process variable from a task. In addition to using a task or notification, a People activity has its own properties, including scheduled actions, attachments, and other attributes. If you are using Guide Designer, these are defined within the guide.
The following illustration shows the building blocks for a people activity:
A People activity includes a task or notification with additional built-in workflow actions. The building blocks are divided into several properties including:
See also Adding a People Activity.

Adding a People Activity

Add a people activity in one of the following ways from the BPMN palette:
Alternately, use the Participants view to automate some of the requirements for a task-based People activity.

Adding a People Activity from the BPMN Palette

Add a People activity to the process or a scope from the BPMN palette, as shown in the example. The activities in red squares are for task-type People activities and the ones in blue circles are for notification types.
People activity in palette
Fill in the required properties from the People Activity's Properties view. Note that you must create an inline task (or notification) or select a local task (or notification). For details, see Required and Optional Properties of a People Activity.
You may create either a People Activity of Guide Designer User task:
The left tabs are the same for both kinds of activities. However, the contents of the People Activity and Assignment tabs differ slightly. If you choose Guide Designer, the Input and Output tabs may have values set when you associate a guide with this user task. (See Using Guide Designer User Tasks for more information.)

Adding a People Activity Using the Participants View

You can use a shortcut for creating a People activity defined with a local task. The shortcut involves using the Participants view to create a Logical People Group and a local task for the group.
  1. 1. Create a new Human Task Participant and new Human Task.
  2. 2. From the Participants view, drag a human task to the Process Editor canvas.
  3. Notice that the People activity is created using the task interface and assignments definition.
  4. 3. In the Input tab, do one of the following:
  5. 4. Optionally, select an output variable or a to part. For details, see the Process Developer Designer Online Help topics, Output Variable and From Variable to Part.
  6. 5. Select other optional properties as desired.

Adding a People Activity Using the Create Activity Wizard

Use the Create Activity wizard to create a People activity with a local task. You must use a two-way operation for a task in this wizard. If you have a one-way operation for the task, create a People activity manually. Then add the interface and required callback.
  1. 1. Display the Interfaces View. It is not shown by default.
  2. 2. From the Interfaces Port Types elements, expand a Port Type, and drag an operation to the Process Editor.
  3. If you select from Partner Link Type, the wizard assumes you do not want to create a People Activity, since the People Activity does not require a partner link type. The Create Activity wizard appears.
    Create People activity
  4. 3. Select a task, if the operation contains both input and output messages, or a notification for a one-way operation, as described.
  5. If you want to create a task with a one-way operation and a callback, create the task manually.
  6. 4. Type in a task name.
  7. 5. Select the input and output variable names.
When you finish the wizard, a new People activity is created and a new local task appears within the Human Interactions element on the Outline view.
Add values for the properties of both the task and the People activity.

Adding a People Activity by Dragging a Guide

If guides already exist, you an create a people activity by dragging the guide onto the Process Editor canvas.
For more information, see Using Guide Designer User Tasks.

Required and Optional Properties of a People Activity

The following table shows the required and optional properties of a people activity.
Required Properties
Optional Properties
One of the following is required:
  • - Inline task
  • - Inline notification
  • - Local task
  • - Local notification
For details, see Creating an Inline Task or Notification and Selecting a Local Task or Notification.
Scheduled Actions
Input variable or toPart. For details see, Selecting Variables.
Is skippable. See the topic below this table.
Output variable or fromPart (Only if task is selected. Not applicable for a notification.). For details, see Selecting Variables.
People assignment and priority overrides
Using the Is Skippable Attribute
This attribute indicates whether the task associated with the activity can be skipped at runtime. A person working on a human task or a business administrator may skip a task. A skipped task becomes obsolete, and no result is returned to the process. This attribute is optional. The default for this attribute is "no".
This attribute does not apply to a notification.

Creating an Inline Task or Notification

You can create a new, inline, task or notification for use only by the people activity. Alternately, you can select a task or notification created at the process or enclosing scope level, as described in Selecting a Local Task or Notification.
A people activity uses a task or notification definition, as described in See Conceptual Overview of the People Activity.
To Create an Inline Task or Notification:
  1. 1. From the Activity palette, drag the activity to the Process Editor.
  2. People Activity Containing a Task:
    People Activity Containing a Notification:
  3. 2. Select the activity to put the Properties view in focus.
  4. 3. Implement the activity as a people activity.
  5. 4. On the people activity main tab, select either Inline Task or Inline Notification from the Type picklist. A new task named T1 (or new notification named N1) is added to the people activity.
  6. 5. Select the Definition link. The Properties view of the new task is displayed.
  7. 6. At the end of the Task Interface field within the Task tab, select the Dialog (...) button.
  8. 7. Fill in the Interface details for the task.
  9. 8. In the Task or Notification Properties view, add values for the required properties.
Note: Be sure to define all required properties for the new task or notification. For details, see Required and Optional Properties for a Task and Required and Optional Properties for a Notification.

Selecting a Local Task or Notification

A people activity uses a task or notification definition. You can select a local task or notification that has been declared at the process or enclosing scope level. Alternately, you can create a task or notification inline for use only by one people activity, as described in Creating an Inline Task or Notification.
Note: Be sure to create local tasks and notifications first, in order to select from them in a people activity. For details, see Adding a Task or Notification to the Outline View for Process or Scope Use.
To Select a Local Task or Notification:
  1. 1. Add a new people activity as described in Adding a People Activity.
  2. 2. In the Properties view, from the Type picklist, select Local Task or, if appropriate, Local Notification. (These selections will not appear in the same drop-down list.)
  3. 3. From the Definition picklist, select the name of the task or notification that you want to use or select New Task or (if appropriate) New Notification.
If you want to override the people assignments and priority level specified in the local task or notification, see Selecting Overrides for Priority and People Assignments.

Selecting Overrides for Priority and People Assignments

You can create a task or notification definition at the process or scope level and then use the task or notification in many People activities. Within each people activity, you can modify the priority and people assignments that were originally defined.
To Override Original Assignments and Priority:
  1. 1. Select a people activity to put the Properties view in focus.
  2. 2. On the main People Activity tab, create a new expression for the priority.
  3. 3. On the Assignment tab, create new assignments for this activity.
The Assignment tab differs slightly between a People Activity and a Guide Designer.
The above snapshot has an Override column. This column does not appear if you are creating a Guide Designer. It is not there for Guide Designer because you do not need to override or go to the associated task.

Selecting Variables

In a people activity, you select or map to an input and an output process variable associated with a task's interface. The input variable contains the data displayed in a user's task client application. For a task, the data is what a user needs in order to complete the task. For a notification, it is the data that informs a user. The input variable copies data from the BPEL process into the task or notification input parts.
Rather than creating a variable, you can map variable parts using XPaths or XQuery. For details, see the Process Developer Designer Online Help topics, Input Variable and From Part to Variable.
The output variable, available only for a task, contains the data the user sends back to the process. The variable copies data to the BPEL process from the task's output parts, which represents the task's result data.
For details, see the Process Developer Designer Online Help topics, Output Variable and From Variable to Part.

Adding Scheduled Actions for Tasks

You can schedule activation and expiration times for tasks. These properties do not apply to notifications.
For example, you can specify, "This task expires when not completed within 14 days after having been activated".
To Specify a Deferred Activation:
  1. 1. Select the Properties view of a people activity.
  2. 2. Put the All tab in focus.
  3. 3. In the Defer Activation Alarm row, select Deadline or Duration.
  4. 4. In the Defer Activation Expression row, select the Dialog (...) button to open the Expression Builder.
  5. 5. Create either a deadline or duration expression. For examples, see "Deadline and Duration Expressions" in the Process Developer Designer Online Help.
Repeat the steps above to create an Expiration Alarm and Expiration Expression.

Sending and Receiving Attachments

An attachment is data that is relevant to a task but is not defined as one of the input or output parts. This data can be of any type. For example, you can attach a picture, document, spreadsheet, or other file type to a variable in a BPEL process. The people activity can receive attachments from the BPEL process. If attachments exist, the people activity can then make them part of the task, and the attachments are displayed in users’ task client application.
Users can download and update the original attachments, or they can remove or add new attachments when they complete the task. When the people activity completes, it can copy all, none, or new attachments returned with the task to another process variable. If no attachments exist, the setting is ignored.
Using the _peopleActivityAttachments Variable to Copy Attachments
When you add a people activity to the process, a special variable is added to the Process Variables view for holding attachments.
For data attachments, you can create an assign activity with a copy operation that uses an attachment function to copy attachments from or to _peopleActivityAttachments. The attachment functions are listed in the Functions panel of the Query Builder, as shown in the illustration:
Setting the Attachment Propagation Property
In a people activity, on the All tab of the Properties view, you can make selections for copying attachments from the process to the people activity and from the people activity to the process:

Catching a Fault Thrown by the People Activity

If an error occurs or a task expires, and the people activity cannot complete normally, the activity throws one of the following faults:
If desired, you can catch one of these faults in a fault handler of an enclosing scope of a people activity.