<div dir="ltr"><div>How it is possible to generate random string according to valuePolicy in groovy with GenerateExpressionEvaluatorType ? I would like to achieve something like this, but GenerateExpressionEvaluatorType does not have any generate method (
generateNewValue() in my ecample):<br></div><div> <code><br> import com.evolveum.midpoint.xml.ns._public.common.common_3.*<br> import com.evolveum.midpoint.schema.constants.*<br><br> generator = new GenerateExpressionEvaluatorType()<br> ortype= new ObjectReferenceType()<br><br>
ortype.setOid(valuePolicyOID); <br>
ortype.setType(ValuePolicyType.COMPLEX_TYPE); <br> ortype.setRelation(SchemaConstants.ORG_DEFAULT); <br> generator.setValuePolicyRef(ortype)<br> <br> while(1){</div><div> newValue=generator.generateNewValue()</div><div> if(myCondition == True){</div><div> return newValue
</div><div> }</div><div> }<br> </code></div> <div>I know there is similar xml-way to generate password according to valuePolicy:<br></div><div> <expression><br> <generate xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:type="c:GenerateExpressionEvaluatorType"><br> <valuePolicyRef oid="12340000-0000-0000-0000-123400332211"/><br> </generate><br> </expression><br></div><div>,but my valuePolicy contains <checkExpression> part and it seems that generate function ignore that.</div><div><br></div><div>Thanks</div><div>Lubomir Odlevak</div></div>