i read it from somewhere that we can attach a java code in a task upon entry and upon exit. if you're after the entire process has executed, then you can attach the code at the last task.
did it answer the question?
rather than attaching a java code while defining a process, can't be done at runtime.
Like I am starting a process using my API. Can I add any Event Handlers to it to handle all the PROCESS END Events for a process?
when you design a process, that's the point that you assign the code for an event. but when you check the process, its an xml file. it means upon deployment the framework will check any class attached to a certain event. in my idea, they are implementing dependency injection here and it means it is dynamic. so maybe somewhere in the code you can access instance of whatever class is this then inject your class.
i havent read the source code though, i am currently trying to understand how to make jbpm-console functional as i am not javaserver faces expert, just a nood in this area and this implementation combines hibernate, jaas, jboss administration skills to make this work (just my understanding though).
i hope its a small help to you!
you can attach events design and runtime and even persist the latter
How do I add them ?
Is it through processdefinition.addEvent()? If so how will i get the handle to the event fired then