Am allowed to add business login inside event source method (@ @EventSourcingHandler annotated method)? I don’t mean validation but some calculation ? or just mutate the aggregate?
Can I also dispatch an event from event source method?
Yes, you should add business logic inside your event sourcing handler method if you need to compute a state change of your aggregate so that it is up-to-date for your next command handler method business logic (where you put your validations and stuff).
Could you please explain a little bit why you want to “raise” an event within an event sourcing handler? And by “raise” do you mean to apply or publish an event?
Say I have calculation inside an event sourcing function that update the aggregate state. Also the state require other event to be published for other aggregate. The kind of event is not similar to the original event