Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

In Blueriq aggregates are the out of the box way to realize persistency. These aggregates will replace the existing dossier manager. Projects that use the dossier manager , might want the existing dossier entries from the production environment to be migrated to aggregates. This migration needs to be easy and configurable. For Configurable for instance because a dossier will be split into more aggregates or because migration needs to be done lazily. Another possibility is that the Id of the aggregate needs to be the exact Id of the dossier, since the Id might play a role in other parts of the application.

Panel

In this How-to

Table of Contents

Panel

In this How-to

Table of Contents

This how-to concerns this content migration, by modeling a flow that migrates a dossier to an aggregate.

Three scenarios will be discussed.

Id is not relevant

When dossiers need to be migrated to aggregates and the Id of the newly created aggregates is not relevant in other parts of the model, follow these steps:

  • A project that wants to migrate has to make an exposed migration flowcreate a Baas or custom service.
  • This service should be called for every dossier Id in the database.
  • In this flow you first service you then call the AQ_DossierManager to load the existing dossier into the profile.
  • The next step is to use the AQ_Aggregate_Create service to create a new aggregate entry. Like this, a project team can define itself exactly how dossiers are migrated, extra metadata can be added, dossiers can be split, etc.The flow is exposed, and should be called for every dossier Id in the database. It can be passed as parameter in the URL, and retrieved from there with the BB_SetRequestParameters service.
Info

The code to query the dossier database, to select the applicable Ids, and passing them one by one to the exposed flow is left to the project team.

Id is relevant

When dossiers need to be migrated to aggregates and the Id of the newly created aggregates is relevant in other parts of the model, follow these steps:

  • A project that wants to migrate has to make an exposed migration flow.
  • In this flow you first call the AQ_DossierManager to load the existing dossier into the profile.
  • As the dossier Id might be stored in many surrounding systems (such as in the profile of the process engine), it is necessary to start with an empty aggregate database and use aggregate Ids that match the dossier Ids.
  • For this, a service is available, AQ_Aggregate_Migrate.
  • This is a copy of the AQ_Aggregate_Create service and has the same parameters than the AQ_Aggregate_Create service, with one addition: a parameter called DossierIdInput.
  • It is not part of the aggregate plugin, nor is not included in the standard package delivered to projects. Projects need to ask for the dll or jar when they want to migrate.
  • This service should not be included in the regular model, and only used once for migrating.
  • This parameter DossierIdInput is of type expression and should return a positive integer. If not, an error is thrown. If the Id already exists, an error is thrown.

Lazy migration

Als je het lazy zou willen, zou dat dus in je model zelf kunnen regelen. Dus zolang je geen aggregate ID hebt lees je een dossier in en schrijf je een aggregate weg en verwijder je het dossier. Als je wel al een aggregate id hebt, lees je het aggregate id gewoon in. Ik zou dan echter niet de migrate service willen gebruiken, maar gewoon de create, omdat je toch al op productie draait, zou je dan alle IDs kunnen updaten naar een nieuw ID. Je zult dan zien dat in de loop der tijd je dossiers minder en minder worden. Wat ik wat minder mooi vindt is dat dit migratie model dan gewoon op productie staat, en daar best een tijd moet blijven staan.

Include Page_survey_surveyplease contact support about the possibilities.