<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Could you try with iterative scripting instead?</p>
    <p>Activity (without error handling) with iterativeScripting
      example:</p>
    <p><br>
    </p>
    <p>    <activity><br>
              <work><br>
                  <iterativeScripting><br>
                      <objects><br>
                          <type>UserType</type><br>
                          <query><br>
                              <filter
      xmlns=<a class="moz-txt-link-rfc2396E" href="http://prism.evolveum.com/xml/ns/public/query-3">"http://prism.evolveum.com/xml/ns/public/query-3"</a>
xmlns:mext=<a class="moz-txt-link-rfc2396E" href="http://midpoint.evolveum.com/xml/ns/public/model/extension-3">"http://midpoint.evolveum.com/xml/ns/public/model/extension-3"</a>><br>
                                  <ref><br>
                                     
      <path>archetypeRef</path><br>
                                      <value
      oid="7135e68c-ee53-11e8-8025-170b77da3fd6"/><br>
                                      <!-- Employee Archetype --><br>
                                  </ref><br>
                              </filter><br>
                          </query><br>
                      </objects><br>
                      <scriptExecutionRequest><br>
                          <s:action
      xmlns:s=<a class="moz-txt-link-rfc2396E" href="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3">"http://midpoint.evolveum.com/xml/ns/public/model/scripting-3"</a>
xmlns:scext=<a class="moz-txt-link-rfc2396E" href="http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3">"http://midpoint.evolveum.com/xml/ns/public/model/scripting/extension-3"</a>><br>
                             
      <s:type>execute-script</s:type><br>
                              <s:parameter><br>
                                  <s:name>script</s:name><br>
                                  <c:value
      xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
      xsi:type="c:ScriptExpressionEvaluatorType"><br>
                                      <c:code><br>
                              log.info('PRINTING OBJECT PROPERTIES:
      Name: {}, Given name: {}, Family name: {}',<br>
                              input.getName(), input?.getGivenName(),
      input?.getFamilyName())<br>
                      </c:code><br>
                                  </c:value><br>
                              </s:parameter><br>
                          </s:action><br>
                      </scriptExecutionRequest><br>
                  </iterativeScripting><br>
              </work><br>
          </activity><br>
    </p>
    <p>Best regards,</p>
    <p>Ivan<br>
    </p>
    <div class="moz-cite-prefix">On 12. 1. 2023 12:19, Yakov Revyakin
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CALXvSnuCTosxhVnhs_Xp_WTiNhnL8-1-mM3dh+fHMc5Rbu3HpQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(232,191,106)"><task </span><span style="color:rgb(186,186,186)">xmlns</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">c</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/common/common-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/common/common-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">icfs</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">org</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/common/org-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/common/org-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">q</span><span style="color:rgb(106,135,89)">="<a href="http://prism.evolveum.com/xml/ns/public/query-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://prism.evolveum.com/xml/ns/public/query-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">ri</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/resource/instance-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">t</span><span style="color:rgb(106,135,89)">="<a href="http://prism.evolveum.com/xml/ns/public/types-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://prism.evolveum.com/xml/ns/public/types-3</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">xsi</span><span style="color:rgb(106,135,89)">="<a href="http://www.w3.org/2001/XMLSchema-instance" moz-do-not-send="true" class="moz-txt-link-freetext">http://www.w3.org/2001/XMLSchema-instance</a>"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">oid</span><span style="color:rgb(106,135,89)">="207e057f-d5fc-4523-ad76-ccf2401291ba"
</span><span style="color:rgb(106,135,89)">      </span><span style="color:rgb(186,186,186)">version</span><span style="color:rgb(106,135,89)">="91"</span><span style="color:rgb(232,191,106)">>
</span><span style="color:rgb(232,191,106)">    <name></span>Test CSV Downloader<span style="color:rgb(232,191,106)"></name>
</span><span style="color:rgb(232,191,106)">    <assignment>
</span><span style="color:rgb(232,191,106)">        <targetRef </span><span style="color:rgb(186,186,186)">oid</span><span style="color:rgb(106,135,89)">="00000000-0000-0000-0000-000000000508" </span><span style="color:rgb(186,186,186)">relation</span><span style="color:rgb(106,135,89)">="org:default" </span><span style="color:rgb(186,186,186)">type</span><span style="color:rgb(106,135,89)">="c:ArchetypeType"</span><span style="color:rgb(232,191,106)">/>
</span><span style="color:rgb(232,191,106)">    </assignment>
</span><span style="color:rgb(232,191,106)">    <executionState></span>runnable<span style="color:rgb(232,191,106)"></executionState>
</span><span style="color:rgb(232,191,106)">    <schedulingState></span>ready<span style="color:rgb(232,191,106)"></schedulingState>
</span><span style="color:rgb(232,191,106)">    <category></span>BulkActions<span style="color:rgb(232,191,106)"></category>
</span><span style="color:rgb(232,191,106)">    <binding></span>loose<span style="color:rgb(232,191,106)"></binding>
</span><span style="color:rgb(232,191,106)">    <schedule>
</span><span style="color:rgb(232,191,106)">        <recurrence></span>recurring<span style="color:rgb(232,191,106)"></recurrence>
</span><span style="color:rgb(232,191,106)">        <interval></span>30<span style="color:rgb(232,191,106)"></interval>
</span><span style="color:rgb(232,191,106)">        <misfireAction></span>reschedule<span style="color:rgb(232,191,106)"></misfireAction>
</span><span style="color:rgb(232,191,106)">    </schedule>
</span><span style="color:rgb(232,191,106)">    <activity>
</span><span style="color:rgb(232,191,106)">        <work>
</span><span style="color:rgb(232,191,106)">            <nonIterativeScripting>
</span><span style="color:rgb(232,191,106)">                <scriptExecutionRequest </span><span style="color:rgb(186,186,186)">xmlns:</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(106,135,89)">="<a href="http://midpoint.evolveum.com/xml/ns/public/model/scripting-3" moz-do-not-send="true" class="moz-txt-link-freetext">http://midpoint.evolveum.com/xml/ns/public/model/scripting-3</a>"</span><span style="color:rgb(232,191,106)">>
</span><span style="color:rgb(232,191,106)">                    <</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:execute>
</span><span style="color:rgb(232,191,106)">                        <</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:script>
</span><span style="color:rgb(232,191,106)">                            <code>
</span><span style="color:rgb(232,191,106)">                                </span>throw new java.lang.Exception("Configuration error")
                            <span style="color:rgb(232,191,106)"></code>
</span><span style="color:rgb(232,191,106)">                        </</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:script>
</span><span style="color:rgb(232,191,106)">                        <</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:forWholeInput></span>true<span style="color:rgb(232,191,106)"></</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:forWholeInput>
</span><span style="color:rgb(232,191,106)">                    </</span><span style="color:rgb(152,118,170)">s</span><span style="color:rgb(232,191,106)">:execute>
</span><span style="color:rgb(232,191,106)">                </scriptExecutionRequest>
</span><span style="color:rgb(232,191,106)">            </nonIterativeScripting>
</span><span style="color:rgb(232,191,106)">        </work>
</span><span style="color:rgb(232,191,106)">        <controlFlow>
</span><span style="color:rgb(232,191,106)">            <errorHandling>
</span><span style="color:rgb(232,191,106)">                <entry>
</span><span style="color:rgb(232,191,106)">                    <situation>
</span><span style="color:rgb(232,191,106)">                        <errorCategory></span>configuration<span style="color:rgb(232,191,106)"></errorCategory>
</span><span style="color:rgb(232,191,106)">                        <status></span>fatal_error<span style="color:rgb(232,191,106)"></status>
</span><span style="color:rgb(232,191,106)">                    </situation>
</span><span style="color:rgb(232,191,106)">                    <reaction>
</span><span style="color:rgb(232,191,106)">                        <retryLater>
</span><span style="color:rgb(232,191,106)">                            <initialInterval></span>PT1M<span style="color:rgb(232,191,106)"></initialInterval>
</span><span style="color:rgb(232,191,106)">                            <nextInterval></span>PT1M<span style="color:rgb(232,191,106)"></nextInterval>
</span><span style="color:rgb(232,191,106)">                            <retryLimit></span>3<span style="color:rgb(232,191,106)"></retryLimit>
</span><span style="color:rgb(232,191,106)">                        </retryLater>
</span><span style="color:rgb(232,191,106)">                    </reaction>
</span><span style="color:rgb(232,191,106)">                </entry>
</span><span style="color:rgb(232,191,106)">            </errorHandling>
</span><span style="color:rgb(232,191,106)">        </controlFlow>
</span><span style="color:rgb(232,191,106)">    </activity>
</span><span style="color:rgb(232,191,106)"></task>
</span></pre>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Thu, 12 Jan 2023 at 13:00,
          Yakov Revyakin <<a href="mailto:yrevyakin@gmail.com"
            moz-do-not-send="true" class="moz-txt-link-freetext">yrevyakin@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">At least for 4.4.3 it doesn't work this way. My
            task includes<br>
            <pre style="background-color:rgb(43,43,43);color:rgb(169,183,198);font-family:"JetBrains Mono",monospace;font-size:9.8pt"><span style="color:rgb(232,191,106)"><controlFlow>
</span><span style="color:rgb(232,191,106)">    <errorHandling>
</span><span style="color:rgb(232,191,106)">        <entry>
</span><span style="color:rgb(232,191,106)">            <situation>
</span><span style="color:rgb(232,191,106)">                <errorCategory></span>configuration<span style="color:rgb(232,191,106)"></errorCategory>
</span><span style="color:rgb(232,191,106)">                <status></span>fatal_error<span style="color:rgb(232,191,106)"></status>
</span><span style="color:rgb(232,191,106)">            </situation>
</span><span style="color:rgb(232,191,106)">            <reaction>
</span><span style="color:rgb(232,191,106)">                <retryLater>
</span><span style="color:rgb(232,191,106)">                    <initialInterval></span>PT1M<span style="color:rgb(232,191,106)"></initialInterval>
</span><span style="color:rgb(232,191,106)">                    <nextInterval></span>PT1M<span style="color:rgb(232,191,106)"></nextInterval>
</span><span style="color:rgb(232,191,106)">                    <retryLimit></span>3<span style="color:rgb(232,191,106)"></retryLimit>
</span><span style="color:rgb(232,191,106)">                </retryLater>
</span><span style="color:rgb(232,191,106)">            </reaction>
</span><span style="color:rgb(232,191,106)">        </entry>
</span><span style="color:rgb(232,191,106)">    </errorHandling>
</span><span style="color:rgb(232,191,106)"></controlFlow>
</span></pre>
            <div>But the task becomes suspended right after the first
              error. Status of the task becomes "Fatal Error"</div>
            <div>I have set enableExperimentalCode to true. </div>
            <div><br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Thu, 12 Jan 2023 at
              10:24, Ivan Noris via midPoint <<a
                href="mailto:midpoint@lists.evolveum.com"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">midpoint@lists.evolveum.com</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">Hi Yakov,<br>
              <br>
              have you tried <br>
              <a
href="https://docs.evolveum.com/midpoint/reference/tasks/task-error-handling/#triggers-2"
                rel="noreferrer" target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://docs.evolveum.com/midpoint/reference/tasks/task-error-handling/#triggers-2</a>
              <br>
              example? Perhaps you are missing the errorCategory.<br>
              <br>
              Please see also the whole documentation page.<br>
              <br>
              As the feature is marked Experimental, you may have also
              hit some of its <br>
              limits. I remember it worked according to the samples for
              Live sync task <br>
              for sure.<br>
              <br>
              Best regards,<br>
              <br>
              Ivan<br>
              <br>
              On 11. 1. 2023 18:06, Yakov Revyakin via midPoint wrote:<br>
              > Hi all,<br>
              > It is not clear how to configure retry for a task.<br>
              > I have a task which got fatal_error because of an
              incorrect accessKey <br>
              > for an external resource. The task is suspended after
              the error.<br>
              > I'd like to have another behavior - task must retry
              attempt to execute <br>
              > after a minute.<br>
              > I configured errorHandling in the activity section
              but still have the <br>
              > same result - the task is suspended after an error
              and there is any <br>
              > retry. What's wrong?<br>
              ><br>
              >     <activity><br>
              >     .......<br>
              >         <controlFlow><br>
              >             <errorHandling><br>
              >                 <entry><br>
              >                     <reaction><br>
              >                         <retryLater><br>
              > <initialInterval>PT1M</initialInterval><br>
              > <nextInterval>PT3M</nextInterval><br>
              > <retryLimit>3</retryLimit><br>
              >                         </retryLater><br>
              >                     </reaction><br>
              >                 </entry><br>
              >            </errorHandling><br>
              >         </controlFlow><br>
              >     </activity><br>
              ><br>
              > _______________________________________________<br>
              > midPoint mailing list<br>
              > <a href="mailto:midPoint@lists.evolveum.com"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a><br>
              > <a
                href="https://lists.evolveum.com/mailman/listinfo/midpoint"
                rel="noreferrer" target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
              <br>
              -- <br>
              Ivan Noris<br>
              Expert Identity Engineer<br>
              <a href="http://evolveum.com" rel="noreferrer"
                target="_blank" moz-do-not-send="true">evolveum.com</a><br>
              <br>
              _______________________________________________<br>
              midPoint mailing list<br>
              <a href="mailto:midPoint@lists.evolveum.com"
                target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">midPoint@lists.evolveum.com</a><br>
              <a
                href="https://lists.evolveum.com/mailman/listinfo/midpoint"
                rel="noreferrer" target="_blank" moz-do-not-send="true"
                class="moz-txt-link-freetext">https://lists.evolveum.com/mailman/listinfo/midpoint</a><br>
            </blockquote>
          </div>
        </blockquote>
      </div>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Ivan Noris
Expert Identity Engineer
evolveum.com
</pre>
  </body>
</html>