On 14/08/19 15:59, Noah Hansen . wrote:
Hello again,
Below is the item transformer we have written. It is a groovy based
item transformer but we aren't seeing anything change with the values
we pull from a csv connector. Does this and any other itemTransformer
implementation we create get called automatically everytime we
pull/push from a connector?
Not automatically; you'll have to associate as many ItemTransformer(s)
implementations as you want to be applied, for each mapping item.
See: https://pasteboard.co/ItnpLZv.png
HTH
Regards.
Is there an associated log we should be checking to see this code
being stepped through? We set the org.apache.syncope.core.provisioning
log level to debug and are tailing the core-connid log without having
much success.
Item transformer:
@OverrideList<Object> beforePull( Item item, EntityTO entityTO,
List<Object> values) { List<Object> newValues =
newArrayList<>(values); newValues.get(0).setStringValue("test"+
values.get(0).getStringValue()); returnnewValues; }
thanks again
On Wed, Aug 14, 2019 at 1:52 AM Francesco Chicchiriccò
<[email protected] <mailto:[email protected]>> wrote:
On 12/08/19 17:54, Noah Hansen . wrote:
> Hi all,
>
> I have written a simple groovy item transformer and I can't seem
to be
> able to tell if it's working or not? I have only changed what is
under
> the beforePull method. When I run my pull task it doesn't seem
to be
> changing anything.
>
> Any suggestions?
Hi,
you can see a sample ItemTransformer in Groovy at [1]. Such class is
used for integration tests, thus the logic implemented by
beforePull()
is simply to add a prefix to values coming from External Resource
before
they reach Syncope for actual pull.
FYI, an example ItemTransformer in Java is [2], still used for
integration tests; here the logic is to convert Date values into Long
before sending to External Resource.
HTH
Regards.
[1]
https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/test/resources/PrefixItemTransformer.groovy
[2]
https://github.com/apache/syncope/blob/2_1_X/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/DateToLongItemTransformer.java
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Member at The Apache Software Foundation
Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
http://home.apache.org/~ilgrosso/