Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
devel:documentation:synchronization:dev:contract-slice-sync [2018/05/15 08:42] svandav created |
devel:documentation:synchronization:dev:contract-slice-sync [2019/12/11 12:57] svandav [HR processes proper] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Synchronization - time slices of contractual relationship ====== | ||
+ | {{tag> sync contract slice}} | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | < | ||
+ | |||
+ | ===== What is the time slice of contractual relationship ===== | ||
+ | |||
+ | Typically one contractual relationship is equal to one contract in company for the identity. One slice of the contractual relationship describes what the contract looked like in a specific time slot, i. e., it is a snapshot of the contract at a given time. Sync of slices persists slices to the entity `IdmContractSlice` and creates relation to the account with entity `AccContractSliceAccount`. If more slices exist for the same contract, then only one is being used as source at one time (the latest). See [[devel: | ||
+ | |||
+ | From these slices (specifically the latest one), a contract is built. This contract is managed only by time slices and cannot be modified directly. | ||
+ | |||
+ | ===== Actions after end of sync ===== | ||
+ | |||
+ | After the synchronization, | ||
+ | |||
+ | < | ||
+ | |||
+ | ==== Running HR processes manually ==== | ||
+ | |||
+ | As mentioned above, sometimes, you need to run HR processes manually. Each HR process is a long-running task a can be run from Settings > Task scheduler > Scheduled task. There you can run the desired LRT by simply clicking the green arrow button. | ||
+ | |||
+ | You should run HR processes in this order: | ||
+ | - `ClearDirtyStateForContractSliceTaskExecutor` | ||
+ | - `SelectCurrentContractSliceTaskExecutor` | ||
+ | - `HrEnableContractProcess` | ||
+ | - `HrEndContractProcess` | ||
+ | - `HrContractExclusionProcess` | ||
+ | |||
+ | For more details about some of them, see below. | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | So, in a situation where you ran the synchronization and either cancelled it manually before it finished and the HR processes ran or just decided to sync your contracts again (perhaps the data changed), **before you run the synchronization a second time, you must run the `ClearDirtyStateForContractSliceTaskExecutor`**. You can ignore the rest of HR processes for now but you absolutely must run `ClearDirtyStateForContractSliceTaskExecutor`.</ | ||
+ | |||
+ | ==== Clear dirty state for contract slice ==== | ||
+ | |||
+ | This LRT deletes those slices which have the flag " | ||
+ | |||
+ | ==== Select current contract slice ==== | ||
+ | |||
+ | Before HR processes proper are executed, this long running task selects the current contract slices. The LRT is started synchronously and complete log will contain information about its run. | ||
+ | |||
+ | ==== HR processes proper ==== | ||
+ | |||
+ | <note important> | ||
+ | |||
+ | [[devel: | ||
+ | |||
+ | There are three HR processes: HrEnableContractProcess, | ||
+ | |||
+ | HR processes can be (**should be**) correctly started after the end of the sync. This can be ensured ticking the checkbox `After end, start the HR processes` in the Specific settings of synchronizationon in sync configuration. If is this property ticked, then all HR processes including ClearDirtyStateForContractSliceTaskExecutor and SelectCurrentContractSliceTaskExecutor will be run once the synchronization finishes. | ||
+ | |||
+ | ==== Automatic roles ==== | ||
+ | |||
+ | Recalculation of automatic roles is skipped during sync but it can be (**should be**) started after the end of the sync. This can be ensured by the property ' | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ===== Fields for sync contractual relationship mapping ===== | ||
+ | * **Contract code** - Code of the parent contract. This `String` value represents relation between all slices for the same contract. | ||
+ | * **Valid from of slice** - Defines time from which the slice is valid. Valid till of slice is computed automatically (by the validity of the next slice) after save. Output value from attribute transformation must be ' | ||
+ | * **Owner** - Relation' | ||
+ | * ID of IdM identity in String or UUID format. | ||
+ | * Username of IdM identity in String. | ||
+ | * **Main** - Defines if the contract is the main contract (among all contracts for the identity). Output from attribute transformation must be Boolean. | ||
+ | * **State** - State of contract. Output from attribute transformation must be enumeration ContractState or String representation for this enumeration (DISABLED, EXCLUDED) (see below for more details). | ||
+ | * **Position** - String representation of contract. Typically name of contract. | ||
+ | * **Guarantees** - List of leaders, directly linked on the contractual relationship (see below for more details). | ||
+ | * **Work position** - Defines link to some tree node. Generally defines a place in the organization structure (see below for more details). | ||
+ | * **Valid from of contract** - Validity for the contractual relationship. Output value from attribute transformation must be ' | ||
+ | * **Valid till of contract** - Validity for the contractual relationship. Output value from attribute transformation must be ' | ||
+ | * **External contractor** - If the contractual relationship is for external identity, then the output value is boolean true. | ||
+ | * **Description** - String for the description of the relation. | ||
+ | |||
+ | |||
+ | ==== Guarantees field ==== | ||
+ | List of leaders, directly linked to the contractual relation. Linked leader must exists in IdM. | ||
+ | Output from attribute transformation can be: | ||
+ | * Username of leader (String). | ||
+ | * Id of leader (UUID or String). | ||
+ | * List of usernames (List< | ||
+ | * List of Ids (List< | ||
+ | * Null value. If is value not defined and in sync configuration has set ' | ||
+ | |||
+ | If no leader is found, the synchronization item will be marked as ' | ||
+ | |||
+ | < | ||
+ | ......................... | ||
+ | Finding guarantee [temslie7]. | ||
+ | ......................... | ||
+ | Warning! - Identity [temslie7] was not found for [temslie7]! | ||
+ | ......................... | ||
+ | </ | ||
+ | |||
+ | ==== Work position field ==== | ||
+ | Defines link to some tree node. Generally defines a place in the organization structure. | ||
+ | Output from attribute transformation can be: | ||
+ | * Id of a tree node (UUID or String). | ||
+ | * Code of a tree node. Node by code will be looked up in default tree (defined in sync configuration ' | ||
+ | * Null value. If no value is defined and the sync configuration has set ' | ||
+ | |||
+ | If no node is found the synchronization item will be marked as ' | ||
+ | |||
+ | < | ||
+ | ........................ | ||
+ | Work position - try find directly by transformed value [Divanoodle]! | ||
+ | ........................ | ||
+ | Work position - was not not found directly from transformed value [Divanoodle]! | ||
+ | ........................ | ||
+ | Work position - try find in default tree type [DEFAULT_ORG] with code [Divanoodle]! | ||
+ | ........................ | ||
+ | Warning - Work position - none node found for code [Divanoodle]! | ||
+ | </ | ||
+ | <note important> | ||
+ | If no work-position attribute is defined in the mapping, then **no** default position will be set.</ | ||
+ | |||
+ | ==== State field ==== | ||
+ | State of contract. Output from attribute transformation must be enumeration ContractState or String representation for this enumeration. | ||
+ | |||
+ | ContractState has these values: | ||
+ | * **[[..: | ||
+ | * **[[..: | ||