Skip to main content Skip to complementary content

Saving and executing the Job

Procedure

Save your Job and press F6 to execute it.

Results

The tLogRow from the Main link returns the prices whose the discount correspond to the rule. In this example, it means that the discount is correct for price1 and price2.
.--+------+-----------------.
|         tLogRow_1         |
|=-+------+----------------=|
|id|price1|dynamic_column   |
|=-+------+----------------=|
|3 |1999  |0.15 - 4200 - 0.2|
|4 |5000  |0.2 - 3000 - 0.2 |
|5 |300   |0 - 30 - 0       |
'--+------+-----------------'
The invalid data is also filtered.
.--+------+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------.
|                                                                                                                                       tLogRow_2                                                                                                                                       |
|=-+------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=|
|id|price1|dynamic_column   |INVALID_STATUS                                                                                                                                                                                                                                             |
|=-+------+-----------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------=|
|1 |100   |0.2 - 2000 - 0.1 |[{"executionResults":[{"ruleName":"Discount percentage","inputColumn":["price1","dynamic_column.discount1"],"status":"Invalid"},{"ruleName":"Discount percentage","inputColumn":["dynamic_column.price2","dynamic_column.discount2"],"status":"Invalid"}]}]|
|2 |1000  |0.05 - 4000 - 0.2|[{"executionResults":[{"ruleName":"Discount percentage","inputColumn":["price1","dynamic_column.discount1"],"status":"Invalid"},{"ruleName":"Discount percentage","inputColumn":["dynamic_column.price2","dynamic_column.discount2"],"status":"Valid"}]}]  |
|6 |6000  |0.2 - 3000 - 0.1 |[{"executionResults":[{"ruleName":"Discount percentage","inputColumn":["price1","dynamic_column.discount1"],"status":"Valid"},{"ruleName":"Discount percentage","inputColumn":["dynamic_column.price2","dynamic_column.discount2"],"status":"Invalid"}]}]  |
|7 |price | -  -            |[{"executionResults":[{"ruleName":"Discount percentage","inputColumn":["price1","dynamic_column.discount1"],"status":"NE"},{"ruleName":"Discount percentage","inputColumn":["dynamic_column.price2","dynamic_column.discount2"],"status":"NE"}]}]          |
'--+------+-----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'

The NE status means that the rule cannot be executed on the data. In this scenario, the price value cannot be validated because the rule is set to validate numbers.

The other invalid data mean that the discount applied to price1 and/or price2 is incorrect.

For example, the row #2: The discount 0.05 is incorrect for the price 1000 but the discount 0.2 is correct for the price 4000.

When you save the Job, a JAR file containing the rule definition is created in:
studio-path\configuration\.m2\repository\org\talend\libraries\rules-number

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 – let us know how we can improve!