ilog.rules.vocabulary.model

Interface IlrFactType

  • All Superinterfaces:
    IlrBaseElement, IlrBusinessArtifact, IlrNotifier, IlrVocabularyElement, java.io.Serializable


    public interface IlrFactType
    extends IlrBusinessArtifact
    This interface defines the fact types of a vocabulary.

    A fact type represents the semantic link between two or more concepts. Each concept plays a role in this fact type (see IlrRole). A fact type always contains a specific role called holder role which represents the concept that holds this fact type.

    The fact type contains sentences. A sentence is a verbalized representation of a fact type. It corresponds to the phrase templates that are used for verbalization in the BOM Editor.

    When the vocabulary is based on a business object model (IlrObjectModel), a fact type is mapped to an IlrMember. The name of the fact type is the signature of the BOM member. The holder role designates the concept corresponding to the declaring class of the BOM member.

    A fact type is uniquely identified in a vocabulary by its identifier, which is composed of the identifier of the holder concept, followed by a slash '/', followed by the name of the fact type.

    • Method Detail

      • getSentences

        java.util.List getSentences()
        Gets the list of all sentences handled by this fact type.
        Returns:
        The list of all sentences of this fact type.
      • getRoles

        java.util.List getRoles()
        Gets the list of roles involved in this fact type.
        Returns:
        The list of roles.
      • getRole

        IlrRole getRole(int index)
        Gets the role at a given index.
        Parameters:
        index - The index of the role.
        Returns:
        The role at the given index, or null if no role was found at this index.
      • getSentence

        IlrSentence getSentence(java.lang.String name)
        Gets a sentence by its identifier.
        Parameters:
        name - The name of the sentence.
        Returns:
        The sentence found, or null if no sentence was found.
      • addSentence

        IlrSentence addSentence()
        Creates and adds a new sentence to this fact type.
        Returns:
        The newly added sentence.
      • addRole

        IlrRole addRole()
        Adds a new role to this fact type. The newly added role returned by this method is not linked to any concept. You then need to link the concept to the role with the method setConcept.
        Note: the added role is not considered as a holder role. You can use the method setHolderRole to set it as a holder role.
        Returns:
        The newly added IlrRole.
      • addRole

        IlrRole addRole(IlrConcept concept)
        Adds a new role to this fact type, and links it to the specified concept. The new role is inserted at the end of the list of roles.
        Note: the added role is not considered as a holder role. You can use the method setHolderRole to set it as a holder role.
        Parameters:
        concept - The concept to be linked to the role.
        Returns:
        The newly added IlrRole.
      • addHolderRole

        IlrRole addHolderRole(IlrConcept concept)
        Adds a new role to this fact type, links it to the specified concept, and sets this new role as the holder role of the fact type. If there was already a holder role, it becomes a regular role. The new role is inserted at the end of the list of roles.
        Parameters:
        concept - The concept to be linked to the role.
        Returns:
        The newly added IlrRole.
      • getHolderRole

        IlrRole getHolderRole()
        Returns the holder role of this fact type.
        Returns:
        The holder role.
      • removeSentence

        void removeSentence(IlrSentence sentence)
        Removes the specified sentence from this fact type.
        Parameters:
        sentence - The sentence to remove.
      • removeRole

        void removeRole(IlrRole role)
        Removes the specified role from this fact type.
        Parameters:
        role - The role to remove.
      • addSentence

        void addSentence(IlrSentence sentence)
        Adds the specified sentence to this fact type.
        Parameters:
        sentence - The sentence to add.
      • addRole

        void addRole(IlrRole role)
        Adds the specified role to this fact type. The new role is inserted at the end of the list of roles.
        Parameters:
        role - The role to add.
      • addRoleAt

        void addRoleAt(IlrRole role,
                     int index)
        Adds a role to this fact type at the specified index. All following roles will have incremented indexes.
        Parameters:
        role - The role to add.
        index - The index where the role needs to be inserted.
      • setHolderRole

        void setHolderRole(IlrRole role)
        Sets the holder role of this fact type. If the specified role is null, then the holder role attribute is unset. In this state, the fact type has no holder role and will be lost when serializing the vocabulary. You must then set a new holder role to this fact type.
        Parameters:
        role - The holder role.

© Copyright IBM Corp. 1987, 2017