As mentioned in the chapter about searching for aggregates in the Persistency Management guide, searching for aggregates may not always be designed in the same manner. Four strategies are discussed there.
This How to article focuses on the strategy of searching for aggregates with the AQ_Aggregate_Search service.
A simple example is used about a music database with one aggregate type: Musician. What entities and endogenous relations this aggregate might have, is not important. It suffices to know that the standard meta data consists of
The custom meta data consists of
Shown below is the screen for the AQ_Aggregate_Search service.
Note that normally, the value of the expression (here "Beatles") will be determined by user input by means of an attribute that is filled in by a user at runtime. |
In Service call type: AQ_Aggregate_Search all parameters are discussed. In this article, the focus is on the following parameters:
Below four use cases are discussed, by explaining which parameters to use with which configuration. Also the outcome of the search service is predicted. With these use cases, a business engineer should be able to model all types of searches.
Search for all Beatles, I only want to know what their names are now |
Band = "Beatles"
Control
is singletonControl.AggregateId
is multivaluedControl.VersionId
is omittedControl
will have the following values Control.AggregateId
has value [1,2,3,4]Control.VersionId
has value unknown
Search for musician 14, I want to know all his/her names |
MusicDbNr= 14
Control
is singletonControl.AggregateId
is single valuedControl.VersionId
is multivaluedControl
will have the following valuesControl.AggregateId
has value 3Control.VersionId
has value [1,2]Search for musician Bob Dylan, I know there is only one Bob Dylan and I want the latest version |
Full name = "Dob Dylan"
Control
is singletonControl.AggregateId
is single valuedControl.VersionId
is omittedControl
will have the following valuesControl.AggregateId
has value 5Control.VersionId
has value unknown
Control.AggregateId
is single valued.Control.VersionId
could be used as a parameter for that.Search for all Beatles, I want to know what all their names (past and present) |
Band = "Beatles"
Control
is multitonControl.AggregateId
is single valuedControl.VersionId
is single valuedControl.AggregateId
has value 1Control.VersionId
has value 1Control.AggregateId
has value 1Control.VersionId
has value 2Control.AggregateId
has value 2Control.VersionId
has value 1Control.AggregateId
has value 3Control.VersionId
has value 1Control.AggregateId
has value 3Control.VersionId
has value 2Control.AggregateId
has value 4Control.VersionId
has value 1