Class WorkflowUtilities

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  WorkflowUtilities.LCMWorkflowType
      An enumeration of available LCM workflow types and the system config property required to access them
      static class  WorkflowUtilities.WorkflowType
      An enumeration of available non-LCM workflow types and the system property required to access them
    • Constructor Summary

      Constructors 
      Constructor Description
      WorkflowUtilities​(sailpoint.api.SailPointContext c)
      Constructor for workflow utilities
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Map<String,​Object> createFormModel()
      Creates a new form model map with the required parameters set.
      void launchAsync​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters, long launchTime)
      Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.
      void launchAsync​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters, LocalDate launchTime)
      Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.
      void launchAsync​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters, LocalDateTime launchTime)
      Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.
      void launchDelayed​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters, long howMuch, ChronoUnit timeUnit)
      Launches the given workflow with the given delay
      void launchDelayed​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters, long howMuch, TimeUnit timeUnit)
      Launches the given workflow with the given delay
      protected void launchInternal​(sailpoint.api.SailPointContext context, sailpoint.object.Request request)
      Internal method to launch a workflow using the RequestManager.
      void launchQuietly​(sailpoint.object.Workflow wf, String caseName, Map<String,​Object> parameters)
      Launches the given workflow quietly (i.e.
      void setStepTargetWorkflow​(sailpoint.workflow.WorkflowContext wfcontext, String stepName, String targetWorkflow)
      Sets the target workflow reference of a step to another workflow at runtime.
      void wfError​(sailpoint.workflow.WorkflowContext wfcontext, String message)
      Appends an error message to the given workflow context / task result with a timestamp
      void wfMessage​(sailpoint.workflow.WorkflowContext wfcontext, String message)
      Appends a message to the given workflow context / task result with a timestamp
      void wfWarn​(sailpoint.workflow.WorkflowContext wfcontext, String message)
      Appends a warning message to the given workflow context / task result with a timestamp
    • Constructor Detail

      • WorkflowUtilities

        public WorkflowUtilities​(sailpoint.api.SailPointContext c)
        Constructor for workflow utilities
        Parameters:
        c - The current SailPointContext
    • Method Detail

      • createFormModel

        public static Map<String,​ObjectcreateFormModel()
        Creates a new form model map with the required parameters set.

        If you need to add complex values to the Map, using MapUtil.put(Map, String, Object) is a great option.

        Returns:
        A new form model with the required parameters
      • launchAsync

        public void launchAsync​(sailpoint.object.Workflow wf,
                                String caseName,
                                Map<String,​Object> parameters,
                                long launchTime)
                         throws sailpoint.tools.GeneralException
        Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.

        If the launch time is not in the future, it will be set to the current System timestamp.

        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
        launchTime - The time at which the workflow will be launched (in milliseconds since epoch)
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchAsync

        public void launchAsync​(sailpoint.object.Workflow wf,
                                String caseName,
                                Map<String,​Object> parameters,
                                LocalDate launchTime)
                         throws sailpoint.tools.GeneralException
        Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.

        If the launch time is not in the future, it will be set to the current System timestamp.

        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
        launchTime - The time at which the workflow will be launched
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchAsync

        public void launchAsync​(sailpoint.object.Workflow wf,
                                String caseName,
                                Map<String,​Object> parameters,
                                LocalDateTime launchTime)
                         throws sailpoint.tools.GeneralException
        Launches the given workflow asynchronously, using a Request to launch the Workflow and associated TaskResult at a later time.

        If the launch time is not in the future, it will be set to the current System timestamp.

        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
        launchTime - The time at which the workflow will be launched
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchDelayed

        public void launchDelayed​(sailpoint.object.Workflow wf,
                                  String caseName,
                                  Map<String,​Object> parameters,
                                  long howMuch,
                                  TimeUnit timeUnit)
                           throws sailpoint.tools.GeneralException
        Launches the given workflow with the given delay
        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
        howMuch - How much to delay the launch of the workflow
        timeUnit - The time unit represented by the howMuch parameter
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchDelayed

        public void launchDelayed​(sailpoint.object.Workflow wf,
                                  String caseName,
                                  Map<String,​Object> parameters,
                                  long howMuch,
                                  ChronoUnit timeUnit)
                           throws sailpoint.tools.GeneralException
        Launches the given workflow with the given delay
        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
        howMuch - How much to delay the launch of the workflow
        timeUnit - The time unit represented by the howMuch parameter
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchInternal

        protected void launchInternal​(sailpoint.api.SailPointContext context,
                                      sailpoint.object.Request request)
                               throws sailpoint.tools.GeneralException
        Internal method to launch a workflow using the RequestManager.

        Used for testing by overriding this method to do something different.

        Parameters:
        context - The SailPointContext to use for launching the workflow
        request - The Request to launch
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • launchQuietly

        public void launchQuietly​(sailpoint.object.Workflow wf,
                                  String caseName,
                                  Map<String,​Object> parameters)
        Launches the given workflow quietly (i.e.

        absorbs errors if there are any)

        Parameters:
        wf - The workflow to launch
        caseName - The case name ot use
        parameters - The parameters to the workflow
      • setStepTargetWorkflow

        public void setStepTargetWorkflow​(sailpoint.workflow.WorkflowContext wfcontext,
                                          String stepName,
                                          String targetWorkflow)
                                   throws sailpoint.tools.GeneralException
        Sets the target workflow reference of a step to another workflow at runtime.

        This can be used for polymorphic behavior.

        Parameters:
        wfcontext - The workflow to modify
        stepName - The step name to modify
        targetWorkflow - The new target workflow for that step
        Throws:
        sailpoint.tools.GeneralException - if any IIQ error occurs
      • wfError

        public void wfError​(sailpoint.workflow.WorkflowContext wfcontext,
                            String message)
        Appends an error message to the given workflow context / task result with a timestamp
        Parameters:
        wfcontext - The Workflow Context (wfcontext from any workflow step)
        message - The message to append
      • wfMessage

        public void wfMessage​(sailpoint.workflow.WorkflowContext wfcontext,
                              String message)
        Appends a message to the given workflow context / task result with a timestamp
        Parameters:
        wfcontext - The Workflow Context (wfcontext from any workflow step)
        message - The message to append
      • wfWarn

        public void wfWarn​(sailpoint.workflow.WorkflowContext wfcontext,
                           String message)
        Appends a warning message to the given workflow context / task result with a timestamp
        Parameters:
        wfcontext - The Workflow Context (wfcontext from any workflow step)
        message - The message to append