Page History
Info | ||||
---|---|---|---|---|
| ||||
AQ_Aggregate_Read is used for loading a stored Aggregate (Studio) into into the profile based on a (known) Aggregate Id |
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 | trueYes |
AggregateId | Input | The attribute that holds the Id of the aggregate you want to read. | Expression resulting in an integer | Single valued | trueYes |
VersionIDInput | Bidirectional | The Id of the version to read. | Expression resulting in an integer | Single valued | falseNo |
VersionIDOutput | Output | The attribute on which the Id of the version that is to be read will be stored. | Attribute | Single valued | falseNo |
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 | falseNo |
How to - find the AggregateId
The AggregateId of the desired Aggregate can be found for example using a [Editor] 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:
...
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.
Service call definition | |||
Aggregate definition | Service definition |