Hi Francesco and all,

Quick update on my question/issue: it seems that in the very same situation, 
updating a "plainAttr" (instead of deleting a relationship) is working fine.

Thanks for any help

Regards
Lionel

----- Le 27 Jan 26, à 15:03, Lionel SCHWARZ [email protected] a écrit :

> Hi Francesco and all,
> 
> Following your advice, I used the UserProvisioningManager to update the user
> from within a SchedTask.
> Here is the very simplified view of the code I run:
> 
> for (Any<?> any: anySearchDAO.search(...) { // do the stuff on a list of users
>   User = (User)any;
>   UserUR patch = new UserUR.Builder(user.getKey()).build();
>   // remove a relationship that is mapped as follows in the resource
>   // {
>   //  "intAttrName" :
>   "relationships[RELATION_USER_COLLABORATION][COLLABORATION].name",
>   //  "extAttrName" : "__GROUPS__",
>   //  "purpose" : "PROPAGATION"
>   // }
>   RelationshipTO attachment = new
>   RelationshipTO.Builder("RELATION_USER_COLLABORATION").build();
>   attachment.setOtherEndKey(KEY);
>   attachment.setOtherEndName("c1");
>   attachment.setOtherEndType(GiinConstants."COLLABORATION");
>   patch.getRelationships().add(
>        new 
> RelationshipUR.Builder(attachment).operation(PatchOperation.DELETE).build()
>   );
>   Pair<UserUR, List<PropagationStatus>> result =
>   userProvisioningManager.update(patch, false, AuthContextUtils.getUsername(),
>   "myProcess");
> 
> }
> 
> This code is working fine, the user (who had initially 2 relationships to "c1"
> and "c2") is properly propagated. The core-connid log gives: (why 2 lines?):
> 
> instance='jsonfile' Enter: update(ObjectClass: COMPUTINGACCOUNT, Attribute:
> {Name=__UID__, Value=[1425]}, [Attribute: {Name=__GROUPS__, Value=[c2]}, ...],
> null) Method: update
> instance='jsonfile' Enter: update(ObjectClass: COMPUTINGACCOUNT, Attribute:
> {Name=__UID__, Value=[1425]}, [Attribute: {Name=__GROUPS__, Value=[c2]}, ...],
> OperationOptions: {}) Method: update
> 
> 
> 
> Now the weird part of my question:
> I read user's current relationships before updating as follows:
> 
> for (Any<?> any: anySearchDAO.search(...) { // do the stuff on a list of users
>   User = (User)any;
>   user.getRelationships();
>   UserUR patch = new UserUR.Builder(user.getKey()).build();
>   ...
> }
> 
> In this case, on the same user data, the USER update is fine, but the
> propagation does not send correct values:
> instance='jsonfile' Enter: update(ObjectClass: COMPUTINGACCOUNT, Attribute:
> {Name=__UID__, Value=[1425]}, [Attribute: {Name=__GROUPS__, Value=[c1, c2]},
> ...], null)   Method: update
> instance='jsonfile' Enter: update(ObjectClass: COMPUTINGACCOUNT, Attribute:
> {Name=__UID__, Value=[1425]}, [Attribute: {Name=__GROUPS__, Value=[c1, c2]},
> ...], OperationOptions: {})   Method: update
> 
> Are you able to reproduce this? Do you have any idea what could happen in the
> core to give this behavior?
> 
> Best regards
> Lionel
> 
> ----- Le 9 Jan 26, à 10:10, Lionel SCHWARZ [email protected] a écrit :

Reply via email to