Activities in a process are either performed by a person or a system. Activities performed by people are called User Tasks. Activities performed by a system are called Service Tasks.
User Tasks
User tasks defined in Apex Designer are implemented as user interface pages called User Task Pages.
To configure a User Task, select the task in the diagram and use the panel on the right:
Here you can update the name of the task. Users will see this name in their task list, so naming is important. It is a best practice to use a verb followed by a noun.
Task Assignment
Tasks can either be assigned to a team or an individual. Use the Assignment button
There are 3 choices for Assignment Type:
- Team: Assigns the task to a one or more team
- User: Assigns the task to one person based on a process variable, e.g., contactEmail
- Advanced: Allows assignment using an expression based on process variables, such as to an array of users or groups
Task User Interfaces
User tasks each have a user interface specific to their task. Click on the Open User Task Page button
to navigate to the page for the activity.User task pages can be designed much like other User Interfaces, but with some exceptions:
- Path: The path for the page includes the process name, task name and the id for the task
- Properties: The business object for the process is set to be read and saved automatically
- Template: The Task Page component is placed in the page with some default content
These three items should remain on user task pages.
The Task Page component includes a "shell" for the content of the page. It includes a task-specific breadcrumb and task buttons. There are a few options that can be set to override the default behavior of buttons and their actions:
Services Tasks
Service tasks defined in Apex Designer are implemented using the "External" task pattern. This means that the logic behind the service task is defined outside of the Camunda engine. The logic will be defined within your application using a "Service Task Behavior".
A Service Task Behavior is much like any other Business Object Behavior. It can include logic to access and update data for other business objects within the application, but it can also read and update process instance data.
To configure a Service Task, select the task in the diagram and use the panel on the right:
Use the Open Service Task Behavior button
to edit the behavior. This will take you to the business object behavior page for the task:As mentioned above, this is simply a specialized business object behavior. The business object for service tasks is the one that represents the process instance. Notice the list of parameters:
- onboardSupplier
- Named the same as the process
- Contains the process instance parameters
- Allows reading and updating values carried within the running process
- externalTask
- Contains details about the task
For an example of implementing a service task behavior, see Add A Service Task To The Onboard Supplier Process.