Package org.kie.api

Interface KieBase

  • All Superinterfaces:
    KieBaseEventManager

    public interface KieBase
    extends KieBaseEventManager

    The KieBase is a repository of all the application's knowledge definitions. It will contain rules, processes, functions, type models. The KieBase itself does not contain runtime data, instead sessions are created from the KieBase in which data can be inserted and process instances started.

    • Method Detail

      • getKiePackages

        java.util.Collection<KiePackage> getKiePackages()
        Returns a collection of the KiePackages that exist in this KieBase.
        Returns:
        an immutable collection of the packages
      • getKiePackage

        KiePackage getKiePackage​(java.lang.String packageName)
        Returns a reference to the KiePackage identified by the given name.
        Parameters:
        packageName - the name of the KiePackage to return
        Returns:
        the KiePackage identified by the the given name or null if package not found.
      • removeKiePackage

        void removeKiePackage​(java.lang.String packageName)
        Removes a KiePackage and all the definitions it contains from the KieBase
        Parameters:
        packageName - the name of the KiePackage to remove
      • getRule

        Rule getRule​(java.lang.String packageName,
                     java.lang.String ruleName)
        Returns a reference to the Rule identified by the given package and rule names.
        Parameters:
        packageName - the package name to which the rule belongs to
        ruleName - the name of the rule
        Returns:
        the Rule object or null if not found
      • removeRule

        void removeRule​(java.lang.String packageName,
                        java.lang.String ruleName)
        Removes a rule from the specified package.
        Parameters:
        packageName - the package name to which the rule belongs to
        ruleName - the name of the rule
      • getQuery

        Query getQuery​(java.lang.String packageName,
                       java.lang.String queryName)
        Returns a reference to the Query identified by the given package and query names.
        Parameters:
        packageName - the package name to which the query belongs to
        queryName - the name of the query
        Returns:
        the Query object or null if not found.
      • removeQuery

        void removeQuery​(java.lang.String packageName,
                         java.lang.String queryName)
        Removes a query from the specified package.
        Parameters:
        packageName - the package name to which the query belongs to
        queryName - the name of the query
      • removeFunction

        void removeFunction​(java.lang.String packageName,
                            java.lang.String functionName)
        Removes a function from the specified package.
        Parameters:
        packageName - the package name to which the function belongs to
        functionName - the name of the function
      • getFactType

        FactType getFactType​(java.lang.String packageName,
                             java.lang.String typeName)
        Returns a reference to the FactType identified by the given package and type names.
        Parameters:
        packageName - the name of the package the fact belongs to
        typeName - the name of the type
        Returns:
        the FactType identified by the parameters or null if not found.
      • getProcess

        Process getProcess​(java.lang.String processId)
        Returns a reference to the Process identified by the given processId
        Parameters:
        processId - the id of the process
        Returns:
        the Process identified by the given processId or null if process not found.
      • removeProcess

        void removeProcess​(java.lang.String processId)
        Removes a process.
        Parameters:
        processId - the id of the process
      • getProcesses

        java.util.Collection<Process> getProcesses()
        Returns a collection of the Processes that exist in this KieBase.
        Returns:
        an immutable collection of the processes
      • getKieSessions

        java.util.Collection<? extends KieSession> getKieSessions()
        Returns a collection of the KieSessions that exist in this KieBase. Be careful as sessions are not thread-safe and could be in use elsewhere.
        Returns:
        a Collection of KieSessions
      • getEntryPointIds

        java.util.Set<java.lang.String> getEntryPointIds()
        Returns the set of the entry points declared and/or used in this kie base
        Returns:
        a Set of entry points