I’m new axonframework user, using latest version 3 user, and i try to understand some basic concepts.
I have following model:
B, C and D other aggregates with following associations:
A-- * B ( A holds a Set of B aggregates)
B aggregate (@aggregateMember)
- other fields
I want following workflow;
step 1- createACommand (name, creationDate) => return A.ID
step 2 createBCommand
step 2a createCcommand(…) => get C.ID
step 2b createDCommand(…) => get D.ID
step 3- createB(amount, C.ID, D.ID) -> get B.ID
step 4- addBtoA (B.ID, A.ID) -> BAddedToAEvent
step 3: a business event which will trigger D.computeValue() on D aggregate
I have 2 questions:
1- how to get back a child aggregate Identifier (such as C.ID, D.ID ) after a command completion triggered from rootAggregate A ?
can a command return an ID ? Or can i just add ID getter in each aggregate ?
2- How to navigate to D child aggregate and invoke an update operation such as D.computeValue() method call to update D’s state ?