ilog.rules.studio.model.ruleflow

Class IlrRuleFlowHelper

  • java.lang.Object
    • ilog.rules.studio.model.ruleflow.IlrRuleFlowHelper


  • public class IlrRuleFlowHelper
    extends java.lang.Object
    Gather utility methods to manipulate a ruleflow and populate a ruleflow.
    • Constructor Detail

      • IlrRuleFlowHelper

        public IlrRuleFlowHelper()
    • Method Detail

      • createRuleTask

        @Deprecated
        public static IlrRuleTask createRuleTask()
        Deprecated. 
        Creates a rule task without representation in the graph of the rule flow.
        Returns:
        a rule task without definition.
      • createFunctionTask

        @Deprecated
        public static IlrFunctionTask createFunctionTask()
        Deprecated. 
        Creates a function task without representation in the graph of the rule flow.
        Returns:
        a function task without definition.
      • createRuleFlow

        @Deprecated
        public static IlrRuleFlow createRuleFlow(boolean createDefinition,
                                            IlrResourceElement container,
                                            java.lang.String name,
                                            org.eclipse.core.runtime.IProgressMonitor monitor)
                                          throws org.eclipse.core.runtime.CoreException
        Deprecated. 
        Throws:
        org.eclipse.core.runtime.CoreException
        Parameters:
        createDefinition -
        container -
        name -
        monitor -
      • createRuleFlow

        public static IlrRuleFlow createRuleFlow(boolean createDefinition,
                                 org.eclipse.core.resources.IResource resource,
                                 java.lang.String name,
                                 org.eclipse.core.runtime.IProgressMonitor monitor)
                                          throws org.eclipse.core.runtime.CoreException
        Creates a rule flow with or without associted resource. When it is asked to create a definition an IlrRFModelis created and a resource is associated.
        Throws:
        org.eclipse.core.runtime.CoreException - when the EMF model can't create the rule flow element.
        Parameters:
        createDefinition - inidicates wether or not it is required to create the IlrRFModeland the resource.
        resource - the resource that will contain the ruleflow. It is mandatory to create the definition.
        name - the name of the rule flow. It is mandatory to create the resource if the createDefinition parameter is set to true.
        monitor - the progress monitor to let the user be aware of the progression of the task. This is not mandatory to create teh rule flow, null is allowed.
        Returns:
        the created ruleflow.
      • getElementContainer

        public static IlrResourceElement getElementContainer(IlrRuleFlow ruleflow)
        Returns the parent element containing the rule flow.
        Parameters:
        ruleflow - the rule flow to investigate.
        Returns:
        the parent of the rule flow. May return null if the rule flow was created but not added in the EMF model.
      • setDefaultCategory

        public static void setDefaultCategory(IlrRuleFlow ruleflow)
        Parameters:
        ruleflow -
      • createSubflow

        @Deprecated
        public static IlrRuleFlow createSubflow(IlrRuleFlow ruleflow,
                                           boolean createDefinition,
                                           java.lang.String name)
                                         throws org.eclipse.core.runtime.CoreException
        Deprecated. 
        Creates a sub flow in the given flow and optionaly creates its definition: its graph model (IlrRFModel) and the resource.
        Throws:
        org.eclipse.core.runtime.CoreException - when the EMF model can't create the rule flow.
        Parameters:
        ruleflow - the rule flow containing the subflow.
        createDefinition - inidicates whether or not it is required to create the IlrRFModel and the resource.
        name - the name to give to the subflow. The name is mandatory as it is
        Returns:
        the created ruleflow.
      • createRuleFlow

        public static IlrRuleFlow createRuleFlow()
        Creates a not initialized rule flow. It will not be associated to a resource and will not be added in the EMF model.
        Returns:
        a non initialized ruleflow.
      • findNewName

        @Deprecated
        public static java.lang.String findNewName(IlrElement element,
                                              java.lang.String newName)
        Deprecated. 
        Find a new name in the given container, for the given composite reference. The element to rename must be contained in the EMF model.
        Parameters:
        element - the element to renamed, either a ruleflow or a task.
        newName - a proposition of new name to check for validity.
        Returns:
        the given newName followed by a suffix if necessary.
      • getMainRuleFlows

        public static java.util.Collection getMainRuleFlows(IlrRuleProject ruleProject)
        Get the main ruleflow(s) of a rule project. There can be several or none main ruleflow(s). A main rule flow is a ruleflow with the main flow task property set to true.
        Parameters:
        ruleProject - a rule project
        Returns:
        a Collection of IlrRuleFlowwith the main flow property set to true.
      • getRuleFlows

        public static java.util.Collection getRuleFlows(IlrRuleProject ruleProject)
        Get the all the ruleflow(s) of a rule project.
        Parameters:
        ruleProject - a rule project
        Returns:
        a Collection of IlrRuleFlow.
      • getAllSubTasks

        @Deprecated
        public static java.util.Iterator getAllSubTasks(IlrRuleFlow ruleFlow)
        Deprecated. 
        Returns all the tasks contained in a given ruleflow and its sub flows.
        Parameters:
        ruleFlow - the rule flow to investigate.
        Returns:
        an iterator returning all the IlrTask and IlrRuleFlow objects contained in the rule flow and recursively in its subflows.
      • getSubflows

        public static java.util.Set<java.lang.String> getSubflows(IlrRuleFlow ruleflow)
        Returns the list of rule flow referenced in this given ruleflow. This doesn't search recursively in the hierarchy of ruleflow.
        Parameters:
        ruleflow - the rule flow containing reference to other rule flows.
        Returns:
        a collection of IlrRuleFlow may return an empty list but will never return null.
      • getTasksetCode

        @Deprecated
        public static java.lang.String getTasksetCode(IlrTask task)
        Deprecated. 
        Get the IRL code of the given task plsu the dependencies. The dependencies will be the list of imports of the container rule flow. Some or all dependencies will be meaningless for the task.
      • getXTaskExecutionName

        @Deprecated
        public static java.lang.String getXTaskExecutionName(IlrTask xtask)
        Deprecated. 
        Get the name of the task as used in the IRL to ensure its unicity in the rule set. As several rule flow may coexist in the ruleset, it si rquired that the execution name coontains the fully qualified name of the container rule flow concatenated with the name of the task.
      • getAllRulesFromTask

        @Deprecated
        public static java.util.Collection getAllRulesFromTask(IlrRuleTask ruleTask)
        Deprecated. 
        Get all the scope elements referenced by the given rule task.
        Parameters:
        ruleTask - the rule task to investigate.
        Returns:
        a collection of IlrRuleor IlrRulePackageobjects. The collection is not a copy, any modification will change the rule task.
      • getExecutableRulePackage

        @Deprecated
        public static org.eclipse.emf.ecore.EObject getExecutableRulePackage(IlrTask task)
        Deprecated. 
        Get the executable rule package enclosing the given element.
        Parameters:
        task - the task to investigate.
        Returns:
        the rule package containing the ruleflow of the task.
      • getRootTask

        @Deprecated
        public static IlrRuleFlow getRootTask(IlrTask task)
        Deprecated. 
        Get the rule flow of the given task.
        Parameters:
        task - the task to investigate.
        Returns:
        the ruleflow containing the task.
      • getAlgorithm

        @Deprecated
        public static IlrAlgorithmKind getAlgorithm(IlrRuleTask ruleTask)
        Deprecated. 
        Get the algorithm property for the given rule task.
        Parameters:
        ruleTask - the rule task to investigate.
        Returns:
        one of:
        • IlrAlgorithmKindEnum.DEFAULT
        • IlrAlgorithmKindEnum.SEQUENTIAL
      • getTaskInitialActions

        @Deprecated
        public static java.lang.String getTaskInitialActions(java.lang.Object task)
        Deprecated. 
        Get the initial actions for the given rule task.
        Parameters:
        task - either an IlrRuleFlowor an IlrTask.
        Returns:
        the text of the initial actions. Where lines are separated with platform specific line feed and or carraige return.
      • getTaskFinalActions

        @Deprecated
        public static java.lang.String getTaskFinalActions(java.lang.Object task)
        Deprecated. 
        Get the final actions for the given rule task.
        Parameters:
        task - either an IlrRuleFlowor an IlrTask.
        Returns:
        the text of the final actions. Where lines are separated with platform specific line feed and or carraige return.
      • createInstance

        public static IlrElement createInstance(org.eclipse.emf.ecore.EClass type)
        Creates a model element of the given type.
        Parameters:
        type - the type of model element.
        Returns:
        a model element which class corresponds to the given EMF type.
      • getDefaultName

        @Deprecated
        public static java.lang.String getDefaultName(IlrRuleFlow ruleflow)
        Deprecated. 
        Gets that would be generated for a model element if it would be added to the ruleflow.
        Parameters:
        ruleflow - the ruelflow in which to add the model element.
        Returns:
        a valid name for a task of the ruleflow.

© Copyright IBM Corp. 1987, 2017