Interface DataSource<T>

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static <T> DataSource<T> create​(T... items)
      Creates a DataSource, optionally containing some items
      void delete​(Object object)
      Deletes the given object from this DataSource
      void delete​(org.kie.api.runtime.rule.FactHandle handle)
      Deletes the fact for which the given FactHandle was assigned
      org.kie.api.runtime.rule.FactHandle insert​(T object)
      Inserts a new fact into this DataSource
      void update​(org.kie.api.runtime.rule.FactHandle handle, T object, String... modifiedProperties)
      Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method.
    • Method Detail

      • insert

        org.kie.api.runtime.rule.FactHandle insert​(T object)
        Inserts a new fact into this DataSource
        Parameters:
        object - the fact to be inserted
        Returns:
        the fact handle created for the given fact
      • update

        void update​(org.kie.api.runtime.rule.FactHandle handle,
                    T object,
                    String... modifiedProperties)
        Updates the fact for which the given FactHandle was assigned with the new fact set as the second parameter in this method. It is also possible to optionally specify the set of properties that have been modified.
        Parameters:
        handle - the FactHandle for the fact to be updated.
        object - the new value for the fact being updated.
        modifiedProperties - the list of the names of the object's properties modified by this update.
      • delete

        void delete​(org.kie.api.runtime.rule.FactHandle handle)
        Deletes the fact for which the given FactHandle was assigned
        Parameters:
        handle - the handle whose fact is to be retracted.
      • delete

        void delete​(Object object)
        Deletes the given object from this DataSource
        Parameters:
        object - the object to be deleted.
      • create

        static <T> DataSource<T> create​(T... items)
        Creates a DataSource, optionally containing some items
        Parameters:
        items - the items contained in the DataSource.