Scenario: Deleting tasks from the Data Stewardship Console - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
Data Governance
Data Quality and Preparation
Design and Development

This scenario describes a multi-component Job that deletes data sets stored in the Data Stewardship Console database in the form of tasks, if these tasks match certain criteria. The first part of the scenario creates some sample data and data stewardship tasks, and the second part deletes tasks which are not used.

Creating sample stewardship tasks

The first part of this scenario creates the sample data and data stewardship tasks.

  1. Drop a tFixedFlowInput component from the Palette onto the workspace, and rename it SampleData.

  2. In the Component view of tFixedFlowInput component called SampleData, click the Edit schema button. In the schema that opens, create the columns shown below and set the appropriate Type for each column.

  3. Select Use Inline Table and enter some data in each of the columns, as in the example below.

  4. Drop a tStewardshipTaskOutput component onto the workspace, and rename it CreateStewardshipTasks.

    The tStewardshipTaskOutput component creates tasks in the Talend Data Stewardship Console database and lists these tasks in the Talend Data Stewardship Console.

  5. Connect the tFixedFlowInput component called SampleData to the tStewardshipTaskOutput component called CreateStewardshipTasks using a Row Main link.

  6. In the Component view of tStewardshipTaskOutput component called CreateStewardshipTasks, in the Basic settings tab, provide the connection information (Url, User name and Password) for the Data Stewardship Console to which you want to connect, and the information about the tasks you want to create, as shown in the following example.

  7. Run your Job and then open the Data Stewardship Console to check that your tasks have been created.

Deleting unused tasks

The second part of this scenario lets you delete those tasks which are no longer used.

  1. Drop a tStewardshipTaskInput component from the Palette onto the workspace. Connect the tFixedFlowInput component called SampleData to the tStewardshipTaskInput component using an OnSubjobOk trigger.

  2. In the tStewardshipTaskInput_1 component, in the Basic settings tab, provide the connection information (Url, User name and Password) for the Data Stewardship Console to which you want to connect, and information about the tasks you want to use as input (Owner, Tag, Start Date and End Date).

    For this scenario, make sure you specify the Tag as tag1.

  3. Drop a tLogRow component from the Palette onto the workspace. Connect the tStewardshipTaskInput_1 component to the new tLogRow component using a Row Main link.

    The tLogRow component is used to monitor data processed.

  4. Drop a tStewardshipTaskDelete component from the Palette onto the workspace. Connect the tStewardshipTaskDelete component to the tStewardshipTaskInput_1 component using an OnSubjobOk trigger.

    The tStewardshipTaskDelete component helps streamline processes by removing tasks that are no longer used or relevant when they match certain criteria.

  5. In the tStewardshipTaskDelete component, in the Basic settings tab, provide the connection information (Url, User name and Password) for the Data Stewardship Console to which you want to connect.

  6. In the Task Configuration area of the Basic settings tab of the tStewardshipTaskDelete component, enter the criteria to use when deciding which tasks to delete. An example is shown in the image below.

  7. Drop a tJava component from the Palette onto the workspace. Connect the tStewardshipTaskDelete component to the tJava component using an OnSubjOk trigger.

    The tJava component makes it possible to extend the functionalities of a Talend Job through using Java commands. In this case, it shows you which tasks are deleted.

  8. In the Basic settings tab of the tJava component, enter the following code:

    System.out.println("---------------:"+((Integer)globalMap.get("tStewardshipTaskDelete_1_DELETED_TASK_NUMBER")));

  9. Press F6 to run your Job and refresh or reopen the Data Stewardship Console to check that your tasks have been deleted.