IIQ Workflow question

I have a workflow, where I am passing identityModel to a form in an approval step. I want to return 2 things, the formModel and account (a field with same name in the form). But it does not return account for me. Identitymodel returns fine and has the account value in there.
I just don’t want an extra step to get the account value from formModel and add it to the workflow variable.

Is this expected behavior or am I missing something?

<Variable input="true" name="launcher">
    <Description>The launcher of the workflow.</Description>
  </Variable>
  <Variable name="account"/>
  <Variable name="action"/>
  <Variable initializer="true" name="trace"/>
  <Variable name="formModel" type="Map"/>
  <Variable initializer="true" name="transient"/>
<Step icon="Start" name="Start" posX="28" posY="10">
    <Transition to="Initialize"/>
  </Step>
  <Step action="call:getIdentityModel" icon="Default" name="Initialize" posX="98" posY="10" resultVariable="formModel">
    <Arg name="expandIdentity" value="false"/>
    <Arg name="expandLinks" value="false"/>
    <Description>
      Initialize the data in the model.
    </Description>
    <Transition to="Show Form"/>
    <Transition to="Provision" when="return false;"/>
  </Step>
  <Step icon="Approval" name="Show Form" posX="201" posY="151">
    <Approval mode="string:serial" name="Test Form" owner="script:return launcher;" return="formModel,action" send="launcher">
      <Arg name="workItemType" value="Form"/>
      <Arg name="workItemFormBasePath" value="formModel"/>
      <Arg name="workItemForm" value="Test Form"/>
      <Arg name="trace" value="true"/>
    </Approval>
    <Transition to="Selected Identity"/>
  </Step>
<Step icon="Default" name="Selected Identity" posX="411" posY="150">
    <Script>
      <Source>
        System.out.println("account>>>>>>>>>>>>"+account); 

String identity = formModel.get("account");

        

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

This is how the field looks like in form:
<Field displayName="Select Identity" helpKey="Search by name" name="account" postBack="true" required="true" type="sailpoint.object.Identity"/>

It’s expected to work this way. From this documentation:

Note: When a base path is specified as a form argument, the form renderer assumes all fields on the form are accessed through that base path, so all attributes to be included in the form or returned from it must be included in the model.

You can just continue to reference the formModel throughout the workflow, that is kind of the point of it to make the passing back and fourth of form variables easier to access from a single map rather than individual return attributes.

Makes sense. Thanks Pat!

The reason I wanted to populate workflow level variable was because I plan to trigger this workflow via SCIM api as well as Quicklink. In SCIM api the form step will be skipped and the variables will be passed as part of the SCIM call.

When invoking via API, just have an input map object called formModel where they pass in the field names the same way they would have come from the form if it was invoked from the UI. This is what I have done in the past and that way you do not need to have separate logic if it’s an API invocation.

1 Like

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