You are viewing the documentation for an outdated or unreleased devel version.
This page is also available in versions: 7.4, 7.5, 7.6, 7.7, 7.8, 8.0, 8.1, 9.0, 9.1, 9.2, 9.3, 9.4, 9.5, 9.7 (current), devel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
devel:adm:transformation_scripts [2017/10/21 21:34]
poulm links
devel:adm:transformation_scripts [2017/11/06 19:22] (current)
poulm moved to documentation
Line 1: Line 1:
 <-  .:​provisioning | Provisioning ^ .:start | Administrator'​s guide ^ .:​password_policy | Password policies -> <-  .:​provisioning | Provisioning ^ .:start | Administrator'​s guide ^ .:​password_policy | Password policies ->
 +
 +<note important>​Moved to [[devel:​documentation:​start|Documentation]]</​note>​
  
 ====== Transformation scrips ====== ====== Transformation scrips ======
-Provided you connected a managed system or source system to CzechIdM, you prepared synchronization or provisioning for with e.g. identity attribute mappings. Then you may have several attributes that differs in format between the source and the managed system. For example you want to fill Active Directory'​s attribute //​diplayName//​ that is of format <​firstName + LastName>​. For scripts, we currently use Groovy language. 
- 
-===== displayName example ===== 
-From the HR system to CzechIdM you provide **firstName** and **lastName** as separate attributes as is common. Now you want to make a transformation script to fill **displayName** from 2 other attributes. 
-  - First of all, you must have the attribute displayName defined in provisioning mapping. In the detail of the attribute mapping you do not fill the **IdM Key**, since the transformation from multiple attributes will be used instead 
-  - At the bottom of the detail page, you can see two boxes where you can write your transformation scripts. First box servers as a transformation **from the system** i.e. transform attribute value form the connected system to CzechIdM. That is not our case now, we want only provisioning transformation. The second box serves as a transformation from CzechIdM **to connected system**. There we will place to you script. 
- 
-{{ :​devel:​adm:​transformation_scripts.png?​600 |}} 
- 
-To fill the attribute from 2 entity (identity in our case) attributes, just simply use this piece of code: 
- 
-<​code>​ 
-entity.firstName + " " + entity.lastName 
-</​code>​ 
- 
-Thus you can define basic transformation scripts that does not need any additional privilege to run. 
- 
-===== The scripts definition library ===== 
-There is other convenient way of how to use transformation scripts. You can define your script in CzechIdM via menu **Settings -> Script definition**. There you can see the list of all available scripts (not only transformation ones). If you click on **Add** button, you can add your own script definition to the CzechIdM script library. 
- 
-==== Add a script to the library ==== 
-If you click on **Add** button, you can add your own script definition to the CzechIdM script library. 
- 
-{{ :​devel:​adm:​script_definition_detail.png?​600 |}} 
- 
-Fill the following fields: 
-  * Code - the name of the script usually used when calling from other scripts 
-  * Name - the name visible in lists in GUI 
-  * Category - You can choose form selectbox the category by intended use. The category has both informative and restrictive character. If you select the category of the script as "​Transformation to", it will be available as a choice in the attribute mapping detail form in the //​Transformation to// box. 
-  * Script description - optional - visible on some forms 
-  * Script - the definition of the script itself 
-  * Script authorities - see the section below 
- 
-=== Script authorities === 
-In this table, you specify, what authorizations on data you give to the script. There are some basic rules, that every script has by default - e.g. get attributes and their values from entity. Other rules must be added if you want to access e.g. other entities like Roles or Organizations from the script that is used in Identities synchronization. 
-Other common usecase is that you want to use some non basic java Classes or Methods. Again, you have to give your script specific authorization to use the Class. 
- 
-{{ :​devel:​adm:​script_authorizations.png?​600 |}} 
- 
-==== A library script use ==== 
- 
-The script is then available in synchronization and provisioning mapping in attribute detail. ​ 
- 
-{{ :​devel:​adm:​transformation_scripts.png?​600 |}} 
- 
-To use it, click on the green button **insert script** in the right upper corner of transformation box. 
- 
-{{ :​devel:​adm:​insert_script_button.png?​ |}} 
- 
-Then you can see new window, where you can list available scripts 
-{{ :​devel:​adm:​select_script_to_insert.png?​600 |}} 
- 
-When you select the desired one, click on Select button. The script is then referred/​called trom the attribute mapping transformation box in the right format 
- 
-{{ :​devel:​adm:​inserted_script.png?​600 |}} 
- 
-==== Script as a file ==== 
- 
-In fact, all default scripts that are available in GUI after CzechIdM installation,​ were loaded into application during its previous start. They meet XML format and file incorporates the script body (groovy), script privileges and its purpose. So if you want to track changes on your scripts e.g. with git, this is the best way.