[midPoint] assignmentTargetSearch "null polystring orig" error

Devin Rosenbauer devin at identityworksllc.com
Mon Dec 7 17:31:14 CET 2015


Perfect! That appears to work!

I found it in various places:

The expression explained here simply doesn't work in 3.3. I had to modify
quite a few things:
https://wiki.evolveum.com/display/midPoint/Expression#Expression-AssignmentTargetSearch

The search filter layout I used was here:
https://wiki.evolveum.com/display/midPoint/XML+Object+Query

After reading those pages, I misread the sample at /samples/demo-generic
synchronization/object-template-user.xml and missed that there was indeed
no <q:value> tag in the sample. I had also poked around through the schema
and observed that <value> was an allowed field at that location, so I
figured that couldn't have been the problem.

Thanks!




On Mon, Dec 7, 2015 at 11:20 AM, Radovan Semancik <
radovan.semancik at evolveum.com> wrote:

> Hi,
>
> I have extended our object template tests to make sure that this case
> works. And it really works. After extending the tests I have found the
> error in your definition.
>
> Instead of
>
>                <q:equal>
>                   <q:path>c:name</q:path>
>                   <q:value>
>                      <expression>
>                         <path>$givenName</path>
>                      </expression>
>                   </q:value>
>                </q:equal>
>
> use
>
>                <q:equal>
>                   <q:path>c:name</q:path>
>                   <expression>
>                       <path>$givenName</path>
>                   </expression>
>                </q:equal>
>
>
> i.e. remove the <q:value> element. In your case midPoint interpreted the
> whole <expression>...</expression> as a literal value which caused strange
> things to happen ...
>
> BTW, could you point me to the documentation that you have used to create
> your code, please? It perhaps needs an update.
>
> --
> Radovan Semancik
> Software Architectevolveum.com
>
>
>
> On 12/07/2015 04:05 PM, Devin Rosenbauer wrote:
>
> In this case, I'm actually not making any changes to the input object.
> Given Name is already set to the value that shows up in the error message
> ("Devin"), and I'm just hitting Save with the Reconcile checkbox checked.
>
> However, this also happens if I change the name to something else. In both
> cases, it's not null.
>
> On Mon, Dec 7, 2015 at 10:02 AM, Radovan Semancik <
> <radovan.semancik at evolveum.com>radovan.semancik at evolveum.com> wrote:
>
>> Hi,
>>
>> I have similar mapping working in our story tests.
>>
>> How does your input object looks like? I mean, how does the user looks
>> like before it is processed by the template?
>> Is there any chance that the givenName is null?
>>
>> The evaluation of null expressions has changed a bit in 3.3. But I think
>> that your expression should work and you are probably hitting a but. I will
>> need more data to replicate it.
>>
>> --
>> Radovan Semancik
>> Software Architectevolveum.com
>>
>>
>>
>> On 12/04/2015 05:15 PM, Devin Rosenbauer wrote:
>>
>> Can anybody else please try this mapping on their end and see if it works?
>>
>> On Tue, Dec 1, 2015 at 1:51 PM, Devin Rosenbauer <
>> <devin at identityworksllc.com>devin at identityworksllc.com> wrote:
>>
>>> Version is 3.3.
>>>
>>> I've got the following in my user template, based on a somewhat modified
>>> version of what's in the documentation online:
>>>
>>>   <mapping>
>>>       <source>
>>>          <c:path>$user/givenName</c:path>
>>>       </source>
>>>       <expression>
>>>          <assignmentTargetSearch>
>>>             <targetType>c:OrgType</targetType>
>>>             <filter>
>>>                <q:equal>
>>>                   <q:path>c:name</q:path>
>>>                   <q:value>
>>>                      <expression>
>>>                         <path>$givenName</path>
>>>                      </expression>
>>>                   </q:value>
>>>                </q:equal>
>>>             </filter>
>>>             <createOnDemand>true</createOnDemand>
>>>             <populateObject>
>>>                <populateItem>
>>>                   <expression>
>>>                      <c:path>$givenName</c:path>
>>>                   </expression>
>>>                   <target>
>>>                      <c:path>name</c:path>
>>>                   </target>
>>>                </populateItem>
>>>             </populateObject>
>>>          </assignmentTargetSearch>
>>>       </expression>
>>>       <target>
>>>          <c:path>assignment</c:path>
>>>       </target>
>>>    </mapping>
>>>
>>> I expect that this would create an Org called "Devin" and assign the
>>> user to it.
>>>
>>> Here's what I get as an error message when I attempt to save and
>>> reconcile the user:
>>>
>>>    - Failed to convert query. Reason: Null polystring orig in
>>>    XNode(map:1 entries)(givenName=PPV(PolyString:Devin); ) in expression in
>>>    mapping in objectTemplate:c0c010c0-d34d-b33f-f00d-777222222334(User
>>>    Template 2)
>>>    - operation.com.evolveum.midpoint.web.page.admin.PageAdminFocus.save
>>>       - *Cause:*
>>>
>>>       Failed to convert query. Reason: Null polystring orig in
>>>       XNode(map:1 entries)(givenName=PPV(PolyString:Devin); ) in expression in
>>>       mapping in objectTemplate:c0c010c0-d34d-b33f-f00d-777222222334(User
>>>       Template 2)
>>>
>>> The documentation on the Expressions page and the samples appear to be
>>> somewhat incorrect here. I've had to make some corrections from <query> to
>>> <filter>, adding a <source>, and so forth. I also am temporarily using an
>>> OOTB field instead of a custom field to ensure that it's a PolyString and
>>> not an xsd:string, just to make sure that wasn't the issue.
>>>
>>> At this point, it seems pretty clear that it is grabbing the value in
>>> the XNodeMap, since it's printed in the error message.
>>>
>>> So, how should this mapping be structured to do what I need to do?
>>>
>>> --
>>> Devin Rosenbauer
>>> Principal Consultant
>>> Identity Works LLC
>>> +1 585 210 3201 <%2B1%20585%20210%203201>
>>>
>>
>>
>>
>> --
>> Devin Rosenbauer
>> Principal Consultant
>> Identity Works LLC
>> +1 585 210 3201 <%2B1%20585%20210%203201>
>>
>>
>> _______________________________________________
>> midPoint mailing listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>>
>>
>>
>>
>> _______________________________________________
>> midPoint mailing list
>> midPoint at lists.evolveum.com
>> http://lists.evolveum.com/mailman/listinfo/midpoint
>>
>>
>
>
> --
> Devin Rosenbauer
> Principal Consultant
> Identity Works LLC
> +1 585 210 3201
>
>
> _______________________________________________
> midPoint mailing listmidPoint at lists.evolveum.comhttp://lists.evolveum.com/mailman/listinfo/midpoint
>
>
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>
>


-- 
Devin Rosenbauer
Principal Consultant
Identity Works LLC
+1 585 210 3201
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20151207/d40b49c2/attachment.htm>


More information about the midPoint mailing list