Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (61 sloc) 2.56 KB
<!--
~ Copyright (c) 2017 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<role oid="3a6ec5dc-49f9-11e8-afe4-6f190d518c16"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/10000000-0000-0000-0000-000000000004"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3">
<name>Transofrm Org Metarole</name>
<inducement>
<focusMappings>
<mapping>
<source>
<path>fullName</path>
</source>
<expression>
<script>
<code>
def transformContainer = immediateRole.asPrismObject().findExtensionItem('transform')
if (transformContainer == null) {
return fullName
}
def output = ''
for (ch in basic.stringify(fullName).split('')) {
for (transformValue in transformContainer.getValues()) {
def patternProperty = transformValue.findItem('pattern')
def pattern = patternProperty.getRealValue()
if (ch.equalsIgnoreCase(pattern)) {
def replacementProperty = transformValue.findItem('replacement')
def replacement = replacementProperty.getRealValue()
log.info(" R: {} -&gt; {}", pattern, replacement)
output = output + replacement + ' '
break;
}
}
}
return output
</code>
</script>
</expression>
<target>
<path>additionalName</path>
</target>
</mapping>
</focusMappings>
<focusType>UserType</focusType>
<order>2</order>
</inducement>
</role>
You can’t perform that action at this time.