Entering content frameProcedure documentation Unit 4: Defining and Inserting Task "Create Notification of Absence" Locate the document in its SAP Library structure

Use

The notification of absence is created in the first step of the workflow. You will also need a task that executes this function. You can create the task separately from the workflow definition or directly from the Workflow Builder. This unit describes how you create the task from the Workflow Builder.

For further information on creating an individual task, refer to Definition of Single-Step Tasks in the SAP Business Workflow documentation.

Prerequisites

This task is a single-step task and it references one object method. The object type used (FORMABSENC (notification of absence)) and the required method (Create) are already defined and implemented in the Business Object Repository.

You are in the Workflow Builder and your workflow is displayed in change mode.

Procedure

Creating an activity as a step in the workflow definition

Add a first step of the type Activity to the workflow definition.

  1. Choose This graphic is explained in the accompanying text under step type. The cursor changes shape.
  2. Position the cursor on the Undefined step and click.

By doing so, you add an activity to your workflow definition. The step definition is shown in the right-hand part of the screen. You are on the tab page Control.

Defining a Task "Create Notification of Absence"

You now create a new task, with which a notification of absence can be created.

  1. Choose the arrow This graphic is explained in the accompanying text on the right next to the This graphic is explained in the accompanying text and then Create task.
  2. The Basic data tab in the Standard task: Create screen is then displayed.

    Entering the basic data

  3. Enter an abbreviation (of your choice) and a name (of your choice) for the standard task to be created.
  4. Abbreviation: < ini _creat>

    Name :<Create notification of absence (ini)>

    Work item text

    The work item text appears as an information text in the Business Workplace as soon as there is a work item for the step with this task.

  5. Enter Create notification of absence in the Work item text field.
  6. Object type and method

  7. Enter an object type and a method:
  8. Object category: BOR object type

    Object type: FORMABSENC

    Method: CREATE

    You can also use the F4 input help to select the method. Additional indicators associated with this method are set automatically.

    Note

    You can view the definition of the object type entered by double-clicking on it. Information about its components is provided.

  9. Save your task as a local object.
  10. The system has now allocated an 8-digit number for your task. This number is made up of the 3-digit prefix number (Customizing setting) and a 5-digit number taken from a number range. The identification of this task consists of TS and the eight digit number.

    Task description

    The task description is used in the work item preview to provide the recipient of the work item with more information.

  11. Go to the Description tab.
  12. Choose the text type Task description and then This graphic is explained in the accompanying text.
  13. The Task description screen is displayed. You can create a text here using the SAPscript Editor.

  14. Enter a text that describes the task. You can use the following proposal:
  15. <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.>

  16. Choose Back and save the task definition.
  17. Exit the task definition with This graphic is explained in the accompanying text.

Interim result

You have now defined your first task. This task is used in the activity that you created in the Workflow Builder.

Completing Activity

When you exit the task definition, the Define Container Elements and Binding dialog box is displayed in which the system proposes a change to the workflow container and a binding definition:

The system proposes that you create a local container element in the workflow container, which can store the reference to the notification of absence created in this step. The element has the technical name AbsenceForm .

The system proposes that you define a binding from the task container to the workflow container. This binding transports the reference to the generated object (i.e. the created notification of absence) from the task (from the _WI_Object_ID element in the task container) to the workflow (to the AbsenceForm element in the workflow container).

For more information on automatic binding definition proposals, see Binding Definitions from the Workflow Container and Binding Definitions from the Task Container in the documentation on SAP Business Workflow.

  1. Confirm the proposal with This graphic is explained in the accompanying text.
  2. The new AbsenceForm container element is displayed in the workflow container. Local container elements are marked This graphic is explained in the accompanying text. The remaining elements in the workflow container are workflow system elements. For more information, see Workflow System Elements in the Workflow Container.

  3. Enter a text to describe the step.
  4. You can, of course, leave the name of the task that is proposed by the system. The name entered here is used to identify the step in your workflow definition.

  5. Go to the Outcomes tab.
  6. All of the possible outcomes for this step are displayed here. Only the outcome Step executed is active.

  7. Enter a text for the name of the active outcome.
  8. Enter the name (proposal: < Application filled out> ) in the Step executed line.

    Each step has at least one subsequent outcome (in this case: Step executed). The name is the text with which the outcome is labeled in the workflow definition.

    The Form does not exist and Form could not be generated outcomes are the possible exceptions that could occur in the method execution. You "run the risk" of not intercepting these exceptions and not modeling any exception handling in your workflow definition. If one of the exceptions actually occurs at runtime, the workflow will assume the error status.

    Checking the binding definition (optional)

  9. Go to the Control tab.
  10. Choose This graphic is explained in the accompanying text Binding (present).

The Binding for Step '<Create notification of absence (ini)>' dialog box is then displayed.

This binding direction is not relevant for this step since no information is to be transported from the workflow to the task.

Here, the binding is _WI_ObjectId. This graphic is explained in the accompanying text &ABSENCEFORM& has been automatically defined here by the system. This binding ensures that the reference to the notification of absence created is not only known in the task, but also in the workflow.

You can view the definition of both containers by choosing Workflow container or Task container.

(The element of the task container _WI_Object_ID is called Notif. of absence .)

  1. Choose This graphic is explained in the accompanying text.
  2. You then return to the step definition.

    Defining recipients

    You have to define who is to execute the work item at runtime. You can enter possible, responsible, and excluded agents. Recipients of the work item are all responsible agents who are also possible agents and who are not listed as excluded agents.

    Determining possible agents

    Selecting the possible agents for this task determines who is to be authorized to make leave requests. For this task, this should be all employees in your enterprise. Define the task as a general task.

  3. Choose This graphic is explained in the accompanying text on the Control tab page in the frame Task properties.
  4. This takes you to the Standard task: Maintain Agent Assignment screen.

  5. Position the cursor on the name of your task.
  6. Choose Properties…
  7. You go to the Task: dialog box.

  8. Set the General task indicator.
  9. Choose This graphic is explained in the accompanying text Copy and then This graphic is explained in the accompanying text.
  10. Entering the responsible agents

  11. On the tab page Control, choose the entry Workflow initiator (expression) in the area agent as the responsible agent.

The system enters the expression &_WF_INITIATOR& in the Expression field and in the input field beside the checkbox.

Note

You start your executable workflow later manually. At this point in time, the system fills the workflow container element _WF_Initiator automatically with your user name.

The above assignment informs the workflow system that the first work item for creating the notification of absence should be addressed as the "starter" of the workflow.

Concluding step definition

  1. Choose This graphic is explained in the accompanying text to check the step definition.
  2. Choose This graphic is explained in the accompanying text to exit the step definition.
  3. Choose This graphic is explained in the accompanying text to view the entire workflow definition in the workflow area on the screen.
  4. You will notice that your workflow definition now contains a new step (the activity just created). The undefined step is also still there.

  5. Choose This graphic is explained in the accompanying text.
  6. The workflow definition is checked, saved, and, provided it does not contain any errors, activated. The system displays a message if problems are encountered during the test.

  7. Exit the Workflow Builder.

Result

You have added the first step to your workflow.

Leaving content frame