[midPoint] Java script in Correlation Filter clause

Arnošt Starosta - AMI Praha a.s. arnost.starosta at ami.cz
Wed Oct 18 11:53:03 CEST 2017


Hi Oleksandr,

the variable bindings should work the same for all expression languages, so
i guess you missed the variable declaration. you can try

<q:equal xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3
">
   <q:path>c:employeeNumber</q:path>
   <expression>
                        <variable>
                            <name>pid</name>
                            <c:path>$shadow/attributes/ri:PID</c:path>
                        </variable>
      <script>
      <code>
      'HRM'+ pid
       </code>
      </script>
   </expression>
</q:equal>

arnost


2017-10-18 11:28 GMT+02:00 Oleksandr Nekriach <o.nekriach at dynatech.lv>:
>
> Hi all,
> A little question. I did not  find of any examples of using java script
in Correlation Filter clause.
> I have try this one (please find below) and another syntax but everything
is wrong.
> I know workaround to store concatenated value data into some focus
attribute then just compare both in  Correlation Filter clause but I want
to find another way. Is it possible to do the same on the fly with script
expression in filter clause?
>
>
> Wrong java script in Correlation Filter clause
>
> <q:equal xmlns:org="
http://midpoint.evolveum.com/xml/ns/public/common/org-3">
>    <q:path>c:employeeNumber</q:path>
>    <expression>
>       <script>
>       <code>
>       'HRM'+$account/attributes/PID
>        </code>
>       </script>
>    </expression>
> </q:equal>
>
> Error
> Caused by:
com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
Couldn't evaluate
expressioncom.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType at 7f6fe5c2
[description=<null>,extension=<null>,trace=<null>,stringFilter=<null>,variable=[],returnMultiplicity=<null>,allowEmptyValues=<null>,queryInterpretationOfNoValue=<null>,runAsRef=<null>,expressionEvaluator=[javax.xml.bind.JAXBElement at 5c1f8636]]:
groovy.lang.MissingPropertyException: No such property: $account for class:
Script16 in (new) Correlation expression
>
> Thank you, in advance.
>
> --
> Best regards,
>
> Oleksandr Nekriach | Identity and access management engineer
>
> Dynatech, Mednieku str. 4a, Riga, LV-1010, Latvia
>
> +37125314685
> ,
> o.nekriach at dynatech.lv
> |
> www.dynatech.lv
>
>
>
>
> Stay connected:
>
>
> Confidentiality Notice: This message contains confidential information
and is intended only for the named recipient(s). If you are not the
addressee you may not copy, distribute or perform any other activities with
this information. If you have received this transmission in error, please
notify us by e-mail immediately. E-mail transmission cannot be guaranteed
to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or contain viruses.
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> http://lists.evolveum.com/mailman/listinfo/midpoint
>



--

Arnošt Starosta
solution architect

gsm: [+420] 603 794 932
e-mail: arnost.starosta at ami.cz



AMI Praha a.s.
Pláničkova 11
162 00 Praha 6
tel.: [+420] 274 783 239
web: www.ami.cz





Textem tohoto e-mailu podepisující neslibuje uzavřít ani neuzavírá za
společnost AMI Praha a.s.
jakoukoliv smlouvu. Každá smlouva, pokud bude uzavřena, musí mít výhradně
písemnou formu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20171018/68363534/attachment.htm>


More information about the midPoint mailing list