What to use instead of DocumentPersister in 2023.06

With 2023.06 DocumentPersister where removed

Document Persisters and Document Loaders are removed.Instead, com.mgmtp.a12.dataservices.document.DocumentService is introduced which combines functionally of both persisters and loaders.It serves as a single entry point to the high level document API.

Before the update we used multiple persisters to save documents without validation or computations under certain conditions. Now with the update we’ll need a new way of doing the same. IDocumentRepository seems to be suggested by the documentation:

It is possible to customize the persistence logic by implementing IDocumentRepository

but this will not work as the validation/calculation is done in the implementation of DocumentService and not part of the IDocumentRepository.

So what is the recommended way of doing this?

Should we implement our own DocumentService? Or should we deactivate calculations/validations via the configuration and computate/validate at some other point (e.g. in some event)? Or is there another way?

I think A12 always want a document should be validated.
So that, in my opinion, to handle your business logic you should create your own DocumentService.

Hi @tim-steep-bit,

There are the following configuration keys that you can use:

  1. mgmtp.a12.dataservices.documents.computation.enabledForModels takes comma separated list list of document model names for which the computation should be executed

  2. mgmtp.a12.dataservices.documents.validation.skipForModels ` takes comma separated list list of document model names for which the validation should be skipped

  3. mgmtp.a12.dataservices.documents.validation.partialForModels akes comma separated list list of document model names for which only partial validation should be executed.

Furthermore we provide a rich event based extension points where you can hook into the persistence without a need to write any persistence logic. We try to separate business requirements from the persistence requirements. The Persister concept was removed because it served no purpose because it was only a middle-layer between JSON-RPC,HTTP and repositories. Now we have introduce a server which aggregates repositories so there is no need for persisters.

If you need to customize your persistence logic please use implement IDocumentRepository the proper implementation of IDocumentRepository will be choosen automatically by DocumentService based on isSupported method of IDocumentRepository.

This answer is valid for DS versions 36.0.0 - 36.x.y

We now solved this by deactivating the automatic calculation/validation and manually validate/calculate where this is required.

To ensure no documents are saved/modified outside of our control all default A12 RPC-requests for interacting with documents are deactivated.