Creating the Human Tasks using the Approvals Component
If we go back to the steps in the Business Logic, we will find that the following steps require a task to be manually approved/rejected or completed by the Doctor or Patient: Send Appointment Request To Doctor , Raise Invoice Request For Patient, Raise Feedback Request For Patient
These steps therefore correspond to Human Task Activities. Before using them in the workflow, we use the Approvals Component to create the task definitions as follows.
Creating the Task Definition for Appointment Request
Go to Shared Components -> Workflows And Automations -> Task Definitions and click Create

Fill in the Create Task Definition Wizard fields as shown below, and hit Create.

We can now further configure the Appointment Request Task Definition in the Edit Task Definition screen that opens once the Create is hit.

Generating Task Details Page – Notice that the Task Details Page Number is empty. Click on the Create Task Details Page button to generate the details page for this task. You will get a popup dialog asking if the next available page number should be used. Click OK.
We will find that the Task Details Page Number is replaced by the Task Details Page URL containing the link to the generated Details Page.
Adding the Action source – This step ties our task to the system of records, in this case, the doctor records. Select SQL Query as the action source and add the following SQL statement in the Actions SQL Query editor.
select * from doctor where dno = :APEX$TASK_PK
APEX$TASK_PK is a substitution string that holds the value of primary key of the system of records to which the task is tied. In this case, it will hold the employee number of the employee for whom this travel request task is being submitted. Note: Please check the documentation for a complete list of Substitution Strings available for Approvals Component.

Add Task Participants
In the Participants section, select Participant Type as Potential Owner and Value Type as Expression. In the Value field, enter :DNAME .
Note: DNAME refers to the DNAME column in the DOCTOR Table.

Add Task Parameters
Add the following entries to the Task Parameters section.

Click Apply Changes to save the Task Definition.
Similarly, we now create the task definitions for the Invoice Request and Feedback Request Tasks to be raised for the patient.
Creating the Task Definitions for Invoice Request and Feedback Request
Go to Shared Components -> Workflows And Automations -> Task Definitions and click Create
In the Create Task Definition Wizard, select the type as Action Task. Note that these tasks raised for the patients are not approval tasks, i.e they are not expected to be Approved or Rejected. They are only supposed to be actioned, i.e. completed by the patient.
Fill in the details as shown in the three screens below (Generate the task details page as shown for the Appointment Request Task Definition)



Click on Apply Changes to save the task definition
Creating the Feedback Request Action Task Definition
Go to Shared Components -> Workflows And Automations -> Task Definitions and click Create
In the Create Task Definition Wizard, select the type as Action Task.
Enter Subject as Feedback for Consultation on &SCHEDULE.

Fill in the Action Source, Participants and Parameters and as shown in the screen below (Generate the task details page as shown for the Appointment Request Task Definition)

Click on Apply Changes to save the task definition
In the Next Section, we will use these Human Tasks in the Doctor Appointment Workflow and complete designing the Workflow.
