[midPoint] How to create delta for extension properties?

Alcides Carlos de Moraes Neto alcides.neto at gmail.com
Thu May 30 22:08:43 CEST 2019


Hello list,

I need to check and clear some invalid values in our user extension
properties. I have done a bulk action script for this, but I'm failing at
creating the delta. I have tried two approaches, but they both fail with an
IllegalArgumentException
1)
def delta = DeltaBuilder.deltaFor(UserType.class, prismContext)
                        .item("nickName").replace(new PolyString(alias))
                        .item("extension/aliasEmail").delete(alias)
                        .asObjectDelta(input.oid);
midpoint.modifyObject(delta);

2)
def delta = DeltaBuilder.deltaFor(UserType.class, prismContext)
                        .item("nickName").replace(new PolyString(alias))
                        .asObjectDelta(input.oid);
delta.addModification(DeltaBuilder.deltaFor(ExtensionType.class,
prismContext).item("aliasEmail")
                         .delete(alias).asItemDelta());
midpoint.modifyObject(delta);

The exception:

2019-05-30T17:07:23.644 ERROR
[com.evolveum.midpoint.model.common.expression.script.ScriptExpression]
(http-nio-8080-exec-5) Expression error:
java.lang.IllegalArgumentException: Undefined or dynamic path: aliasEmail
in: CTD ({.../common/common-3}ExtensionType) in in 'execute-script' action
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20190530/0febd08e/attachment.htm>


More information about the midPoint mailing list