You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@syncope.apache.org by "Farrell, Stephen R." <St...@leidos.com> on 2019/11/25 23:05:32 UTC
ItemTransformer and PullAction questions
Hello,
I have a use case where I am getting attributes from my trusted source but need to create a new attribute based on a lookup table. This lookup table takes the values of 2 existing attributes to find the value of the newly created attribute. I have accomplished the use case partially with a Pull Action implementation but it only works for user creation, not updating. When one of the source attributes change the value of the new attribute should also change but I cannot trigger such a change with my current Pull Action implementation and am asking for some advice. I tried to create the same logic as an ItemTransformer but I cannot seem to access the values of other attributes in the beforePropogation method.
Thanks,
Stephen
Re: ItemTransformer and PullAction questions
Posted by Andrea Patricelli <an...@tirasa.net>.
Hi Stephen,
the ItemTransformer works only on the value of the attribute which it is
mapped to, so, on my opinion, it isn't the right choice for you use case.
You should work in your PullActions implementation, especially
implementing beforeUpdate [1] method in order to update the value of the
generated attribute.
Alternatively you could consider defining the generated attribute as
derived [2] and so let Syncope create its value for you based on JEXL
expressions that takes the values of the two plain attributes (source).
[1]
https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/TestPullActions.java#L71-L94
[2] https://syncope.apache.org/docs/2.1/reference-guide.html#derived
Il 26/11/19 00:05, Farrell, Stephen R. ha scritto:
>
> Hello,
>
> I have a use case where I am getting attributes from my trusted source
> but need to create a new attribute based on a lookup table. This
> lookup table takes the values of 2 existing attributes to find the
> value of the newly created attribute. I have accomplished the use case
> partially with a Pull Action implementation but it only works for user
> creation, not updating. When one of the source attributes change the
> value of the new attribute should also change but I cannot trigger
> such a change with my current Pull Action implementation and am asking
> for some advice. I tried to create the same logic as an
> ItemTransformer but I cannot seem to access the values of other
> attributes in the beforePropogation method.
>
> Thanks,
>
> Stephen
>
--
Dott. Andrea Patricelli
Tel. +39 3204524292
Engineer @ Tirasa S.r.l.
Viale Vittoria Colonna 97 - 65127 Pescara
Tel +39 0859116307 / FAX +39 0859111173
http://www.tirasa.net
Apache Syncope PMC Member