ilog.rules.brl

Class IlrBRL

  • Direct Known Subclasses:
    IlrBAL


    public class IlrBRL
    extends IlrBRLSemanticContextExtension
    The base class for all semantic context extensions of business rule languages.

    It contains a set of language mechanisms common to all business rule languages.

    A sub-class of this class must be implemented and referenced by the semanticContextExtension BRL properties from the language property file when you build a custom BRL language.

    • Field Detail

      • VARIABLE_TYPE

        public static final java.lang.String VARIABLE_TYPE
        The variable node type.
        See Also:
        Constant Field Values
      • VALUE_TYPE

        public static final java.lang.String VALUE_TYPE
        The value node type.
        See Also:
        Constant Field Values
      • SENTENCE_TYPE

        public static final java.lang.String SENTENCE_TYPE
        The sentence node type.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IlrBRL

        protected IlrBRL(IlrBRLSemanticContext semanticContext)
        Constructs of a business rule language semantic context extension, invoked by the concrete language semantic context extension class.
        Parameters:
        semanticContext - The semantic context.
    • Method Detail

      • getSyntaxNodeSentence

        public static IlrSentence getSyntaxNodeSentence(IlrSyntaxTree.Node sentenceNode,
                                        IlrVocabulary vocabulary)
        Returns the sentence attached to the given node.
        Parameters:
        sentenceNode - The node.
        Returns:
        The sentence attached the given node.
      • getSyntaxNodeHolder

        public static IlrSyntaxTree.Node getSyntaxNodeHolder(IlrSyntaxTree.Node sentenceNode,
                                             IlrVocabulary vocabulary)
        Returns the node corresponding to the holder role of a sentence in the given Abstract Syntax Tree.
        Parameters:
        sentenceNode - The Abstract Syntax Tree node representing the whole sentence.
        vocabulary - The vocabulary.
        Returns:
        Returns the syntactic node corresponding to the holder role, or null if holder role is implicit in the sentence template.
      • getSyntaxNodeVariableName

        public static java.lang.String getSyntaxNodeVariableName(IlrSyntaxTree.Node node)
        Returns the name of the variable attached to the given node.
        Parameters:
        node - The node.
        Returns:
        The name of the variable attached to the given node.
      • getSyntaxNodeValueText

        public static java.lang.String getSyntaxNodeValueText(IlrSyntaxTree.Node node)
        Returns the text of the value attached to the given node.
        Parameters:
        node - The node.
        Returns:
        The text of the value attached the given node.
      • getSyntaxNodeConceptInstance

        public static IlrConceptInstance getSyntaxNodeConceptInstance(IlrSyntaxTree.Node node,
                                                      IlrVocabulary vocabulary)
        Returns the value attached to the given node.
        Parameters:
        node - The node.
        vocabulary - The vocabulary.
        Returns:
        The value attached to the given node.
      • getVariableName

        public static java.lang.String getVariableName(IlrSyntaxTree.Node variable)
        This method returns the variable name attached to the given syntax node representing a variable reference.
        Parameters:
        variable - A syntax node representing a variable reference.
        Returns:
        The name of the variable or null if the node does not represent a variable reference.
      • getBindingCardinality

        public static IlrCardinality getBindingCardinality(IlrSyntaxTree.Node binding,
                                           IlrVocabulary vocabulary)
        This method returns the variable cardinality attached to the given syntax node representing a binding node.
        Parameters:
        binding - A syntax node representing a binding.
        Returns:
        The cardinality of the variable or null if the node does not represent a binding.
      • isExternal

        public boolean isExternal(IlrBRLVariable variable)
        Checks whether a variable is considered as an external variable.

        An external variable is a ruleset parameter ruleset variable or an automatic variable.

        Parameters:
        variable - The variable to check
        Returns:
        true if the variable is considered as an external variable, and false otherwise.
        See Also:
        IlrBRLVariable

© Copyright IBM Corp. 1987, 2017