I hope this picture can explain what I need to do better. There is business logic happening between events. We need to know when the second event is caught, the first event must be caught earlier. If not we need to throw an exception to preserve the workflow state. Is there any way to get any feedback, exception, status, checking to know the first event on the workflow engine level. I guess I can have a state object on my business logic,, but I am trying to use anything out of the box.
A possible workaround will be:
1. After first event is caught, put a script task node that will set value to a variable "firstEventFired" to true
2. After second event is caught, put a script task node that will check the value of variable "firstEventFired", if the variable value is true then proceed, else throw exception.