Skip to main content
Version: v2026.0.0

Operation

Principle

The Operation API reacts to the execution of operations within FlowerDocs Core. An operation is an action performed by a user on a component.

The operations managers (or com.flower.docs.operation.api.OperationHandler) are called when an operation is executed to react to it and apply specific processing. They can be called before (pre-processing) or after (post-processing) the execution of the operation.


The execution of an operation can be divided into three phases:

  1. The OperationHandler recorded in the pre-processing phase are called
  2. The Operation is executed
  3. The OperationHandler recorded in the post-processing phase are called
info

The following steps may be interrupted by an exception raised by an operation handler, if this behavior is enabled.

Registration

In order for an operation manager to react to the execution of an operation, it must be registered. Registering an operation manager involves creating a configuration document of class OperationHandlerRegistration.

The registration defines the type of operations to which the manager must react by configuring a (creation, update...) and a . Its (before or after) indicates whether the manager should react before or after execution of the operation.


In addition, the registration determines whether the reaction to the execution of an operation is synchronous or asynchronous (executed in another thread so as not to block the operation performed by the user).


To limit the number of calls, it is possible to define an execution filter that FlowerDocs will resolve to trigger or not the call to the operation manager depending on the context.


The fields on which filters can be applied depend on the chosen. Here is an exhaustive list :

  • Document, folder and virtual folder : tag list, component class
  • Tasks : tag list, component class, assigned user, process identifier
  • Task class : identifier, process identifier
  • Others : identifier

Via the administration interface, it is possible to select other fields (for example on administration components), but they will not be taken into account.

OperationHandler

An OperationHandler is a code fragment called when an operation is executed. They can be divided into two categories:


To contextualize their execution, an object com.flower.docs.operation.api.OperationContext is provided as input. The context can be used to retrieve information concerning the execution of the operation, such as the component concerned or the modifications made.