Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
tutorial:adm:how_to_contract_sync [2021/01/06 15:56] kasalr |
tutorial:adm:how_to_contract_sync [2022/12/21 08:56] apeterova |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Systems - CSV file: users contracts synchronization | + | ====== Systems - CSV file: users contracts synchronization ====== |
{{tag> contract tutorial sync}} | {{tag> contract tutorial sync}} | ||
===== What is synchronization of contractual relationships? | ===== 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 [[devel: | ||
- | <note tip> | ||
- | < | + | 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 ===== | ===== What you need before you start ===== | ||
- | | + | |
- | * You need to be logged in as ' | + | |
- | * You need to have two users ready: ' | + | * You need to be logged in as ' |
+ | * You need to have two users ready: ' | ||
===== Create data with contracts in CSV format ===== | ===== 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. | + | 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: | Here are the sample data in CSV format: | ||
< | < | ||
+ | |||
ID, | ID, | ||
1," | 1," | ||
2," | 2," | ||
+ | |||
</ | </ | ||
- | Create a new file " | + | Create a new file " |
===== Create system ' | ===== Create system ' | ||
- | Start on the main screen, select Systems and click the Add button. | ||
- | Create a new system in CzechIdM, with the name ' | ||
- | |||
+ | Start on the main screen, select Systems and click the Add button. Create a new system in CzechIdM, with the name ' | ||
==== Connector configuration ==== | ==== Connector configuration ==== | ||
- | Now we can configure the CSV connector and its settings. | + | |
+ | Now we can configure the CSV connector and its settings. | ||
<note important> | <note important> | ||
- | {{ : | + | {{ .: |
- | {{ : | + | {{ .: |
==== Generate schema ==== | ==== Generate schema ==== | ||
- | Once we have configured the system, we need to generate its schema. | + | Once we have configured the system, we need to generate its schema. Go to the scheme tab and click on the " |
- | Go to the scheme tab and click on the " | + | |
- | {{ : | + | {{ .: |
==== Create sync mapping ==== | ==== Create sync mapping ==== | ||
+ | |||
System mapping for synchronizing contractual relationships can be created in the tab " | System mapping for synchronizing contractual relationships can be created in the tab " | ||
- | {{ : | + | {{ .: |
==== Create mapped attributes ==== | ==== 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. | 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 === | === Primary attribute === | ||
+ | |||
One of the attributes must be selected as primary identifier. | One of the attributes must be selected as primary identifier. | ||
- | * Select '_ _ NAME _ _' from schema attributes. | + | * Select '_ _ NAME _ _' from schema attributes. * Checkbox ' |
- | * Checkbox ' | + | |
- | {{ : | + | |
=== Name attribute === | === Name attribute === | ||
+ | |||
Defines the name of the contractual relationship. | Defines the name of the contractual relationship. | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | {{ : | + | {{ .: |
=== Guarantee attribute === | === Guarantee attribute === | ||
+ | |||
Defines the list of superiors, directly linked to the contractual relationship (more details see below). | Defines the list of superiors, directly linked to the contractual relationship (more details see below). | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | + | ||
- | {{ : | + | |
+ | {{ .: | ||
=== Owner attribute === | === Owner attribute === | ||
+ | |||
Defines relation owner. Must be an identity in IdM. This field is required for every relation. | Defines relation owner. Must be an identity in IdM. This field is required for every relation. | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | + | ||
- | {{ : | + | |
+ | {{ .: | ||
=== Valid from attribute === | === 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). | + | 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> | <code javascript> | ||
Line 103: | Line 100: | ||
return new LocalDate(attributeValue); | return new LocalDate(attributeValue); | ||
} | } | ||
+ | |||
+ | |||
</ | </ | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | * Paste transformation to " | + | |
- | {{ : | + | {{ .: |
=== Valid till attribute === | === Valid till attribute === | ||
- | Valid till - Validity for the contractual relationship. | + | |
- | This attribute requires LocalDate type. For this we need to transform our data (as show example below). | + | Valid till - Validity for the contractual relationship. This attribute requires LocalDate type. For this we (sometimes, depending on the format of input) |
<code javascript> | <code javascript> | ||
Line 122: | Line 118: | ||
return new LocalDate(attributeValue); | return new LocalDate(attributeValue); | ||
} | } | ||
+ | |||
+ | |||
</ | </ | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | * Paste transformation to " | + | |
- | {{ : | + | {{ .: |
+ | === State attribute === | ||
- | === 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 ' |
- | 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 ' | To resolve the situation described above we created the transformation script ' | ||
- | * Select ' | + | * Select ' |
- | * Tick checkbox ' | + | |
- | * In the ' | + | |
- | * In the ' | + | |
- | {{ : | + | {{ .: |
==== Create sync configuration ==== | ==== Create sync configuration ==== | ||
+ | |||
We have created a system with mapped attributes. Now we need to create synchronization configuration. | We have created a system with mapped attributes. Now we need to create synchronization configuration. | ||
- | * Go to the tab ' | + | |
- | * Tick checkbox ' | + | * Tick checkbox ' |
- | * Tick checkbox ' | + | * Tick checkbox ' |
- | * Fill the name of sync 'Sync contracts' | + | * Fill the name of sync 'Sync contracts' |
- | * In the selectbox 'Set of mapped attributes', | + | * In the selectbox 'Set of mapped attributes', |
- | * In the selectbox 'Collation | + | * In the selectbox 'Correlation |
- | * On the tab ' | + | * On the tab ' |
- | * Save the sync configuration by clicking 'Save and continue' | + | * Save the sync configuration by clicking 'Save and continue' |
- | {{ : | + | {{ .: |
+ | |||
+ | < | ||
+ | |||
+ | eu.bcvsolutions.idm.core.api.exception.CorrelationPropertyUnsupportedTypeException: | ||
+ | |||
+ | Entity type [eu.bcvsolutions.idm.core.model.entity.IdmIdentityContract] and property [identity] has wrong type. Only String or UUID is supported now.</ | ||
==== Start sync ==== | ==== Start sync ==== | ||
+ | |||
<note tip> | <note tip> | ||
- | * On the detail of the sync configuration click on the drop down button and select 'Save and run sync'. | + | * On the detail of the sync configuration click on the drop down button and select 'Save and run sync'. {{ .: |
- | {{ : | + | |
==== Log of sync ==== | ==== Log of sync ==== | ||
+ | |||
After the sync ended (it should not take than a few seconds), you can check result of sync. | After the sync ended (it should not take than a few seconds), you can check result of sync. | ||
- | * Go to the tab ' | + | * Go to the tab ' |
- | * Refresh table with logs (reload button at the top right on the table). | + | |
- | * You should see this: | + | |
- | {{ : | + | |
==== Check contracts on user ' | ==== Check contracts on user ' | ||
+ | |||
Finally, you can check the new contract relations of the user ' | Finally, you can check the new contract relations of the user ' | ||
- | * Find the user ' | + | * Find the user ' |
- | * Go to his detail and to the tab ' | + | |
- | * You should see three contracts: | + | |
- | * **Default** contract (created for this user automatically). | + | |
- | * **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). | + | |
- | {{ : | + | * **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!**</ | <note tip>**If you see the same result, then congratulations on your first successful synchronization of contract relationships!**</ | ||
+ | |||