Skip to main content

Principle

A component's history is made up of a set of facts. Each fact logs an action performed by a user on a component and stores the following information:

NameAutomaticDescription
idyesUnique identifier
creationDateyesCompletion date
useryesIdentifier of the user who performed the operation
requestIdyesIdentifier of the request at the origin of the action
technicalyesDetermines whether the fact is technical or business
actionnoAction performed
objectIdnoObject identifier in question
objectTypenoObject type in question

Technical facts

Technical facts are generated automatically by FlowerDocs Core when a historical operation is executed. For each component category, fact logging for a given action can be enabled or disabled.

ActionDefaultDescription
createyesCreation
readnoAccess
get_contentnoContent access
updateyesUpdate
add_contentnoAdding content
delete_contentnoDeleting content
revertyesRestoring a version
deleteyesPhysical removal

To modify historical actions, the core.properties file must be modified using the default configuration:

fact.registrations.document=create,update,delete,version,revert
fact.registrations.folder=create,update,add_content,delete_content,delete
fact.registrations.virtual.folder=create,update,delete
fact.registrations.task=create,update,delete,answer,assign,add_content,delete_content

Business facts

A business fact is generated programmatically to record a particular state or action for a component. This generation must be configured or developed specifically for the situations concerned thanks to:

  • APIs exposed for each component category
  • the [ContextUtil] object(/documentation/config/core/appendices/context-util.md)

The user responsible for generating a business fact must have the ADMIN role.

In the graphical user interface, a technical fact is linked to a business fact if they have the same request identifier (requestId). Technical facts generated before and linked to a business fact are displayed in detail.

POST {core}/rest/documents/{id}/facts HTTP/1.1
token: {token}
Content-Type: application/json

"action": "custom",
"description": "Generated by REST API.,
"updatedFields": [

"name": "tag",
"value": "text

]

Custom Facts

A custom fact is created outside the product's native historical logs. It can be used by integrators to trace specific actions based on their needs. It can be:

  • A business fact : Traces a business action (e.g., creating a letter).
  • A technical fact : Traces a technical operation (e.g., integration with a CRM).

The distinction is made via a boolean, but the underlying Java object is the same. When creating custom facts via an OperationHandler, the user logged in the fact will, by default, be the administrator executing the OH. This is due to administrative privileges that ensure security and prevent unauthorized manipulation.


If you want to log the actual user who initiated the action, you can customize the description.

Example using FactBuilder:

var builder = FactBuilder.objectId(component.getId()).type('DOCUMENT');
var userDisplayName = util.getUserService().get(...).getDisplayName();
builder.action('CREATE').description(userDisplayName + ' created the document.');
util.createFact(builder.build());

History configuration

FlowerDocs provides a document class FactFieldsConfiguration that lets you simply define the tags to be historised on generated facts.

This document allows you to define:

  • the object type: DOCUMENT, TASK, VIRTUAL_FOLDER, FOLDER
  • component class identifiers
  • tag identifiers

This configuration document is accessible from the FlowerDocs administration interface: Configuration > Historical facts.