Use a CondValidateReport function to implement validation rules on a hardware request form.
Before you begin
Name, Location, Department, HW_ID
Procedure
- In Talend Data Mapper, open Hierarchical Mapper > Structures.
- Import hardware_request.csv as a Structure. This creates a new hardware_request Structure.
- Right-click Hierarchical Mapper > Maps and select New > Map.
- Select Standard Map and create a new map called hardware-request.
- Open the newly created hardware-request Map and drag the hardware_request Structure to both the Input and Output tables.
- Map each row from the Input to the corresponding row in the Output table.
- Select the Department row from the Output table and open the Validate tab.
- From the Functions tab, select CondValidateReport and drop it in the Validate tab.
- Double-click on CondValidateReport and enter Invalid Department in the Message field.
- In the Condition section, drag-and-drop the Equal function.
-
In the First Value section, drag-and-drop the
Constant function and enter
Sales in its Value
field.
- In the Second Value section, drag-and-drop the Department row from the Output table.
-
Open the hardware_request.csv file to modify the entry.
Replace the values with:
John, Dublin, Sales, 12 Harrison, Denver, Sales, 14
- Select Show Document > Import Document from File and select the hardware_request.csv file you just edited.
-
Click Test Run to see the results:
- Repeat step 13. Modify Sales to Support.
-
Repeat steps 14-15. See that an error is displayed after clicking
Test Run.