Interface IlrDTExpressionInstance

  • All Superinterfaces:
    Cloneable, DTTimeStampable, IlrDecorableElement, IlrDTElement, IlrDTExpression, IlrDTExpressionText, Serializable
    All Known Implementing Classes:
    ExpressionInstance

    public interface IlrDTExpressionInstance
    extends IlrDTExpressionText
    IlrDTExpressionInstance represents an expression instance. An expression instance points to:
    • An expression definition which defines its pattern, that is an expression with placeholders.
    • A list of expression parameters. These parameters contain the values of the definition placeholders.

    In a DT model, an expression instance is used in a condition or an action. It is represented as a cell in a decision table, a condition link, or an action in a decision tree.

    An expression instance is parsed in the context of its expression manager. If the expression is invalid, syntax and semantic errors are collected in the expression error manager or in the error managers of the expression parameter.

    Do not implement this expression outside the DT framework.

    Since:
    JRules 7.0
    • Method Detail

      • getDefinition

        IlrDTExpressionDefinition getDefinition()
        Returns the definition associated with this expression instance.
        Returns:
        The definition. This method cannot return null.
      • getExpressionSyntaxNode

        IlrSyntaxTree.Node getExpressionSyntaxNode​(int index)
        If this expression has a syntax tree, the syntax node corresponding to a specific index is returned.
        Parameters:
        index - The place to retrieve the node from.
        Returns:
        A syntax node.
      • getParameters

        List<IlrDTExpressionParameter> getParameters()
        Returns the list of expression parameters associated to this expression instance. This object contains one expression parameter per expression definition placeholder.
        Returns:
        The list of expression parameters. The list returned cannot be null.
        See Also:
        IlrDTExpressionDefinition
      • getParameter

        IlrDTExpressionParameter getParameter​(int index)
        Returns the expression parameter at a specific index.
        Parameters:
        index - This parameter corresponds to the index placeholder in the expression definition.
        Returns:
        The expression parameter. If index is out of range, null is returned.
      • setParameterText

        void setParameterText​(int index,
                              String text)
        Sets the text of the expression parameter at a specific index. If index is out of range, nothing is done.
        Parameters:
        index - The place in this object to set text.
        text - The text to set at index.
      • getSyntacticRole

        IlrSyntacticRole getSyntacticRole​(IlrDTExpressionParameter param)
        Returns the syntactic role that corresponds to an expression parameter instance. The syntactic role is returned if:
        • The expression definition represents a sentence.
        • The param argument is mapped to the sentence.
        Parameters:
        param - The expression parameter to match.
        Returns:
        A syntactic role. If the criteria are not matched, null is returned.
      • getLocalErrorManager

        IlrDTErrorManager getLocalErrorManager()
        Returns the error manager used to store errors local to this instance.
        Returns:
        The local error manager. This error manager does not contains errors in the expression parameters. The returned value cannot be null.