<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Yeah, the namespace...<br>
<br>
It needs to be the namespace of the resource attributes. That's the
same as in schema handling (by default named "ri").<br>
<br>
basic.getAttributeValue(shadow,
'<a class="moz-txt-link-freetext" href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>',
'level_')<br>
<br>
But according to the production object I'm just looking at, it
should even work:<br>
<br>
<b>basic.getAttributeValue(shadow, 'level_')</b><br>
<div class="moz-cite-prefix"><br>
This defaults to "ri" namespace.<br>
<br>
For example in one of our deployments, in one of our sync
configurations, we have condition with:<br>
<br>
<code><br>
sam = basic.getAttributeValue(shadow, 'samAccountName')<br>
. . .<br>
(and then we process "sam" variable...)<br>
</code><br>
<br>
Sorry, I didn't check the namespace in the original mail.<br>
<br>
Regards,<br>
Ivan<br>
<br>
On 12/05/2014 10:46 PM, Jason Everling wrote:<br>
</div>
<blockquote
cite="mid:CAFkZXY6tMc6rHMohCRCvVNVjVs5mGXDj9mroEa7KFyx-8Rn14w@mail.gmail.com"
type="cite">
<div dir="ltr">It is still the same, I even tried other ways
pulling ideas from github,
<div><br>
</div>
<div>I tried adding the single quotes, midpoint sees the shadow
user under shadow details but does not create the accounts. If
I remove the condition then the accounts get created. Somehow
it is not liking the condition,</div>
<div><br>
</div>
<div>
<div><span class="" style="white-space:pre"> </span><code></div>
<div><span class="" style="white-space:pre"> </span>tmp =
basic.getAttributeValue(shadow, '<a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_');</div>
<div><span class="" style="white-space:pre"> </span>return
(tmp == '2' || tmp == '3' || tmp == '4' || tmp == '5' || tmp
== 'A' || tmp == 'B' || tmp == 'C' || tmp == 'H')</div>
<div><span class="" style="white-space:pre"> </span></code></div>
</div>
<div><br>
</div>
<div>Is the shadow part and namespace correct? this is a DBTable
Resource and the column name is level_ and it is a single
value. Does this attribute need to have a mapping? I am
currently not mapping the value in midpoint, really wouldn't
know what to map it to.</div>
<div><br>
</div>
<div>basic.getAttributeValue(shadow, '<a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_') <br>
</div>
<div><br>
</div>
<div>Here is the full sync object</div>
<div><br>
</div>
<div> <span style="white-space:pre"><synchronization>
<objectSynchronization>
<enabled>true</enabled> <condition>
<script> <code> tmp =
basic.getAttributeValue(shadow, '<a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_'); return (tmp == '2' || tmp == '3' || tmp == '4' ||
tmp == '5' || tmp == 'A' || tmp == 'B' || tmp == 'C' || tmp
== 'H') </code> </script> </condition>
<correlation> <q:equal>
<q:path>c:employeeNumber</q:path>
<expression> <path> declare namespace icfs="<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>";
$account/attributes/icfs:name </path>
</expression> </q:equal> </correlation>
<reaction> <situation>linked</situation>
<action ref="<a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyUser">http://midpoint.evolveum.com/xml/ns/public/model/action-3#modifyUser</a>"/>
</reaction> <reaction>
<situation>deleted</situation> <action ref="<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactivateFocus">http://midpoint.evolveum.com/xml/ns/public/model/action-3#inactivateFocus</a>"/>
</reaction> <reaction>
<situation>unlinked</situation> <action ref="<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount">http://midpoint.evolveum.com/xml/ns/public/model/action-3#linkAccount</a>"/>
</reaction> <reaction>
<situation>unmatched</situation>
<objectTemplateRef
oid="10000000-0000-0000-0000-000000000203"/> <action
ref="<a moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/model/action-3#addUser">http://midpoint.evolveum.com/xml/ns/public/model/action-3#addUser</a>"/>
</reaction> </objectSynchronization>
</synchronization></span><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 5, 2014 at 3:20 PM, Ivan
Noris <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:ivan.noris@evolveum.com" target="_blank">ivan.noris@evolveum.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> So if it's string,
try to use single quotes.<br>
<br>
... tmp == '2' || ... <br>
<div>
<div class="h5"> <br>
<br>
<div>On 12/05/2014 07:02 PM, Jason Everling wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">It was because the A, B, C, H didnt
exist in the database, when I removed those levels
it doesn't error but it also does not create
accounts for the ones that have a matching level
like 2 or 3
<div><br>
</div>
<div>JASON</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 5, 2014 at
11:46 AM, Jason Everling <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:jeverling@bshp.edu"
target="_blank">jeverling@bshp.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0
0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div dir="ltr">I was trying something like
that but didnt get anywhere,
<div><br>
</div>
<div>I have,</div>
<div><br>
</div>
<div>
<div><span style="white-space:pre-wrap"> </span><condition></div>
<div><span style="white-space:pre-wrap"> </span><script></div>
<span>
<div><span style="white-space:pre-wrap">
</span><code></div>
<div><span style="white-space:pre-wrap">
</span>tmp =
basic.getAttributeValue(shadow, '<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
target="_blank">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_');</div>
</span>
<div><span style="white-space:pre-wrap"> </span>return
(tmp == 2 || tmp == 3 || tmp == 4 || tmp
== 5 || tmp == A || tmp == B || tmp == C
|| tmp == H)</div>
<div><span style="white-space:pre-wrap"> </span></code></div>
<div><span style="white-space:pre-wrap"> </span></script></div>
<div><span style="white-space:pre-wrap"> </span></condition></div>
</div>
<div><br>
</div>
<div>And get error,</div>
<div><br>
</div>
<div>
<div>ERROR
(com.evolveum.midpoint.model.common.expression.Expression):
Error evaluating expression in condition
in object synchronization null:
groovy.lang.MissingPropertyException: No
such property: A for class: Script42
(new) condition in object
synchronization null</div>
<div>com.evolveum.midpoint.util.exception.ExpressionEvaluationException:
groovy.lang.MissingPropertyException: No
such property: A for class: Script42
(new) condition in object
synchronization null</div>
</div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Dec 5,
2014 at 11:19 AM, Ivan Noris <span
dir="ltr"><<a
moz-do-not-send="true"
href="mailto:ivan.noris@evolveum.com"
target="_blank">ivan.noris@evolveum.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0 0 0
.8ex;border-left:1px #ccc
solid;padding-left:1ex">
<div bgcolor="#FFFFFF"
text="#000000"> Hi Jason,<br>
<br>
I would do this:<br>
<br>
. . .<br>
<code><br>
tmp =
basic.getAttributeValue(shadow, '<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
target="_blank">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_');<br>
<br>
return (tmp == 2 || tmp == 3 ||
tmp == 4 | ...)<br>
</code><br>
. . .<br>
<br>
Regards,<br>
I.
<div>
<div><br>
<br>
<div>On 12/05/2014 04:12 PM,
Jason Everling wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">I was trying
to add a condition to the
synchronization element,
<div><br>
</div>
<div>Here is what I got,
there is a column in the
table level_ , I only
want to sync users that
have those specific
values</div>
<div><br>
</div>
<div>
<div><span
style="white-space:pre-wrap">
</span><condition></div>
<div><span
style="white-space:pre-wrap">
</span><script></div>
<div><span
style="white-space:pre-wrap">
</span><code></div>
<div><span
style="white-space:pre-wrap">
</span>basic.getAttributeValue(shadow,
'<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
target="_blank">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>',
'level_') = (2 || 3 ||
4 || 5 || A || B || C
|| H)</div>
<div><span
style="white-space:pre-wrap">
</span></code></div>
<div><span
style="white-space:pre-wrap">
</span></script></div>
<div><span
style="white-space:pre-wrap">
</span></condition></div>
</div>
<div><br>
</div>
<div>When it runs I get
the following</div>
<div><br>
</div>
<div>
<div>1 error</div>
<div> (new) condition in
object synchronization
null</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.createCompiledScript(Jsr223ScriptEvaluator.java:176)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.script.jsr223.Jsr223ScriptEvaluator.evaluate(Jsr223ScriptEvaluator.java:117)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:110)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.script.ScriptExpressionEvaluator.transformSingleValue(ScriptExpressionEvaluator.java:58)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluateScriptExpression(AbstractValueTransformationExpressionEvaluator.java:276)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluateAbsoluteExpression(AbstractValueTransformationExpressionEvaluator.java:206)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.evaluator.AbstractValueTransformationExpressionEvaluator.evaluate(AbstractValueTransformationExpressionEvaluator.java:107)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.Expression.evaluate(Expression.java:136)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.ExpressionUtil.evaluateExpression(ExpressionUtil.java:500)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.common.expression.ExpressionUtil.evaluateCondition(ExpressionUtil.java:523)
~[model-common-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.impl.sync.SynchronizationService.isPolicyApplicable(SynchronizationService.java:383)
~[model-impl-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.impl.sync.SynchronizationService.determineSynchronizationPolicy(SynchronizationService.java:343)
~[model-impl-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>at
com.evolveum.midpoint.model.impl.sync.SynchronizationService.notifyChange_aroundBody0(SynchronizationService.java:205)
~[model-impl-3.0.1.jar:na]</div>
<div><span
style="white-space:pre-wrap">
</span>... 54 common
frames omitted</div>
<div>Caused by:
javax.script.ScriptException:
org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:</div>
<div>Script37.groovy:
2: </div>
<div>"basic.getAttributeValue(shadow,
<a
moz-do-not-send="true"
href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
target="_blank">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>,
level_)" is a method
call expression, but
it should be a
variable expression at
line: 2 column: 116.
File: Script37.groovy
@ line 2, column 116.</div>
<div>
source/instance-3',
'level_') = (2 || 3 </div>
</div>
</div>
<br>
</div>
</div>
<font><br>
<br>
CONFIDENTIALITY NOTICE:<br>
This e-mail together with any
attachments is proprietary and
confidential; intended for
only the recipient(s) named
above and may contain
information that is
privileged. You should not
retain, copy or use this
e-mail or any attachments for
any purpose, or disclose all
or any part of the contents to
any person. Any views or
opinions expressed in this
e-mail are those of the author
and do not represent those of
the Baptist School of Health
Professions. If you have
received this e-mail in error,
or are not the named
recipient(s), you are hereby
notified that any review,
dissemination, distribution or
copying of this communication
is prohibited by the sender
and to do so might constitute
a violation of the Electronic
Communications Privacy Act, 18
U.S.C. section 2510-2521.
Please immediately notify the
sender and delete this e-mail
and any attachments from your
computer. </font><br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><span><font color="#888888">
</font></span></pre>
<span><font color="#888888"> </font></span></blockquote>
<span><font color="#888888"> <br>
<pre cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer
<a moz-do-not-send="true" href="http://evolveum.com" target="_blank">evolveum.com</a> <a moz-do-not-send="true" href="http://evolveum.com/blog/" target="_blank">evolveum.com/blog/</a>
_____________________________________________
"Semper Id(e)M Vix."
</pre>
</font></span></div>
<br>
_______________________________________________<br>
midPoint mailing list<br>
<a moz-do-not-send="true"
href="mailto:midPoint@lists.evolveum.com"
target="_blank">midPoint@lists.evolveum.com</a><br>
<a moz-do-not-send="true"
href="http://lists.evolveum.com/mailman/listinfo/midpoint"
target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<font><br>
<br>
CONFIDENTIALITY NOTICE:<br>
This e-mail together with any attachments is
proprietary and confidential; intended for only
the recipient(s) named above and may contain
information that is privileged. You should not
retain, copy or use this e-mail or any attachments
for any purpose, or disclose all or any part of
the contents to any person. Any views or opinions
expressed in this e-mail are those of the author
and do not represent those of the Baptist School
of Health Professions. If you have received this
e-mail in error, or are not the named
recipient(s), you are hereby notified that any
review, dissemination, distribution or copying of
this communication is prohibited by the sender and
to do so might constitute a violation of the
Electronic Communications Privacy Act, 18 U.S.C.
section 2510-2521. Please immediately notify the
sender and delete this e-mail and any attachments
from your computer. </font><br>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
midPoint mailing list
<a moz-do-not-send="true" href="mailto:midPoint@lists.evolveum.com" target="_blank">midPoint@lists.evolveum.com</a>
<a moz-do-not-send="true" href="http://lists.evolveum.com/mailman/listinfo/midpoint" target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<pre cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer
<a moz-do-not-send="true" href="http://evolveum.com" target="_blank">evolveum.com</a> <a moz-do-not-send="true" href="http://evolveum.com/blog/" target="_blank">evolveum.com/blog/</a>
_____________________________________________
"Semper Id(e)M Vix."
</pre>
</div>
</div>
</div>
<br>
_______________________________________________<br>
midPoint mailing list<br>
<a moz-do-not-send="true"
href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a><br>
<a moz-do-not-send="true"
href="http://lists.evolveum.com/mailman/listinfo/midpoint"
target="_blank">http://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<font size="2"><br>
<br>
CONFIDENTIALITY NOTICE:<br>
This e-mail together with any attachments is proprietary and
confidential; intended for only the recipient(s) named above and
may contain information that is privileged. You should not
retain, copy or use this e-mail or any attachments for any
purpose, or disclose all or any part of the contents to any
person. Any views or opinions expressed in this e-mail are those
of the author and do not represent those of the Baptist School
of Health Professions. If you have received this e-mail in
error, or are not the named recipient(s), you are hereby
notified that any review, dissemination, distribution or copying
of this communication is prohibited by the sender and to do so
might constitute a violation of the Electronic Communications
Privacy Act, 18 U.S.C. section 2510-2521. Please immediately
notify the sender and delete this e-mail and any attachments
from your computer. </font><br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Ing. Ivan Noris
Senior Identity Management Engineer
evolveum.com evolveum.com/blog/
_____________________________________________
"Semper Id(e)M Vix."
</pre>
</body>
</html>