Skip to main content Skip to complementary content

Applying the validation rule and viewing the Job execution result

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.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!