Data Shop

Up to this point, we have created and executed our own tasks and we needed to have knowledge about the existing databases, schemas, and tables, and we also needed to understand how the tables are connected to each other. This knowledge is necessary to properly define XDM task templates, but an application developer or tester may not necessarily be very familiar with the internal database structures. They simply want to order new test data. XDM contains a data shop that allows modelers to request the execution of a pre-defined task with the click of a button. Parameters, such as the desired department name, can optionally be specified. This mechanism allows a large number of end users to benefit from the expert knowledge of database architects.

In this tutorial, we will create an XDM data shop that can be used to run a new task based on the row level processor task template that we have created. When ordering a test data refresh, data shop users will see two single input fields in which they can enter the target environment and department name.

Creating a data shop

  1. In the left sidebar, click the menu category Tasks to expand the tasks menu and select the menu item Data Shops.

  2. Click the button + Create. You will see a panel titled Create Data Shop. Enter the following information:

    Name

    Copy all employees of a department

  3. Click the button Create and edit.

  4. Optional: In the field Description under the tab General Settings, enter a description for the new data shop.

  5. In the top panel, select the tab Template Settings and enter the following information:

    Executable Type

    Select Task Template from the drop-down list

    Task Template

    Select Copy employees by department name from the drop-down list

    Workflow Template

    Leave empty

    Parameters

    Leave empty

  6. In the top panel, select the tab Execution Options and enter the following information:

    Generated Task/Workflow name pattern

    ${dataShop.displayName} at ${.now?iso_local}

    Technical user for Task/Workflow Execution

    Leave empty

    Time Window/Active

    Leave unchecked

  7. Click the button Save Changes.

Once created, a data shop can be executed at any time. Every time an execution is requested, XDM creates an implicit task in the background which is derived from the task template that is associated with the data shop. These individual tasks store the parameters (if any) that were specified when the execution of the data shop was requested.

In the task template that this new data shop references, the target environment is not yet specified. We need to add a parameter that allows the user who triggers the execution to specify this information.

In addition, the row level processor task template also has a custom parameter that allows end users to specify the department name that should be copied. Therefore, we must provide another form field where data shop users can enter that name. This allows the same data shop to copy different departments, depending on what the end user enters when ordering the execution of the data shop.

To add the form fields to the data shop:

  1. Make sure the data shop is currently displayed. If it is not currently displayed, access it by following these steps:

    • In left sidebar, click the menu category Tasks to expand the tasks menu and select the menu item Data Shops.

    • Locate the data shop and click the edit button (Pen button to edit the object) that is located next to it.

  2. In the top panel, select the tab Template Settings. In the subsection Parameters, click the button + to add a parameter. You can create a list of parameters by adding more.

  3. Enter the following information:

    Display Name

    Target Environment

    Description

    (Optional, may be left empty)

    Mapped Property

    Select Target environment from the drop-down list

  4. Click the button + again and enter the following information:

    Display Name

    Department Name

    Description

    (Optional, may be left empty)

    Mapped Property

    Select Department Name from the drop-down list

  5. In the top panel, go to the tab Execution Options. Change the field Generated Task/Workflow name pattern to the following.

    ${dataShop.displayName} (${departmentName}) at ${.now?iso_local}

    Defining a custom name pattern for automatically generated tasks offers the user an opportunity to add more information about the parameters, e.g. the department name. If this field is left empty, the default pattern will be applied, which is ${dataShop.displayName} at ${.now?iso_local}.
  6. Click the button Save Changes.

You can now request the execution of the data shop, and XDM will prompt you for the department name.

Executing a data shop

  1. In the left sidebar, click the menu category Tasks to expand the tasks menu and select the menu item Data Shops.

  2. Locate the data shop to execute and click on the Place Order button (Button with a hand pointing to the right direction).

  3. In the field Target Environment, select Testing HR environment qa2 from the drop-down list. In the field Department Name, enter "Customer Service". Note that you cannot continue without specifying values for both parameters.

    Screenshot of a data shop for ordering test data and filling in required parameters
  4. Click the button Place Order to confirm the request.

Checking the status of the data shop execution

When an order is placed, XDM implicitly creates a new task that is based on the task template associated with the data shop. The name of the implicit task is generated by combining the data shop name and the date and time when the data shop was executed.

The results of the task execution can be checked in the exact same way as the results of task executions that were not triggered by a data shop.

To verify the result of the data shop task execution:

  1. In the left sidebar, click the menu category Task Executions to expand the tasks menu and select the menu item Executed Tasks.

  2. In the list of executed tasks, locate the entry where the column Executable contains Copy employees by department name and the column Start time contains the date and time when the data shop was placed. Click the button Button with an arrow pointing to the right-hand direction to the left of the Status column.

  3. The task runs asynchronously in the background. Eventually, in the top left corner, the task status should show as COMPLETE.


Previous section: Using custom parameters | Next section: Row Level Delete Tasks