I have a similar requirement for my project, this is what i learned, if someone has some better ideas please let me know...
You can roll your own "nodes" in jBPM by providing your own binding, this means extend JpdlBinding and return an instance of ExternalActivityBehaviour in parseJpdl() (check the source of TaskBinding to see how it is done). To get your nodes parsed you have to add your binding to jbpm.user.bindings.xml in the root of your classpath (check jbpm.jpdl.bindings.xml for the format).
Transition are special in the sense that there are is no binding for them, they are parsed directly in the JpdlParser, in order to customize transition you need to customize the parser I think.
However you can add your custom eventlistener to a transition, so I abused an empty eventlistener to get some attributes for my transition. I have a class called TransitionConfig that extends EventListener, TransitionConfig has a custom binding and just an empty notify() method.Getting the config data for a transition is a bit tricky:
final EventImpl event = transition.getEvent(Event.TAKE);
final List<EventListenerReference> listeners = event.getListenerReferences();
if (listeners != null) {
for (final EventListenerReference reference : listeners) {
final EventListener listener = reference.getEventListener();
if (listener instanceof TransitionConfig) {
transitionConfig = (TransitionConfig) listener;
break;
}
}
}
so I admit using an event listener to keep some config data is butt ugly and I am sure i will burn in hell for that, but hacking the parser might be even more tricky, i am open for suggestions...