I have a project developed using Domain driven design principles. It is CQRS based using axon framework. I have a scenario where I need where on a particular command I need to generate a document in the aggregate using aggregate's state. I do not need to store the id of the generated document in the aggregate. But I need to publish an event from the aggregate with the id of the generated document because another domain needs that id.
Is it a good practice to fire a command not for updating aggregate state, but for doing some processing and publishing event for updating other aggregate?
Also is it a good practice to publish an event from aggregate not for sourcing, only for updating another domain?