---
category: [Administration & Integrations, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions, Platform and Product Extensions/Workday Extend, Platform and Product Extensions/Integration]
keyword: [Extend, Model Components, Extend Business Objects, MCBO, Model Component Business Objects, Business Objects, Model BO]
nav: wcp_docs
parent_url: /wcp_docs/
title: Add Tasks with Business Object Context
layout: subsection
---

### Prerequisites

<a id="prereq_sqh_hws_pwb"></a>
[Create Extend Apps Using App Builder](/wcp_docs/xer1651695264256.html)

### Context

<a id="context_N10021_N1001E_N10001"></a>
You can author tasks in the context of:

-   Workday Extend business objects of your app.
-   Workday-delivered business objects that support the `target` attribute.


<b>Note:</b> You can't use an attachment as the target business object of a task.

Adding context to your task enables users to access the task as a related action from the business object.

You can apply contextual security to a task if:

-   A Workday-delivered business object provides context for the task.
-   A Workday-delivered target business object contextually secures the Workday Extend business object.


In this case, Workday also evaluates the processing user against each instance of the Workday-delivered business object.

<b>Note:</b> When you apply contextual security to a task, the domain security policy for the task shouldn't contain any unconstrained security groups.

### Steps

1.  <a id="step_N10096_N10093_N10052_N10001"></a>In App Builder, add a <b>Task</b> component.
2.  <a id="step_N1004C_N1002C_N1001E_N10001"></a>Author 1 or more unsecured tasks with business object context for your app. Example using Code mode:

    ```
    {
        "id": 2,
        "routePath": "/charities/{taskObjectId}",
        "businessObject": "Charity",
        "securityDomains": ["ManageCharities"],
        "name": "ViewCharity",
        "label": "View Charity"
     }
    ```

    The task will be available as a related action from the Charity business object if the user is on the security policy of the <i>Manage: Charities</i> domain that secures the task.

    Example: If the user is an HR Partner or Manager and views a report listing all charities, they can access this task as a related action from any instance of the Charity business object.

    <b>Note:</b> When a task has the context of a business object, we replace the `taskObjectId` with the Workday ID of the instance of the business object at run time. This enables you to access the Workday ID of that business object instance from a view or edit page using the parameters you specify on the page.

3.  <a id="step_N1006A_N1002C_N1001E_N10001"></a>Author 1 or more secured tasks using a Workday-delivered business object to provide context for the task. Example:

    ```
    {
        "id": 3,
        "routePath": "/charities/{taskObjectId}/update",
        "businessObject": "WORKER",
        "securityDomains": ["ManageCharities"],
        "secured": true,
        "name": "EditCharity",
        "label": "Edit Charity"
     }
    ```

    The contextual security for this task is based on the Workday-delivered business object specified in the task definition. In this case, context is provided by the Worker business object. This task will be available as a related action from the Worker business object if:

    -   The user is on the security policy of the <i>Manage: Charities</i> domain that secures the task.
    -   The user is contextually secured to the instance of the Worker.

    Example: If the user is an HR Partner or Manager and views a report listing the donors to each charity, they can access this task as a related action from only those instances of the Worker business object for whom the user is also the HR Partner or Manager.

4.  <a id="step_N100F0_N10088_N10054_N10001"></a>Author 1 or more secured tasks using a Workday Extend business object to provide context for the task. Example:

    ```
    {
        "id": 3,
        "routePath": "/charities/{taskObjectId}/update",
        "businessObject": "Charity",
        "securityDomains": ["ManageCharities"],
        "secured": true,
        "name": "EditCharity",
        "label": "Edit Charity"
     }
    ```

    The contextual security for this task is based on the target business object specified in the business object definition. In this case, the target is the Worker business object as specified in the Charity business object definition:

    ```
    {
          "id": 4,
          "name": "relationshipManager",
          "label": "Relationship Manager",
          "type": "SINGLE_INSTANCE",
          "target": "WORKER",
          "secureByTarget": true
        }
    ```

    This task will be available as a related action from the Charity business object if:

    -   The user is on the security policy of the <i>Manage: Charities</i> domain that secures the task.
    -   The user is contextually secured to the Relationship Manager of the charity.

    Example: If the user is an HR Partner or Manager and views a report listing all charities, they can access this task as a related action from only those instances of the Charity business object for which the user is also the HR Partner or Manager of the Relationship Manager of the charity.



### Result

<a id="result_N10095_N1001E_N10001"></a>
You can access the task as a related action from the business object according to Workday's configurable security model.

### Related Information

[Concept: Tasks](/wcp_docs/cly1625674524563.html)

[Reference: Model Component Attributes](/wcp_docs/hod1558556125085.html)

[Reference: Targets for Referencing Workday Business Objects](/wcp_docs/qwm1559767719386.html)

