Indeed, I hadn't considered the trigger evaluation...
In the current implementation, triggers depend on the type of incoming events, and are configured during the initialization of the application.
I added a method that checks whether incoming events have corresponding triggers, based on the runtime type of the event. If there is no match, then no dispatch to trigger methods will be performed (an inactive trigger is added to the corresponding map structure)
If there is a match, i.e. the incoming event has a configured event trigger, then it is evaluated, and if evaluated to true, dispatched to the relevant onTrigger method.
I added a pull request https://github.com/leoneu/s4-piper/pull/3
I wonder about the usefulness of parameterizable onTrigger methods? Is it really worth providing that or couldn't we just have a single onTrigger() method?