Script is not getting triggered in workflow step if its Approval mode

Its a Custom Form based Workflow. When I add Script Source in Workflow step its not getting triggered. But the OwnerScript is getting triggered. why script outside approval is not getting triggered? Any idea for this issue?

<Step icon="Default" name="OwnerApproval" posX="242" posY="28">
    <Approval mode="ref:approvalMode" name="OwnerApproval">
      <Arg name="workItemForm" value="Test_Form"/>
      <Arg name="workItemType" value="Form"/>
      <OwnerScript>
        <Source>
          import sailpoint.object.Identity;
          import org.apache.log4j.Logger;
          import org.apache.log4j.Level;
          
          Logger myLogger=Logger.getLogger("iiq.alpha.workflow.*************");
          myLogger.setLevel(Level.DEBUG);
          Identity ids=context.getObject(Identity.class,"spadmin");
          submitter=ids;
          ids;
        </Source>
      </OwnerScript>
    </Approval>
    <Script>
      <Source>
         import org.apache.log4j.Logger;
          import org.apache.log4j.Level;
          Logger myLogger=Logger.getLogger("iiq.alpha.workflow.*************");
          myLogger.setLevel(Level.DEBUG);
          myLogger.debug("outside Approval Script");

      </Source>
    </Script>
    <Transition to="Stop"/>
</Step>

@aishwaryagoswami , @drosenbauer

Hey @ArunSundar, can you try to transition in the new step and call the script, instead of putting it all in one step. That will in effect log the same thing.

Actually I wanted to modify the identity model on that step, modifying some attribute values so need to do it on the same step @aishwaryagoswami

Hey Arun, few things - My guess is that your script should be within the approval tag, not outside of it. Can you try to put that within the approval tag and check? Also, if the changes which you will be in the making in the identityModel is based on the result of the approval then you can use instead of a regular script. But i think the issue here is that the script is outside of the approval tag.

Let me know if it works.

@aishwaryagoswami , I have tried already the script inside the approval tag, but Sailpoint throw error not to save that code…

Can you try to put the logic in an InterceptorScript within the approval tag and see if the logic is getting called?

1 Like

@ArunSundar As discussed, you can either place the logic which you want to keep in the script within the available approval scripts (interceptor, validation, owner) depending on your requirement. Or you can have a separate step before the approval step to do the evaluation (as you require to run the logic before approval)

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.