ilog.rules.vocabulary.model.bom

Interface IlrBOMVocabulary

  • All Superinterfaces:
    java.lang.Cloneable, IlrBaseElement, IlrNotifier, IlrVocabulary, java.io.Serializable
    All Known Subinterfaces:
    IlrBOMVocabularySet


    public interface IlrBOMVocabulary
    extends IlrVocabulary
    IlrBOMVocabulary defines vocabularies mapped on an IlrObjectModel.

    Code example

    The following code example shows how to return all phrase templates attached to the passed member. A member is either an attribute or a method of a BOM class.

       private String [] getTemplates (IlrMember member) {
         List list = new ArrayList ();
         IlrBOMVocabulary voc = (IlrBOMVocabulary) session.getWorkingVocabulary().getVocabulary(session.getUserLocale());
         IlrFactType ft = voc.getFactType(member);
         if (ft!=null) {
           List sentences = ft.getSentences();
           if ( (sentences != null) && (sentences.size()>0)) {
             Iterator iter = sentences.iterator();
             while (iter.hasNext()) {
               IlrSentence sentence = (IlrSentence) iter.next();
               list.add(voc.getBOMTemplate(sentence));
             }
           }
         }
         return (String []) list.toArray(new String [list.size()]);
       }
     

    • Method Detail

      • getObjectModel

        IlrObjectModel getObjectModel()
        Gets the business object model attached to this vocabulary.
        Returns:
        The BOM.
      • getFactType

        IlrFactType getFactType(IlrMember member)
        Gets the phrase (fact type) corresponding to member.
        Parameters:
        member - The member.
        Returns:
        The fact type mapped to this member.
      • getMember

        IlrMember getMember(IlrFactType factType)
        Gets the member corresponding to factType.
        Parameters:
        factType - The fact type.
        Returns:
        The member mapped to this fact type.
      • getClass

        IlrClass getClass(IlrConcept concept)
        Gets the type corresponding to concept.
        Parameters:
        concept - The concept.
        Returns:
        The type mapped to this concept.
      • getConcept

        IlrConcept getConcept(IlrClass clazz)
        Gets the concept associated to type.
        Parameters:
        clazz - The type.
        Returns:
        The type mapped to this type.
      • getConstant

        java.lang.Object getConstant(IlrConceptInstance instance)
        Gets the constant associated to instance.
        Parameters:
        instance - The concept instance.
        Returns:
        The attribute mapped to this concept instance.
      • getConceptInstance

        IlrConceptInstance getConceptInstance(IlrAttribute constant)
        Gets the concept instance associated to constant.
        Parameters:
        constant - The attribute.
        Returns:
        The concept instance mapped to this constant.
      • getBOMTemplate

        java.lang.String getBOMTemplate(IlrSentence sentence)
        Gets the BOM template of sentence.
        Parameters:
        sentence - The sentence.
        Returns:
        The BOM template.
      • setTemplate

        void setTemplate(IlrSentence sentence,
                       java.lang.String bomTemplate)
        Sets the template to the sentence, using the specified BOM template.
        Parameters:
        sentence - The target sentence.
        bomTemplate - The BOM template.

© Copyright IBM Corp. 1987, 2017