I am starting to experiment with using events in my ES processes and I'm running into some behavior that I wasn't expecting. If anybody has had any luck with events or has found any good documentation could you please let me know?
Below are the two scenarios that I've been working on. Please feel free to comment, any thoughts would be appreciated.
Scenario 1: I'm catching the "TaskCreated" event on a User action and routing to a script action that basically logs out that the event was caught. When I check the AdminUI for the process I see that the process is being marked as completed. It seems that the user action is "Interupted" the script executes and the process terminates. I was expecting the event to be handled in its own branch, so that I can do some background processing (such as send an email, or update a flag in a database) and still have the main branch continue processing, i.e. the taks still be assigned to the user and not be interupted.
Scenario 2: This scenario is a little more complicated. The flow of the use case is as follows: User A is assigned a task (task A). This task deadlines and the process follows a deadline route which sends an email and assigns a new task (task B) to User B. User B's job is to log into workspace and forward task B to a new user (User C) using the out of the box forward capabilities of workspace. The tricky part is that we actually want User C to be assigned task A not task B. To accomplish this I'm catching the "TaskForwarded" event on the task B user action. This effectively interupts task B and I basically follow a route back to task A and assign it to the user C (which I grab from the caught event on task B). This all works fine if User B only had one instance of Task B. The problem comes when he has multiple instances of Task B, i.e. multiple Task A's have deadlined and he needs to forward them to people. The behavior that I'm seeing is that if I log into workspace as User B and forward one Task B to User C the system fires the TaskForwarded event for all instances of Task B and User C ends up getting assigned a Task A for each instance of Task B. Confusing enough right?! So, I tried to add a filter on my event thinking that if I filter on the process ID I should be able to skip handling the event for the other instances. When I applied this filter it ends up filtering all instances and User C does not get any of the forwarded tasks assigned.
Long story short, I think I need some more detailed documentation on how events work, and what kind of behavior is expected when catching these type of events.
If you've gotten this far, thanks for reading!
Bryan