Helpneeded in QuickLink Form

Which IIQ version are you inquiring about?

Version 8.1

Share all details related to your problem, including any error messages you may have received.

Hello Community,
Being an Intermediate Developer, SailPoint Community has helped a lot. Still in a learning curve. Thank you everyone.
Today’s Issue:
I added a QuickLink to create an Email Address in SailPoint. The workflow looks like this : Populate Variables - Show Form - Provision Email -Email confirm
What I am trying to do is " if identity is terminated" it should return “User Terminated” otherwise go to"Show Form".
I am having a mental block and don’t even know how to start to check for this.
This is the draft of my workflow:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Workflow PUBLIC "sailpoint.dtd" "sailpoint.dtd">
 <Step name="Populate Variables" posX="147" posY="127">
   <Script>
     <Source>import sailpoint.object.Identity;
       import sailpoint.object.TaskResult;
       import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;

     
       
      
       if (quickLinkIdentityId != null) 
       {
           Identity user = context.getObjectById(Identity.class, quickLinkIdentityId);

           logger.debug("Attributes are: "+user.getAttributes());
           logger.debug("Identity Name is: "+user.getName());
           if (user != null)
           { 
             
              
               
               logger.debug("identity is: "+ user.getId());
               workflow.put("identityName", user.getName());
               workflow.put("fullName", user.getDisplayName());
               workflow.put("empNumber", user.getAttribute("empNumber"));
               workflow.put("empType", user.getAttribute("type"));
               workflow.put("createMailbox", user.getAttribute("createMailbox"));
       
               workflow.put("iiqStatus", user.getAttribute("iiqStatus"));
               workflow.put("orgStatus", user.getAttribute("orgStatus"));
       
              if( user.getManager() != null)
               {
                      workflow.put("managerName", user.getManager().getDisplayName());
               }
               else
               {
                      workflow.put("managerName",  "");
               }

               if( user.getManager() != null &amp;&amp; user.getManager().getEmail() != null )
               {
                      workflow.put("managerEmail", user.getManager().getEmail());
               }
               else
               {
                      workflow.put("managerEmail",  "");
               }                                                           

               logger.debug("Workflow variables are: "+workflow.getVariables());
               logger.debug("All variables populated....................");
               context.decache(user);
           }
       }   
          </Source>
   </Script>
   <Transition to="Show Form"/>
 </Step>
 <Step name="Show Form" posX="258" posY="127">
   <Approval name="Create Mailbox" owner="ref:requester" return="identityName, message, fullName, empNumber, empType,createMailbox,managerName,managerEmail,iiqStatus,orgStatus" send="identityName, message, fullName, empNumber, empType,createMailbox,managerName,managerEmail,iiqStatus,orgStatus ">
     <Form name="Create Mailbox">
       <Attributes>
         <Map>
           <entry key="hideIncompleteFields">
             <value>
               <Boolean></Boolean>
             </value>
           </entry>
           <entry key="includeHiddenFields">
             <value>
               <Boolean></Boolean>
             </value>
           </entry>
           <entry key="pageTitle" value="Create Mailbox"/>
         </Map>
       </Attributes>
       <Section label="Confirm" type="text">
         <Field value="Verify the detail and click Create Mailbox button"/>
       </Section>
       <Section columns="3" label="Info" type="datatable">
         <Field columnSpan="1" displayName="Full name" name="fullName" type="string">
           <Script>
             <Source>return fullName;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Employee Number" name="empNumber" type="string">
           <Script>
             <Source> return empNumber;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Employee Type" name="empType" type="string">
           <Script>
             <Source>return empType;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="IIQ Status" name="iiqStatus" type="string">
           <Script>
             <Source>return iiqStatus;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Org Status" name="orgStatus" type="string">
           <Script>
             <Source>return orgStatus;</Source>
           </Script>
         </Field>
         <Field columnSpan="3" displayName="Create Mailbox" name="createMailbox" type="string">
           <Script>
             <Source>return createMailbox;</Source>
           </Script>
         </Field>
       </Section>
       <Section columns="2" label="Manager Info" type="datatable">
         <Field columnSpan="1" displayName="Manager&apos;s Name" name="managerName" type="string">
           <Script>
             <Source>return managerName;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Manager&apos;s Email" name="managerEmail" type="string">
           <Script>
             <Source>return managerEmail;</Source>
           </Script>
         </Field>
       </Section>
       <Section label="Comments">
         <Field displayName="Comments" name="comments" type="string"/>
       </Section>
       <Button action="cancel" label="Cancel"/>
       <Button action="next" label="Create Mailbox"/>
     </Form>
   </Approval>
   <Transition to="Provision Email - Create"/>
 </Step>
 <Step icon="Task" name="Provision Email - Create" posX="374" posY="126" resultVariable="errorStr">
   <Script>
     <Source>
       
       Email Provisioning Code comes here
       
     </Source>
   </Script>
   <Transition to="Email confirm"/>
 </Step>
 <Step icon="Default" name="Email confirm" posX="494" posY="127">
   <Approval name="Email Success Form" owner="ref:requester" return="confirmMsg,errorStr" send="confirmMsg,errorStr">
     <Form name="Email Success Form">
       <Attributes>
         <Map>
           <entry key="pageTitle" value="Email Success Form"/>
         </Map>
       </Attributes>
       <Section name="Section 1">
         <Field displayName="Message" name="Message" type="string">
           <Script>
             <Source>                           
              
           </Script>
         </Field>
       </Section>
       <Button action="next" label="OK"/>
     </Form>
   </Approval>
   <Transition to="Stop"/>
 </Step>
 <Step icon="Stop" name="Stop" posX="614" posY="130"/>
</Workflow>

@j1241

You can have a transition script to another step where you show a message user is terminated if the user is terminated otherwise it goes to Show Form step

1 Like

Use the below

<Transition to="Request Submittion Failed">
  <Script>
        <Source>
          Boolean result = false;
           if (quickLinkIdentityId != null) 
           {
           Identity user = context.getObjectById(Identity.class, quickLinkIdentityId);
		   if(user!=null &amp;&amp; user.isInactive())
		   result=true;
		   
		   }
		   
          return result;
        </Source>
      </Script>
    </Transition>
   <Transition to="Show Form"/>

Similarly Add the below additional step

  <Step name="Request Submittion Failed">
    <Approval name="Request Submission Failed as the user is not a Active User" owner="ref:requester">
      <Form name="Request Submission Failed as the user is not a Active User">
        <Attributes>
          <Map>
            <entry key="pageTitle" value="Failed"/>
          </Map>
        </Attributes>
        <Section label="The request Submission Failed as the user is Terminated" name="message1" type="text">
          <Field>
            <Script>
              <Source>
                return " ";              
              </Source>
            </Script>
          </Field>
        </Section>
        <Button action="next" label="Return to Homepage"/>
      </Form>
    </Approval>
    <Transition to="Stop"/>
  </Step>
1 Like

Hello @iamksatish I really appreciate your help on this one. The additional step you mentioned should go after .
Like this

<Transition to="Request Submittion Failed">
  <Script>
        <Source>
          Boolean result = false;
           if (quickLinkIdentityId != null) 
           {
           Identity user = context.getObjectById(Identity.class, quickLinkIdentityId);
		   if(user!=null &amp;&amp; user.isInactive())
		   result=true;
		   
		   }
		   
          return result;
        </Source>
      </Script>
    </Transition>
   <Transition to="Show Form"/>
   <Step name="Request Submittion Failed">
    <Approval name="Request Submission Failed as the user is not a Active User" owner="ref:requester">
      <Form name="Request Submission Failed as the user is not a Active User">
        <Attributes>
          <Map>
            <entry key="pageTitle" value="Failed"/>
          </Map>
        </Attributes>
        <Section label="The request Submission Failed as the user is Terminated" name="message1" type="text">
          <Field>
            <Script>
              <Source>
                return " ";              
              </Source>
            </Script>
          </Field>
        </Section>
        <Button action="next" label="Return to Homepage"/>
      </Form>
    </Approval>
    <Transition to="Stop"/>
  </Step>

@j1241
Looks like you Clubbed things together, for your clarity I have provided the complete modified code provided by you

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Workflow PUBLIC "sailpoint.dtd" "sailpoint.dtd">
 <Step name="Populate Variables" posX="147" posY="127">
   <Script>
     <Source>import sailpoint.object.Identity;
       import sailpoint.object.TaskResult;
       import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;

     
       
      
       if (quickLinkIdentityId != null) 
       {
           Identity user = context.getObjectById(Identity.class, quickLinkIdentityId);

           logger.debug("Attributes are: "+user.getAttributes());
           logger.debug("Identity Name is: "+user.getName());
           if (user != null)
           { 
             
              
               
               logger.debug("identity is: "+ user.getId());
               workflow.put("identityName", user.getName());
               workflow.put("fullName", user.getDisplayName());
               workflow.put("empNumber", user.getAttribute("empNumber"));
               workflow.put("empType", user.getAttribute("type"));
               workflow.put("createMailbox", user.getAttribute("createMailbox"));
       
               workflow.put("iiqStatus", user.getAttribute("iiqStatus"));
               workflow.put("orgStatus", user.getAttribute("orgStatus"));
       
              if( user.getManager() != null)
               {
                      workflow.put("managerName", user.getManager().getDisplayName());
               }
               else
               {
                      workflow.put("managerName",  "");
               }

               if( user.getManager() != null &amp;&amp; user.getManager().getEmail() != null )
               {
                      workflow.put("managerEmail", user.getManager().getEmail());
               }
               else
               {
                      workflow.put("managerEmail",  "");
               }                                                           

               logger.debug("Workflow variables are: "+workflow.getVariables());
               logger.debug("All variables populated....................");
               context.decache(user);
           }
       }   
          </Source>
   </Script>
  <Transition to="Request Submittion Failed">
  <Script>
        <Source>
          Boolean result = false;
           if (quickLinkIdentityId != null) 
           {
           Identity user = context.getObjectById(Identity.class, quickLinkIdentityId);
		   if(user!=null &amp;&amp; user.isInactive())
		   result=true;
		   
		   }
		   
          return result;
        </Source>
      </Script>
    </Transition>
   <Transition to="Show Form"/>
 </Step>
 <Step name="Show Form" posX="258" posY="127">
   <Approval name="Create Mailbox" owner="ref:requester" return="identityName, message, fullName, empNumber, empType,createMailbox,managerName,managerEmail,iiqStatus,orgStatus" send="identityName, message, fullName, empNumber, empType,createMailbox,managerName,managerEmail,iiqStatus,orgStatus ">
     <Form name="Create Mailbox">
       <Attributes>
         <Map>
           <entry key="hideIncompleteFields">
             <value>
               <Boolean></Boolean>
             </value>
           </entry>
           <entry key="includeHiddenFields">
             <value>
               <Boolean></Boolean>
             </value>
           </entry>
           <entry key="pageTitle" value="Create Mailbox"/>
         </Map>
       </Attributes>
       <Section label="Confirm" type="text">
         <Field value="Verify the detail and click Create Mailbox button"/>
       </Section>
       <Section columns="3" label="Info" type="datatable">
         <Field columnSpan="1" displayName="Full name" name="fullName" type="string">
           <Script>
             <Source>return fullName;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Employee Number" name="empNumber" type="string">
           <Script>
             <Source> return empNumber;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Employee Type" name="empType" type="string">
           <Script>
             <Source>return empType;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="IIQ Status" name="iiqStatus" type="string">
           <Script>
             <Source>return iiqStatus;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Org Status" name="orgStatus" type="string">
           <Script>
             <Source>return orgStatus;</Source>
           </Script>
         </Field>
         <Field columnSpan="3" displayName="Create Mailbox" name="createMailbox" type="string">
           <Script>
             <Source>return createMailbox;</Source>
           </Script>
         </Field>
       </Section>
       <Section columns="2" label="Manager Info" type="datatable">
         <Field columnSpan="1" displayName="Manager&apos;s Name" name="managerName" type="string">
           <Script>
             <Source>return managerName;</Source>
           </Script>
         </Field>
         <Field columnSpan="1" displayName="Manager&apos;s Email" name="managerEmail" type="string">
           <Script>
             <Source>return managerEmail;</Source>
           </Script>
         </Field>
       </Section>
       <Section label="Comments">
         <Field displayName="Comments" name="comments" type="string"/>
       </Section>
       <Button action="cancel" label="Cancel"/>
       <Button action="next" label="Create Mailbox"/>
     </Form>
   </Approval>
   <Transition to="Provision Email - Create"/>
 </Step>
 <Step icon="Task" name="Provision Email - Create" posX="374" posY="126" resultVariable="errorStr">
   <Script>
     <Source>
       
       Email Provisioning Code comes here
       
     </Source>
   </Script>
   <Transition to="Email confirm"/>
 </Step>
 <Step icon="Default" name="Email confirm" posX="494" posY="127">
   <Approval name="Email Success Form" owner="ref:requester" return="confirmMsg,errorStr" send="confirmMsg,errorStr">
     <Form name="Email Success Form">
       <Attributes>
         <Map>
           <entry key="pageTitle" value="Email Success Form"/>
         </Map>
       </Attributes>
       <Section name="Section 1">
         <Field displayName="Message" name="Message" type="string">
           <Script>
             <Source>                           
              
           </Script>
         </Field>
       </Section>
       <Button action="next" label="OK"/>
     </Form>
   </Approval>
   <Transition to="Stop"/>
 </Step> 
  <Step name="Request Submittion Failed">
    <Approval name="Request Submission Failed as the user is not a Active User" owner="ref:requester">
      <Form name="Request Submission Failed as the user is not a Active User">
        <Attributes>
          <Map>
            <entry key="pageTitle" value="Failed"/>
          </Map>
        </Attributes>
        <Section label="The request Submission Failed as the user is Terminated" name="message1" type="text">
          <Field>
            <Script>
              <Source>
                return " ";              
              </Source>
            </Script>
          </Field>
        </Section>
        <Button action="next" label="Return to Homepage"/>
      </Form>
    </Approval>
    <Transition to="Stop"/>
  </Step>
 <Step icon="Stop" name="Stop" posX="614" posY="130"/>
</Workflow>
1 Like

Thank you @iamksatish . You are a genius and an angel for me.

1 Like