[midPoint] Issue with simple inbound mapping.

Ivan Noris ivan.noris at evolveum.com
Tue Aug 26 16:51:16 CEST 2014


Hi Deepak,

I've just checked one of my customer objects for 3.0.x

I'm using this:

            <attribute>
                    <ref>ri:P0000_ATTR1</ref>
                    <displayName>Attr1</displayName>
                    <inbound>
                           <source>
                                    <name>ATTRX</name>
                                   
<path>$account/attributes/P0001_ATTRX</path>
                            </source>
                            <source>
                                    <name>ATTRY</name>
                                    <path>$account/attributes/ATTRY</path>
                            </source>
                            <expression>
. . .

But it should also work with "ri:" prefixes, if the "ri" namespace is
defined and correct
(xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
- I define it usually at the resource level).

How are you referencing your "input" implicit variable?
In my expression (Groovy) it is:

if (*input* == '0') return 'FormerEmployee'

Are you perhaps referencing it as "$input" instead of "input"... ?
Also, the source attributes in my sample would be referenced as "ATTRX"
/ "ATTRY" in the Groovy expressions.


Regards,
Ivan


On 08/26/2014 11:35 AM, Deepak Natarajan wrote:
> Hi -
>
> I find some simple inbound mapping behaving inconsistently (I'm
> obviously doing something wrong)
>
> My source feed (CSV) :
>
>                 <icfccsvfile:encoding>utf-8</icfccsvfile:encoding>
>                 <icfccsvfile:valueQualifier>"</icfccsvfile:valueQualifier>
>                 <icfccsvfile:fieldDelimiter>;</icfccsvfile:fieldDelimiter>
>                
> <icfccsvfile:multivalueDelimiter>,</icfccsvfile:multivalueDelimiter>
>                
> <icfccsvfile:usingMultivalue>false</icfccsvfile:usingMultivalue>
>                
> <icfccsvfile:uniqueAttribute>id</icfccsvfile:uniqueAttribute>
>
> "id";"encoded-attributes"
> "foo";"3AARpkJyaXR0YalSYXNtdXN"
>
> and my mappings :
>
>                 <attribute>
>                     <ref>icfs:uid</ref>
>                     <limitations>
>                         <access>
>                             <read>true</read>
>                         </access>
>                     </limitations>
>                 </attribute>
>
>                 <attribute>
>                     <ref>icfs:name</ref>
>                     <inbound>
>                         <c:expression>
>                             <c:script>
>                                 <c:code>
>                                     input + '-suffix'
>                                 </c:code>
>                             </c:script>
>                         </c:expression>
>                         <target>
>                             <path>$user/name</path>
>                         </target>
>                     </inbound>
>                 </attribute>
>
>                 <attribute>
>                     <ref>ri:encoded-attributes</ref>
>                     <inbound>
>                         <source>
>                             <name>encodedAttrs</name>
>                            
> <path>$account/attributes/ri:encoded-attributes</path>
>                         </source>
>                         <source>
>                             <name>id</name>
>                             <path>$account/attributes/ri:id</path>
>                         </source>
>                         ....
>                         ....
>                     </inbound>
>
> Is this incorrect?
>  
> The thing is, I have used this configuration before, without any
> changes, and it used to work. Today it fails (my VCS system shows my
> working version had these mappings)
>
> Caused by:
> com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
> java.lang.NullPointerException expression in mapping in inbound
> expression for
> {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}encoded-attributes
> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS CSV Feeder
> Resource Definition)({.../common/common-3}input=null;
> {.../common/common-3}id=null;
> {.../common/common-3}encodedAttrs=PPV(String:3AARpkJyaXR0YalSYXNtdXN );
> ) in expression in mapping in inbound expression for
> {http://midpoint.evolveum.com/xml/ns/public/resource/instance-3}encoded-attributes
> in resource:036f0100-2fe8-49e1-a8fd-5548374f8703(APOS CSV Feeder
> Resource Definition)
>
> Why is "input" implicit variable and id both null?
>
> Thanks for any help!
>
> -
> Deepak Natarajan
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint

-- 
  Ing. Ivan Noris
  Senior Identity Management Engineer
  evolveum.com
  ___________________________________________
           "Idem per idem - semper idem Vix."

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20140826/60b8f07b/attachment.htm>


More information about the midPoint mailing list