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

Uit de specs

As project, I want to be able to keep my old dossier entries when replacing the dossiermanager with the new aggregate functionality.

Introduction

In 9.4 we introduced aggregates to

replace the existing dossier manager. Projects

are now more and more enthusiastic about this feature. From one project we know

that

they only want to use it, when

use the dossier manager, the existing dossier entries from the production environment

can

to be migrated to

the new aggregate solution

aggregates. This migration needs to be easy and configurable. For instance because a dossier will be split into more aggregates or because 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.

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

Panel

In this How-to

Table of Contents

Id is not relevant

  • A project that wants to migrate
story concerns this content migration. We are not going to migrate the model, as this is not possible. This story makes migration of dossiers to aggregates possible, by modeling.A large part of the migration is a guideline of how to do it, and the product changes required are minimal.
The idea is that a project
  • has to make an exposed migration flow.
  • In this flow you first call the AQ_DossierManager to load the existing dossier into the profile.
  • The
second
  • next step is to use the AQ_Aggregate_Create service to create a new aggregate entry. Like this, a project can define itself exactly how dossiers are migrated, extra metadata can be added, dossiers can be split, etc.
This
  • The flow is exposed, and should be called for every dossier
ID
  • Id in the database. It can be passed as parameter in the URL, and retrieved from there with the BB_SetRequestParameters service.
  • The code to query the dossier database, to select the applicable
IDs
  • Ids, and passing them one by one to the exposed flow is left to the project.
So far, no development by us has to be done.There is one problem though. The old dossier Id might be different than the newly created aggregate Id.

Id is relevant

  • 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), we would
need to update all those Ids, which is not nice. We rather would
  • like to start with an empty aggregate database, and use aggregate Ids that match the
same
  • Ids as for the dossiers.
  • For this, a
new
  • service is available, AQ_Aggregate_Migrate.

Specifications

  • A new service is created This is a copy of the AQ_Aggregate_MigrateThis is a copy of Create service and has the same parameters than the AQ_Aggregate_Create service, with one addition: a parameter called DossierIdInput.
  • It This is not part of the aggregate pluginThis , 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.
  • You may even go so far and convert it to .Net by hand, and not add it to the .Net conversion scripts.
  • .
  • This parameter DossierIdInput This service has the same parameters than the AQ_Aggregate_Create service, with one additionA new parameter is added, called DossierIdInputIt is of type expression The expression and should return an integer
  • At runtime, the new aggregate entry is created under this Id
  • Any unexpected behavior, results in an error at runtimeFor example that the supplied a positive integer. If not, an error is thrown. If the Id already exists, or is a negative number
Uit de mail
  • an error is thrown.

 

Wij zijn idd aan het werken aan functionaliteit welke de overgang makkelijker gaat maken. Deze wil ik graag aan je toetsen. Er komt natuurlijk nog een uitgebreide handleiding over hoe dit zou moeten.
 
We maken een nieuwe AQ_Aggregate_Migrate service, welke hetzelfde doet als de create service, maar je kan zelf het id bepalen van de nieuwe entry in de db (error als al bestaat). Om nu alle dossiers in 1 klap over te zetten naar aggregates, ga je dus een flow maken, waarin je met de dossier manager een dossier met ID X inlaadt, en deze dan als aggregate met hetzelfde ID X wegschrijft. Door de IDs hetzelfde te houden hoeven referenties naar dat ID in externe modules/systemen niet geupdate worden. Door het zo te doen, kan je dus evtl ook een dossier splitsen in meerdere aggregates als je dat zou willen, of extra meta data toevoegen welke je nu niet hebt met de dossiermanager. Nu moet je nog deze flow aanroepen voor elk dossier dat je hebt, en het ID parsen als onderdeel van de URL. Dat kan je via de BB_SetRequestParameters service binnen halen. Wij kunnen geen generieke code maken welke voor je over de dossierdatabase loopt en de url aanroept, omdat hier te veel project specifieke keuzes in zitten. Je hebt bij voorbeeld verschillende dossier types in je database, en dan moet voor elk dossier type een andere migratie flow aangeroepen worden. Dus dat is dan het enige wat je zelf zou moeten doen. Deze migratie is dus niet lazy, en kan in 1 keer gebeuren.
 
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.

Step-by-step guide

  •  

  • UI Text Box
    typenote

     

    UI Expand
    titleRelated articles

    Content by Label
    showLabelsfalse
    max5
    spacesBKB
    sortmodified
    showSpacefalse
    reversetrue
    typepage
    labelsaggregate dossier migration

     

    Include Page
    _survey
    _survey