Lets say that we have a user (like super-hero) that want to see all wars that is going on in a world so that he can stop them. He can't prevent them all, because he needs to sleep sometimes and so on. But if a war have happened when he was asleep, he wants to know about that (so he can punish ones who started it for example).So if war started he wants to see where it have happened and when. And also all events about this war, like some battles for example.So he wants software that can present him this information at some 'war table' where he can see all wars that he still haven't reacted to in some way.And that's a software that I need to write.So lets say that I have some software that monitors some state and based on lower level events generates events like 'War started', 'War ended', 'Battle started', 'Battle ended', 'War changed location' etc.The problem that puzzles me is that at the time when War started - war is a process, not an event. Because war is still going on. But after the 'War ended' event we can say that this process in ended and now it is a event.To be more concrete. Lets say that the sequence of events is:'War1 started at location x1''War2 started at location x2''War1 changed location to x4''War2 changed location to x5''War1 have a new battle started at location x3''War1 have a new battle ended at location x3''War1 ended'But the user doesn't want to see this as a sequence.What he wants to see is something like this'War1 is going on at location x1''War2 is going on at location x2'Then he wants the first row to change according to next event'War1 is going on at location x4''War2 is going on at location x2'and so on'War1 is going on at location x4''War2 is going on at location x5'and so on until this wars would end.'War1 was at location 'some location'''War2 was at location 'some different location''As you can see war1 and war2 is events now.After war is ended super-hero still want to know all information about it if he want to, but in this war-table he basically wants to see current information about war process.Right now the solution is to think about this war process as process, that can be still going or have been already ended. The problem is that in this case if we would want to monitor some event that is different then war and more simple (like it some switch that can be just on or off) we would have model that as a process that have a start time and stop time. Which is... strange I think.I thought about different solution. Instead of displaying processes display lower level events grouped by subject.Like 'War 1 have started' and 'War 1 have ended' have the same subject - 'War 1' process.But not all events in our system would have process as a subject and... I'm kink of lost here.Maybe someone already have done something like that? What could be the correct approach to that?
How to model complex event in event sourcing?
event sourcing