Ruleseditor

info Instruction: For more information on regular expressions, see Regular Expressions

The rule editor allows for complex manipulation of data to be replicated, even when fields have multiple assignments.
In the Field Mapping column, you can see the mappings as they were configured in the Setup Wizard. If you expand an LDAP database field (Destination), you will see the source fields (Source) mapped to it.

An LDAP database field can be expanded and modified using the edit button.

The assigned source fields can be expanded and modified directly in the list.

Rules are always evaluated from the inside out; that is, the rules are first applied to the source fields and then to the database field using the resulting data.

You can view the result of applying the rule directly in the Result column for both the database field and the source field.

Prefix:

The prefix is inserted before the field value.

Suffix:

The suffix is appended to the field value.

Regular expression:

Action:
Actions to be performed using regular expressions:
  • Search and Replace: By entering a regular expression in Search and using Replace, the target value can be manipulated.
  • No matches: Clear field contents: If the field content does not match the regular expression, the field content is deleted.
  • No match: Skip record: If there is no match in the field content for the regular expression, the record will not be replicated.
  • No matches: Delete record: If there is no match in the field content for the regular expression, the data record is deleted from the MetaDirectory database.
  • Use the first non-empty field: When multiple source fields are mapped, only the first field with content is used. Available only for LDAP database fields!

The icons next to the name of the mapping indicate the evaluation status of the regular expression:
  • regular expression syntactically correct, matching test-pattern
  • regular expression syntactically correct
  • Replacement text exists, search expression is missing
  • incorrect regular expression syntx

Example of use:

A database to be imported contains a field named deleted, which indicates whether the record has already been deleted in the source. If the value of the field is "Y", the record should no longer be replicated:
  • Search: \b\S*[^Y]\S*\b
  • Action: No match: Skip record or Delete record if found.
When importing a database, for data cleansing purposes, only URLs that begin with "http" or "www" should be imported; otherwise, the field should remain empty.
  • Search: \b(www|http)
  • Action: No matches: Clear field contents
A database to be imported contains the fields BusinessNumber1 and BusinessNumber2. BusinessNumber1 should be used if a phone number is specified there. If the field is empty, BusinessNumber2 should be used. Both BusinessNumber1 and BusinessNumber2 have been assigned to the LDAP database field Business Phone. Now click the Edit button in the row for the LDAP database field Business Phone and
  • Action: Use the first non-empty field.
select it.
A database stores the street, house number, zip code and city in a database field, each separated by a "$". For example, the database field contains: "Street$12$12345$City".
To use this database with estos MetaDirectory, you must split this combined field and map it to the LDAP database fields for street, house number, ZIP code, and city. In the Field Mapping Wizard, map this single source field to all target fields that need to be populated. In our case, these are the Street, ZIP Code, and City fields. Enable the advanced settings to perform the necessary configuration.
From the list of LDAP data fields select the entry "Street". On the right side, enter the following information for the regular expressions:
  • Search: (.*)(\$)(.*)(\$)(.*)(\$)(.*)
  • Replace: $1 $3
  • Action: Search and Replace
You can immediately see from the regular expression icon whether it is valid. The result list now shows street 12.
The situation is similar for the LDAP data fields zip code and city.
Enter the following values for the "Postcode" field:
  • Search: (.*)(\$)(.*)(\$)(.*)(\$)(.*)
  • Replace: $5
  • Action: Search and Replace
For the "Location" field
  • Search: (.*)(\$)(.*)(\$)(.*)(\$)(.*)
  • Replace: $7
  • Action: Search and Replace
Now you have split the source field appropriately and the database fields will have the appropriate field content after replication.

Version 6.4