<div dir="ltr"><div><div><div><div><div><div><div>Hello,<br><br></div></div>at the moment i have a task which querys all activ users and gets the valid until date. The task disables the user for testing purpose. <br></div><div>The task will be changed to run daily and only query users, which valid until date is less then two weeks in the future.<br></div>How can i change the task to generate an approval workflow for each user the query returns. This Workflow must be assignted to the user's manager. <br></div>If the workflow get's approved the user's valid until field should be set to validuntil + 1 month. <br><br></div>This is the Task at the moment:<br><name>Disable users</name><br>   <extension xmlns:mext="<a href="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">http://midpoint.evolveum.com/xml/ns/public/model/extension-3</a>"<br>              xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"<br>              xsi:type="c:ExtensionType"><br>      <mext:objectQuery><br>          <q:filter><br>            <q:and><br>                <q:less><br>                    <q:path>c:activation/validTo</q:path><br>                    <expression><br>                        <script><br>                            <code><br>                                import java.util.Date;<br>                                import java.util.GregorianCalendar;<br>                                import javax.xml.datatype.DatatypeFactory<br>                                import javax.xml.datatype.XMLGregorianCalendar;<br>                                Date d = new Date();<br>                                GregorianCalendar gc = new GregorianCalendar();<br>                                gc.setTime(d);<br>                                XMLGregorianCalendar xgc = DatatypeFactory.newInstance().newXMLGregorianCalendar(gc);<br>                                return xgc<br>                            </code>    <br>                        </script><br>                    </expression><br>                </q:less><br>                <q:equal><!-- Only enabled users --><br>                    <q:path>c:activation/administrativeStatus</q:path><br>                    <q:value>enabled</q:value><br>                </q:equal><br>            </q:and><br>        </q:filter><br>      </mext:objectQuery><br>      <mext:objectType>c:UserType</mext:objectType><br>      <mext:objectDelta><br>         <t:changeType>modify</t:changeType><br>         <t:objectType>c:UserType</t:objectType><br>         <t:oid>fakeOid</t:oid><br>         <t:itemDelta><br>            <t:modificationType>replace</t:modificationType><br>            <t:path>c:activation/administrativeStatus</t:path><br>            <t:value><br>               disabled<br>            </t:value><br>         </t:itemDelta><br>      </mext:objectDelta><br>   </extension><br><br></div>Thanks for help<br></div>Nico Pätzelt<br></div>