Hi echelon,
Look at orm.xml/persistence.xml files provided inside JBPM5 source. This JPQL query "ProcessInstancesWaitingForEvent" specified externally in orm.xml file. Current JBPM5 documentation and samples information is very lightweight, hope with time it will be extended with more details and samples.
--
Thanks,
Vadim.