Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tutorial:adm:how_to_contract_sync [2018/12/28 18:34] kotisovam [What do you need before you start] |
tutorial:adm:how_to_contract_sync [2022/12/21 08:52] apeterova correlation attribute |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Systems - CSV file: users contracts synchronization ====== | ||
+ | |||
+ | {{tag> contract tutorial sync}} | ||
+ | |||
+ | ===== What is synchronization of contractual relationships? | ||
+ | |||
+ | The principle of this synchronization is the same as for identity synchronization. However, the aim of this synchronization is not a direct identity, but his/her contractual relationship. More on what constitutes a contractual relationship can be found [[: | ||
+ | |||
+ | < | ||
+ | |||
+ | ===== What you need before you start ===== | ||
+ | |||
+ | * You need to install CzechIdM 7.5.0 (and higher). | ||
+ | * You need to be logged in as ' | ||
+ | * You need to have two users ready: ' | ||
+ | |||
+ | ===== Create data with contracts in CSV format ===== | ||
+ | |||
+ | First we need to create sample data that we will synchronize. We will be using the CSV connector, for which we need to create a CSV source file with our sample contracts. | ||
+ | |||
+ | Here are the sample data in CSV format: | ||
+ | < | ||
+ | |||
+ | ID, | ||
+ | 1," | ||
+ | 2," | ||
+ | |||
+ | </ | ||
+ | |||
+ | Create a new file " | ||
+ | |||
+ | ===== Create system ' | ||
+ | |||
+ | Start on the main screen, select Systems and click the Add button. Create a new system in CzechIdM, with the name ' | ||
+ | |||
+ | ==== Connector configuration ==== | ||
+ | |||
+ | Now we can configure the CSV connector and its settings. | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | ==== Generate schema ==== | ||
+ | |||
+ | Once we have configured the system, we need to generate its schema. Go to the scheme tab and click on the " | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | ==== Create sync mapping ==== | ||
+ | |||
+ | System mapping for synchronizing contractual relationships can be created in the tab " | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | ==== Create mapped attributes ==== | ||
+ | |||
+ | Now we have to map our attributes. These are definitions specifying the way the data from our CSV file should be represented in IdM. | ||
+ | |||
+ | === Primary attribute === | ||
+ | |||
+ | One of the attributes must be selected as primary identifier. | ||
+ | |||
+ | * Select '_ _ NAME _ _' from schema attributes. * Checkbox ' | ||
+ | |||
+ | === Name attribute === | ||
+ | |||
+ | Defines the name of the contractual relationship. | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | === Guarantee attribute === | ||
+ | |||
+ | Defines the list of superiors, directly linked to the contractual relationship (more details see below). | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | === Owner attribute === | ||
+ | |||
+ | Defines relation owner. Must be an identity in IdM. This field is required for every relation. | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | === Valid from attribute === | ||
+ | |||
+ | Valid from - Validity for the contractual relationship. This attribute requires LocalDate type. For this we need need to transform our data (as show example below). | ||
+ | |||
+ | <code javascript> | ||
+ | import org.joda.time.LocalDate; | ||
+ | |||
+ | if(attributeValue){ | ||
+ | return new LocalDate(attributeValue); | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | === Valid till attribute === | ||
+ | |||
+ | Valid till - Validity for the contractual relationship. This attribute requires LocalDate type. For this we (sometimes, depending on the format of input) need to transform our data (as show example below). | ||
+ | |||
+ | <code javascript> | ||
+ | import org.joda.time.LocalDate; | ||
+ | |||
+ | if(attributeValue){ | ||
+ | return new LocalDate(attributeValue); | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | === State attribute === | ||
+ | |||
+ | State of contract. In some situations information can be needed to determine the result state in multiple attributes. For example, we can have an attribute ' | ||
+ | |||
+ | To resolve the situation described above we created the transformation script ' | ||
+ | |||
+ | * Select ' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | ==== Create sync configuration ==== | ||
+ | |||
+ | We have created a system with mapped attributes. Now we need to create synchronization configuration. | ||
+ | |||
+ | * Go to the tab ' | ||
+ | * Tick checkbox ' | ||
+ | * Tick checkbox ' | ||
+ | * Fill the name of sync 'Sync contracts' | ||
+ | * In the selectbox 'Set of mapped attributes', | ||
+ | * In the selectbox ' | ||
+ | * On the tab ' | ||
+ | * Save the sync configuration by clicking 'Save and continue' | ||
+ | |||
+ | {{ .: | ||
+ | |||
+ | < | ||
+ | |||
+ | eu.bcvsolutions.idm.core.api.exception.CorrelationPropertyUnsupportedTypeException: | ||
+ | |||
+ | ==== Start sync ==== | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | * On the detail of the sync configuration click on the drop down button and select 'Save and run sync'. {{ .: | ||
+ | |||
+ | ==== Log of sync ==== | ||
+ | |||
+ | After the sync ended (it should not take than a few seconds), you can check result of sync. | ||
+ | |||
+ | * Go to the tab ' | ||
+ | |||
+ | ==== Check contracts on user ' | ||
+ | |||
+ | Finally, you can check the new contract relations of the user ' | ||
+ | |||
+ | * Find the user ' | ||
+ | |||
+ | * **Default** | ||
+ | * **Contract one** - has to be in the state excluded and as an authorizer it must have the user ' | ||
+ | * **Contract two** - has to be active (state is empty). | ||
+ | {{ .: | ||
+ | |||
+ | <note tip>**If you see the same result, then congratulations on your first successful synchronization of contract relationships!**</ | ||
+ | |||