Tuesday, October 1, 2019

SAILPOINT IDENTITY IQ GET ALL SUB WORKFLOW FROM MAIN WORKFLOW


SAILPOINT IDENTITY IQ API GET ALL SUB WORKFLOW FROM THE MAIN WORKFLOW

Below Rule will get the name of all the Sub Workflow Getting called from the Master Workflow in Sailpoint IIQ

Create the below Rule using the IIQ Debug Page

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule   language="beanshell"  name="List-Workflow-Subprocesses">
<Description> </Description>
<Source>
 <![CDATA[
import java.util.Iterator; 
import java.util.ArrayList;
import sailpoint.api.*;
import sailpoint.object.*;

public void handleWorkflow(Workflow workflow, int level) {
if (level == 0) { System.out.print("\n\n==========================================================\nWorkflow:");  }
for (int i = 0; i<level; i++) {
System.out.print("        "); 
}
     System.out.println(workflow.getName()); 
     ArrayList steps = workflow.getSteps(); 
     Iterator iter = steps.iterator(); 
     while (iter.hasNext()) { 
           Workflow.Step step = (Workflow.Step)iter.next(); 
           Workflow sub = step.getSubProcess(); 
           if (sub != null) { 
                  handleWorkflow(sub,level +1); 
           } 
    }
}
QueryOptions qo = new QueryOptions(); 
Iterator  iter = context.search(Workflow.class, qo); 
while(iter.hasNext()){
    Workflow workflow = (Workflow)iter.next();
    handleWorkflow(workflow,0);    
}
]]>
</Source>
</Rule>

Select the Rule and click on the Run Rule Page and check the Catalina.out the file , It will show all the Sub- Workflow Name which is getting called from the Workflow, Below screenshot, shows all the Sub Workflow name getting called from the LCM Provisioning WF



Below the screenshot of the Catalina.out file



For Example below are the List of Sub Workflow which get called from the LCM Provisioning Workflow

Workflow:LCM Provisioning
        Identity Request Initialize
                Identity Request Violation Review
                Do Provisioning Forms
        Manage Ticket
                Provision with retries
        Provisioning Approval Subprocess
        Approve and Provision Subprocess
                Provisioning Approval Subprocess
                Manage Ticket
                        Provision with retries
                Identity Request Provision
                        Do Provisioning Forms
                        Provision with retries
                        Check Status of queued items
                Manage Ticket
                        Provision with retries
        Approve and Provision Subprocess
                Provisioning Approval Subprocess
                Manage Ticket
                        Provision with retries
                Identity Request Provision
                        Do Provisioning Forms
                        Provision with retries
                        Check Status of queued items
                Manage Ticket
                        Provision with retries
        Identity Request Notify
        Identity Request Finalize
                Manage Ticket
                        Provision with retries

1 comment:

  1. This is very useful for all my custom nested workflows. Thank you!

    ReplyDelete