Lesson 3: Creating Workflows
Use
To define the flow of the approval process in the system, create a workflow consisting of a workflow definition and a multistep task workflow template. If you create a workflow from the Workflow Builder, the system creates the required multistep task automatically.
Prerequisites
You are in the Workflow Builder and an initial workflow definition is displayed.
Procedure
Create Workflow
-
Choose
.Enter the initial basic data for the workflow in the dialog box displayed.
-
Enter an abbreviation (of your choice) and a name (of your choice) for the workflow to be created.
-
Abbreviation: < ini _ws>
-
Name: < Workflow: Notification of Absence ( ini )>
-
-
Choose
.The Create object directory entry dialog box appears.
-
Choose Local Object.
The system has now allocated an 8-digit number for your workflow. This number is made up of the 3-digit prefix number (a setting in Customizing) and a 5-digit number taken from a number range. This number together with the letters WS forms the workflow ID. Make a note of the ID so that you can later call the workflow more quickly.
You return to the Workflow Builder. The workflow ID and the current status of the workflow are displayed in the information area.
Entering the basic data for the workflow
-
Switch to the basic data of the workflow. Choose
.The basic data for the workflow, divided into version-dependent and version-independent data, is displayed.
Entering a workflow description
-
Switch to the Version-independent (task) tab page and then to the Description tab page.
-
Choose Task description as the text type. The Task description screen is displayed.
The Task description screen is displayed. You can create a text here using the SAPscript Editor.
-
Enter a text that describes the task. You can use the following proposal:
<You can use this workflow to create a notification of absence. This will then be sent to your superior for review. You will be notified of the result of this review.
If your request is rejected, you can revise it and resubmit it for review or withdraw it completely.>
-
Choose
to go back to the processing of the workflow.
Determining agents
To enable the workflow to be started in dialog, you have to assign possible agents to the workflow.
-
Choose
in the application toolbar.The workflow template: agent assignment screen is displayed.
-
Position the cursor on the name of your workflow.
-
Choose Properties….
You go to the dialog box Task.
-
Set the General Task indicator.
-
Choose
Copy and then
. -
Exit the basic data of the workflow and choose Save.
Result
You have created a workflow with its basic data. The required multistep task was created automatically by the system.
To create a workflow definition, you need tasks that are used as steps in the workflow definition.
Additional information: Tasks
A task can either be a single-step task or a multistep task. In our example of the notification of absence, making the application and checking the application are single-step tasks. The entire procedure involved in processing a leave request consists of these (and other) single steps, and is therefore a multistep task.
For more information, see Definition of Multistep Tasks in the SAP Business Workflow documentation.
On a technical level, the main difference between single-step tasks and multistep tasks is that:
-
Every single-step task refers to an object method
-
Every multistep task refers to a workflow definition
A workflow definition is made up of a sequence of different steps (for example, all steps required to process a leave request).
Standard tasks and workflow templates are client-independent. Customer and workflow tasks are client-dependent. Customer and workflow tasks are no longer supported and are therefore no longer used in this tutorial.
An Activity is a possible step type in a workflow definition. An activity refers to a task. It references a task, which can be a single-step or multistep task (subworkflow).
For more information, see Tasks and Task Groups in the SAP Business Workflow documentation.