Previous Next JavaScript must be enabled to correctly display this content

## 20.16 Creating Tasks from Task Definitions

Create tasks in an Oracle APEX application from existing task definitions.

For APEX to create tasks, you must define a Human Task - Create page process. When the page process runs, APEX creates a new task based on the task definition. In order to be able to use this process, at least one Task Definition must exist as a shared component in the application.

To add a Human Task - Create page process to a page:

1. View the page in Page Designer.
   1. On the Workspace home page, click the App Builder icon.
   2. Select an application.
   3. Select a page.
2. In either the Rendering or Processing tab, locate the node where the process will occur. Right-click and select Create Process.
3. Under Identification:
   1. Name - Specify the name of the process.
   2. Type - Select Human Task - Create.
4. Under Settings:
   1. Definition - Select the Task Definition.
   2. Subject - If specified here, this will override the subject in the task definition.
   3. Priority - If specified here, this will override the priority in the task definition.
   4. (Approval tasks only) Initiator Can Complete - If specified here, this will override the value in the task definition.
   5. Initiator Item - The page item whose value can be used to specify who initiates the task. By default, the logged-in user running the page will be the initiator. This value can be specified to override the logged-in user, allowing a user to initiate a task on behalf of another user.
   6. Task ID Item - When specified, this saves the internal id of the task created when the page is run.
   7. Details Primary Key Item - When specified, this allows Oracle APEX to uniquely identify a record from the table or query that is specified as the Actions Source in the task definition.
      For example, in the Sample Workflows, Approvals, and Tasks app, entering `P4_EMPNO` associates the task with the corresponding record in the `EBA_DEMO_APPR_EMP` table. When the actual owner approves the Job Change Request, APEX updates the table with the new information from the task.
   8. Due Date Item - An optional page item representing the task's due date. When specified, this value overrides the due date calculated from the associated task definition.
5. Configure the rest of the Process.
   For more information, see Creating Page Processes.
6. Set the Page Process Parameters.
   If the Task Definition has parameters specified, these appear in the Process Tree on the page. Parameters can be set to static values or page items. If a parameter is not required, it can be left as `Null`. If a parameter is marked `Required` in the Task Definition, it must be set in the process or there will be an error when saving the page.
7. Click Save.

- Example: Creating a Human Task from a Form Submission
  You can configure both approval and action tasks, collectively known as human tasks, as page processes that can run upon submission of a form.

Parent topic: Managing Workflows and Tasks