Klasse PerformStorageQuery

java.lang.Object
org.obrel.core.RelatedObject
org.obrel.core.SerializableRelatedObject
Alle implementierten Schnittstellen:
Serializable, org.obrel.core.Relatable

public class PerformStorageQuery extends ProcessStep
A process step that performs an arbitrary storage query and places the result in a certain target parameter. This step can be invoked until the last object that fulfills the query has been read. After that the target parameter will contain NULL and the query objects will be closed. The query objects will be stored in the parameters StorageRelationTypes.STORAGE_QUERY and StorageRelationTypes.STORAGE_QUERY_RESULT. Therefore these parameters must not be used by other steps or objects before the query loop has been completed.

The following parameters must or can be set:

  • StorageRelationTypes.STORAGE_QUERY_PREDICATE: the query predicate to use for the storage query.
  • ProcessRelationTypes.TARGET_PARAM: The parameter to store the query result objects in. It is the responsibility of the application that creates the step to make sure that the result type of the query and the target type are compatible or else this step or subsequent process steps will fail.

The parameter ProcessRelationTypes.PROGRESS will be incremented with each queried entity.

Siehe auch:
  • Felddetails

    • QUERY_PROGRESS_FORMAT

      public static final org.obrel.core.RelationType<de.esoco.lib.expression.Function<Object,String>> QUERY_PROGRESS_FORMAT
      An optional reference to a parameter that stores the query size
  • Konstruktordetails

    • PerformStorageQuery

      public PerformStorageQuery()
      Creates a new instance.
  • Methodendetails

    • canRollback

      protected boolean canRollback()
      Beschreibung aus Klasse kopiert: ProcessStep
      This method must be overridden by subclasses that support a rollback of their processing. If it returns TRUE the step must also implement the method ProcessStep.rollback() with the rollback functionality.

      This default implementation always returns FALSE.

      Setzt außer Kraft:
      canRollback in Klasse ProcessStep
      Gibt zurück:
      TRUE if the step implementation support a rollback
      Siehe auch:
    • cleanup

      protected void cleanup()
      Closes the query, releases the storage, and removes the query parameters from the process.
      Setzt außer Kraft:
      cleanup in Klasse ProcessStep
      Siehe auch:
    • execute

      protected void execute() throws de.esoco.storage.StorageException, ProcessException
      Beschreibung aus Klasse kopiert: ProcessStep
      Executes the process step. This method must be implemented by subclasses to provide the functionality of the process step. in case of errors The implementation may throw any kind of exception. The Process class will catch any Throwable that is thrown from this method.
      Angegeben von:
      execute in Klasse ProcessStep
      Löst aus:
      de.esoco.storage.StorageException
      ProcessException
      Siehe auch:
    • isQueryInitialized

      protected boolean isQueryInitialized()
      Checks whether the storage query is already initialized.
      Gibt zurück:
      TRUE if the query is initialized
    • rollback

      protected void rollback()
      Beschreibung aus Klasse kopiert: ProcessStep
      Must be implemented by a subclass if it can perform a rollback of a previous execution. It is guaranteed by the framework that this method will only be invoked after the step has been executed already. It is intended mainly for interactive processes that stop execution at certain (interactive) steps and can be rolled back to previous such steps. A step implementation that supports rollback must return TRUE from it's overridden ProcessStep.canRollback() method.

      A successful rollback must leave this step in a state that allows it and the following steps in the enclosing process to be executed again . On re-execution, the method ProcessStep.prepareParameters() will be invoked again too before execution. Basically, after a rollback the parameters of the enclosing process should be in the same state as they had been before the execution of this step.

      This default implementation always throws a ProcessException stating that a rollback is not supported.

      Setzt außer Kraft:
      rollback in Klasse ProcessStep
      Siehe auch: