Class ThreadedRuleRunner

  • All Implemented Interfaces:
    PrivateContextObjectConsumer<Object>, sailpoint.object.BaseExecutor, sailpoint.object.TaskExecutor

    public class ThreadedRuleRunner
    extends AbstractThreadedObjectIteratorTask<Object>
    A threaded task executor to run an iterator rule or script.

    The rule or script will be invoked in parallel for each of the objects returned by the iterator query. The object will be passed as ‘object’ to Beanshell.

    NOTE that if you are iterating over a very large set of Sailpoint objects, it will be vastly more efficient to return a string ID from your object retriever and then look up each object in the iterator rule or script. This will also avoid problems with multiple contexts acting on the same object. The task option ‘extractReferences’ will do this for you automatically and is true by default.

    • Field Detail

      • afterBatchRule

        protected sailpoint.object.Rule afterBatchRule
        An optional rule to run after the batch
      • afterBatchScript

        protected sailpoint.object.Script afterBatchScript
        An optional script to run after the batch
      • beforeBatchRule

        protected sailpoint.object.Rule beforeBatchRule
        An optional rule to run before the batch
      • beforeBatchScript

        protected sailpoint.object.Script beforeBatchScript
        An optional script to run prior to the batch
      • iteratorRule

        protected sailpoint.object.Rule iteratorRule
        The iterator rule, if specified
      • iteratorScript

        protected sailpoint.object.Script iteratorScript
        The iterator script, if specified
    • Method Detail

      • afterBatch

        public void afterBatch​(sailpoint.api.SailPointContext threadContext)
                        throws sailpoint.tools.GeneralException
        Invoked by the worker thread after each batch
        Overrides:
        afterBatch in class AbstractThreadedTask<Object>
        Parameters:
        threadContext - The context for this thread
        Throws:
        sailpoint.tools.GeneralException - if anything fails
      • beforeBatch

        public void beforeBatch​(sailpoint.api.SailPointContext threadContext)
                         throws sailpoint.tools.GeneralException
        Invoked by the worker thread before each batch
        Overrides:
        beforeBatch in class AbstractThreadedTask<Object>
        Parameters:
        threadContext - The context for this thread
        Throws:
        sailpoint.tools.GeneralException - if anything fails
      • convertObject

        protected Object convertObject​(Object input)
        If the extract reference flag is set, and this is a SailPointObject, transforms it into a Reference object instead.

        This will make everything enormously more efficient and avoid weird issues with Hibernate context.

        Overrides:
        convertObject in class AbstractThreadedObjectIteratorTask<Object>
        Parameters:
        input - The input
        Returns:
        The reference, or the original object
      • threadExecute

        public Object threadExecute​(sailpoint.api.SailPointContext threadContext,
                                    Map<String,​Object> parameters,
                                    Object obj)
                             throws sailpoint.tools.GeneralException
        Executes this rule or script against the given object
        Specified by:
        threadExecute in interface PrivateContextObjectConsumer<Object>
        Specified by:
        threadExecute in class AbstractThreadedTask<Object>
        Parameters:
        threadContext - The context created for this specific thread
        parameters - The parameters created for this thread
        obj - The input object for this thread
        Returns:
        Always null (no meaningful result)
        Throws:
        sailpoint.tools.GeneralException - if any failures occur