ilog.rules.engine

Class IlrRulesetArchiveBuilder

    • Constructor Detail

      • IlrRulesetArchiveBuilder

        public IlrRulesetArchiveBuilder(IlrReflect reflect)
        Creates an IlrRulesetArchiveBuilder. The given reflect must be of the right type, that means that for IRL code based on a business object model, the reflect must be business. The built archive is persisted in memory.
        Parameters:
        reflect - A reflect.
    • Method Detail

      • reset

        public void reset()
        Resets the archive builder. It can be used again to generate a new archive with another content if the reflect given for the construction is still the right reflect.
        Overrides:
        reset in class IlrRulesetArchiveBuilderBase
      • addRulesetParameterEntry

        public void addRulesetParameterEntry(IlrRulesetParameter param)
        Adds a ruleset parameter to the ruleset archive. This ruleset parameter is part of the ruleset signature, which is stored in the archive in XML format.
        Parameters:
        param - The modelling of the ruleset parameter.
      • addVariableEntry

        public void addVariableEntry(java.lang.String pkgName,
                            IlrRulesetParameter parameter)
        Adds a package variable to the ruleset archive. The variables will be stored in a IlrRulesetArchive.VARIABLES file in the directory which name is the passed package name.
        Parameters:
        pkgName - The name of the package in which the variable is defined.
        parameter - The modelling of the package variable.
      • addPropertyType

        public void addPropertyType(java.lang.Object type,
                           java.lang.String pptyName)
        Declares the type of the property. The type can be either an IlrType or IlrHierarchicalProperty that models a hierarchical property.
        Parameters:
        type - The property type.
        pptyName - The property name.
      • addPropertyType

        public void addPropertyType(java.lang.String hierarchicalPpty,
                           java.lang.String pptyName)
        Declares the type of the property; the type is necessarily a hierarchical property. It is designated by its name (the name of the hierarchical property). This hierarchical property must has been previously declared or else an error occurs.
        Parameters:
        hierarchicalPpty - The type name (must correspond to a hierarchical property).
        pptyName - The property name.
      • declareHierarchicalProperty

        public void declareHierarchicalProperty(java.lang.String pptyName,
                                       java.lang.String rootName)
        Declares a hierarchical property with the given name and root. This hierarchical property must be unique, or else an error occurs.
        Parameters:
        pptyName - The name of the hierarchical property.
        rootName - the name of the hierarchical property root.
      • fillHierarchicalProperty

        public void fillHierarchicalProperty(java.lang.String pptyName,
                                    java.lang.String parentPath,
                                    java.util.ArrayList children)
        Fills a property hierarchy, by giving the list of its children for a node. The children are designated by their name, and the node is designated by its path from the root. For example, for the following property:

            World {
              USA {
                California
              }
              Europe {
              }
            }
         

        To add the children Los Angeles and San Francisco to the California node, we need to call: fillHierarchicalProperty("Geography","World/USA/California",list) where list contains "Los Angeles" and "San Francisco."

        Parameters:
        pptyName - The name of the property we are defining.
        parentPath - The path from the root of the node to which the children will be added.
        children - The list of the child names to add to the node.
      • declareOverriding

        public void declareOverriding(java.lang.String fatherGroup,
                             java.util.ArrayList children)
        Declares a rule overriding between the group passed as the first parameter and the groups listed in the passed list. This declaration means that when rules of the group fatherGroup are present in a rule based task at the same time as rules defined in one of the listed groups, the latest rules are overriden by the first: they are 'removed' from the task.
        Parameters:
        fatherGroup - The group name whose rules overrides the rules of the groups specified in the second argument.
        children - A list that contains the names of the groups whose rules are overriden by the rules of the first parameter.
      • setRulesetPropertiesEntry

        public void setRulesetPropertiesEntry(java.io.InputStream properties)
        Sets the ruleset properties. The given code is IRL code of the following form, for example:

            ruleset r
            {
               property rulesetProp = "the property";
            }
         

        The given stream is closed after its content has been archived.

        Parameters:
        properties - The ruleset properties to set.

© Copyright IBM Corp. 1987, 2017