You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.
This service will read an aggregate based on an aggregate type and Id. This service consults the database of stored aggregates. It will load the entry with the provided Id. If the Id is not present in the database, the IDError exit is taken. Otherwise, the aggregate entry is loaded into the profile. In case of versioned aggregates, this service will read the aggregate based on aggregate Id in combination with version Id.
Parameters
Name | Direction | Description | Type | Occurrence | Required |
---|---|---|---|---|---|
AggregateType | Input | Select the aggregate you want to read. This is a list of the aggregates definitions. | Aggregate | Single valued | true |
AggregateId | Input | The attribute that holds the Id of the aggregate you want to read. | Expression resulting in an integer | Single valued | true |
VersionIDInput | Bidirectional | The Id of the version to read. | Expression resulting in an integer | Single valued | false |
VersionIDOutput | Output | The attribute on which the Id of the version that is to be read will be stored. | Attribute | Single valued | false |
TargetInstance | Output | The instance on which the Id of the version that is to be read will be stored in the attribute mentioned in VersionIDOutput. | Expression resulting in an instance | Single valued | false |
How to - find the AggregateId
The AggregateId of the desired Aggregate can be found for example using a Service call type: AQ_Aggregate_Search or by displaying a Container type: AQ_Aggregate_List containing a Button.
Existing instances
When a singleton instance is present in the profile and an aggregate is read which holds this instance, the instances are merged. The merging rules are as follows:
- When an attribute is filled in the profile and the same attribute is empty in the loaded aggregate, the value of attribute in the profile is kept.
When an attribute is empty in the profile and the same attribute is filled in the loaded aggregate, the value of read attribute is used.
When an attribute is filled in both the profile as well as the aggregate, the read aggregate entry overrides the profile entry.
For each instance of a multiton, an instance is created. This means that instances of multitons are not merged, which has consequences when reading aggregates with multitons. Most likely, the profile must be cleared before reading such an aggregate.
Static instances have the same merge behavior.
Events
This service uses default events for a commit and for an exception. The IDError
exit should be mapped to a custom event and will be triggered when the given AggregateId cannot be found.
The Unauthorized
exit is triggered when the user does not have one of the roles that is set on the aggregate definition.
Example
Below an example is given for a read service with versioning.
ER diagram | Aggregate definition |
Service definition |
1 Comment
Unknown User (e.marcelis)
In Blueriq Knowledge Base Persistency Management guide#Versioning there is a part describing reading versioned aggregates. It says: "When reading a versioned aggregate entry, it is possible to skip the version Id as input, but specify it as output. This means that the aggregate read service will read the latest version of the aggregate entry and tell us which version this actually is."
If this is the case I would like to add it to this documentation about AQ_Aggregate_Read too.