Applying the validation rule and viewing the Job execution result - 6.5

Data Integrationジョブの例

author
Talend Documentation Team
EnrichVersion
6.5
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 ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
ジョブデザインと開発 > ジョブデザイン
EnrichPlatform
Talend Studio

Procedure

  1. Click the Validation Rules tab in the Component view of tMysqlOutput.
  2. Select the Use an existing validation rule check box to apply the validation rule to the component.
  3. In the Validation Rule Type list, select Repository and click the three-dot button to select the validation rule from the Repository Content window.
  4. Right-click tMysqlOutput, select Row > Rejects in the menu and drag to tLogRow to create a reject link between the two components.

    If you have enabled the Reject link option for this validation rule you can retrieve the rejected data to the reject flow.

  5. Double-click the tJava component to display its Basic settings.
  6. In the Code field, type in the code that will display the number of updated, inserted and rejected lines processed:
    System.out.println("Updates: "+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_UPDATED"))+"\nInserts:
    "+((Integer)globalMap.get("tMysqlOutput_1_NB_LINE_INSERTED"))+"\nRejects:
    "+((Integer)globalMap.get("tLogRow_1_NB_LINE")));
  7. Save your Job and press F6 to execute it.

Results

Valid data is inserted or updated in the database table and the console displays the rows rejected by the validation rule, along with the number of updates, inserts and rejects processed in the Job.