Skip to content

Commit

Permalink
Merge pull request #11 from lsc-project/10-pivot-transformation
Browse files Browse the repository at this point in the history
Add pivot transformation documentation
  • Loading branch information
coudot authored Sep 18, 2024
2 parents a3968cb + a937669 commit d70e423
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions source/syncrules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ You can describe synchronization options through the corresponding task subnode
<.../>
<propertiesBasedSyncOptions>
<mainIdentifier>...</mainIdentifier>
<pivotTransformation>...</pivotTransformation>
<defaultDelimiter>...</defaultDelimiter>
<defaultPolicy>...</defaultPolicy>
<conditions>...</conditions>
Expand All @@ -29,6 +30,7 @@ You can describe synchronization options through the corresponding task subnode
You may include various information there:

* main identifier
* pivot transformation
* default delimiter
* default policy
* conditions
Expand Down Expand Up @@ -69,6 +71,27 @@ If you have an "update only" task, and the DN cannot be inferred from the source
dstBean.getMainIdentifier()
</mainIdentifier>
Pivot transformation (lsc>tasks>task>propertiesBasedSyncOptions>pivotTransformation)
------------------------------------------------------------------------------------

This section is optional, and needed only if the value of source pivot attribute need to be adapted to match the value of destination pivot attribute.

For example, to remove a part of the string between source and destination:

.. code-block:: XML
<pivotTransformation>
<transformation fromAttribute="uid" toAttribute="name"><![CDATA[
var result = value.replace(/^prefix:/, "");
result;
]]></transformation>
<transformation fromAttribute="name" toAttribute="uid"><![CDATA[
var result = "prefix:" + value;
result;
]]></transformation>
</pivotTransformation>
Default delimiter (lsc>tasks>task>propertiesBasedSyncOptions>defaultDelimiter)
------------------------------------------------------------------------------

Expand Down

0 comments on commit d70e423

Please sign in to comment.