camunda/camunda-bpm-platform — pull request #123 by jangalinski (2014-10-30 14:57:14+00:00)
Title: allow "catch-all" for observers of certain eventType

Problem addressed: today, I can decide to either observe an special event for a special task

@Observes @CreateTask("foo") BusinessProcessEvent event

or any event for the process application

@Observes BusinessProcessEvent event

What I would like todo (without catching every event and checking its type) is to

@Observes @CreateTask BusinessPorcessEvent event

which would be executed every time a task is created no matter which one.

The suggested implementation is to add a default value "" to the annotations (allowing me to use @CreateTask without name) and add both annotations to the event, on with the concrete name and one with "".
That way, I can choose whether I want to implement a special Observer or a generic. I can even provide both (write a BAM timestamp for every task but also do something special for the "foo" task).