Versions Compared

Key

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

...

As it is important that also system set attributes are indexed, this cannot be a database operation, and a filled runtime profile is needed. For filling the runtime profile, a migration flow is needed that loads the needed information so that the rule engine can derive all values. Once that is done, a service is needed to indicate that the current profile should be indexed, and that it belongs to an existing aggregate. The AQ_Aggregate_Update service with the CreateNewVersion to FALSE is sufficient for this in most scenarios. These scenarios are

  • Versioning on aggregates is not used, and there always is only one version for each aggregate Id.
  • Versioning is used, and you want to update the index for the newest version.

The scenario in which this service does not suffice is that you want to re-index older versions of an aggregate. This can be needed as an specific old version of an aggregate can be referenced from another aggregate. Re-indexing the old aggregate version has to be conscious choice, and you might wish to keep the old index like it is for that versions. An aggregate that was created in an old version and indexed using the logic that was valid at that moment of time. This can be a reason for only re-indexing the most recent version of aggregates.

In case that you want to re-index older versions of existing aggregates, we We have created a special service that allows you to just index aggregates without updating them in the database. The first step is to create the service definition in studio, and then call it in an appropriate flow. This service is useful for aggregates for which versioning is used. The new migration service marks the aggregate as changed, without actually creating a new version. You could use

In the next section the steps that are needed to use the migration service are described. These steps can be skipped if you are not interested in the scenario in which this service is useful, and you can use the AQ_Aggregate_Update instead. The last section of this article describes how to model the flow which you need to model for indexing aggregates.

Step-by-step guide to add the migration service

UI Text Box
typeinfo

This service is not a standard service, and it is not part of the AquimaLibrary. You have to ask for the code at support@blueriq.com and add the definition to the globals manually.

 

Step-by-step guide to add the service

  1. In Studio add a custom service named AQ_Aggregate_Index_Migrate
  2. The service definition looks like this:


  3. The aggregateId is always required.
    The aggregate version is optional. In case this is not specified, the latest version of an aggregate will be indexed.
     

    We need a service that is able to update an aggregate. This service has the following parameters:

     

    ParameterDirectionValueData TypeDescriptionFill
    AggregateTypeInputModule ElementAggregateSelect the aggregate that you want to update.Required
    AggregateIDInputExpressionIntegerPlease provide the attribute containing the ID of the aggregate entry to index.Required
    AggregateVersionInputExpressionIntegerIf a specific version of the aggregate needs to be updated. If not provided then the latest one is updated.Optional
    StoreInstancesInputExpressionEntitySpecify the starting point instance(s) used for storage.Optional

     

    Event NameEvent TypeDescription
    AppExceptionCancelThe service takes this exit if indexing failed for some reason.


...

  • A project that wants to index the aggregates has to create an exposed migration flow.
  • This flow should be called for every aggregate Id in the database. It can be passed as a parameter in the URL, and retrieved from there with the BB_SetRequestParameters service.
  • In this flow you then call the AQ_AggregateRead to load the existing aggregates into the profile.
  • The next step is to use the AQ_Aggregate_Index_Migrate service or AQ_Aggregate_Update service to add the aggregate index.

...

UI Text Box
typeinfo

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.

...