Home / Repstance User Guide / 7. COMMANDS TO BE USED / 7.4 Prepare Capture Process / 7.4.7 Transformation Rules and Triggering Order

7.4.7 Transformation Rules and Triggering Order

It is imperative that you understand that the order in which the rules are applied can significantly impact on the expected results. The following logic is used to handle rule order processing. The specified Capture Process will go and look for any possible data that meets the first of the configured rules, to apply. In the case where there is more than one rule to be processed, the rule which will “take precedence“ will be the rule which best fulfills the data found. If the objects found match the criteria given in the first rule to be processed any subsequent rules will be ignored because the previous criteria have been met.

The logic used in transformation does not necessarily follow the rules for human logic, in that, the least significant amount of data to be processed should be the first rule, and the rule which affects the largest amount of data should be the last rule. In this way the user will be able to apply the requirements of the transform in the desired way.

The following example demonstrates this program logic. Assume that you need to rename all tables in the dbo schema having a name starting with emp into the schema hr and keep the original table name. Another requirement is to rename the ident columns to be the id for any tables in the dbo schema, in the case where we have an employee table that contains the ident column, this matches both rules. The examples demonstrate the replication behavior depending on the order that the rules are presented:

  • In this case you can’t expect the ident column to be renamed into id column together with renaming dbo schema in hr schema. The dboschema for employee table will be changed to hr schema but the ident column will not be changed:
map=1,rule=(dbo.emp%:hr.emp%),description="sample 1"
map=2,rule=(dbo.%.ident:dbo.%.id),description="sample 2"
  • In this case the dbo schema will not be changed into the hr schema with renaming the ident column to the id column. The dbo schema for employee table will not be changed but the ident column will be changed to id:
map=1,rule=(dbo.%.ident:dbo.%.id),description="sample 3"
map=2,rule=(dbo.emp%:hr.emp%),description="sample 4"
  • In this case the dbo schema for employee table will be changed and the ident column will be changed to id:
map=1,rule=(dbo.emp%.ident:hr.emp%.id)
map=2,rule=(dbo.emp%:hr.emp%)
map=3,rule=(dbo.%.ident:dbo.%.id)