jBPM has the commandExecutor which can do most of what you want (AFAIK). It can be either simple (db based) or JMS based. Look at the docs, examples and testcases
In the user guide, both "Chapter 9. Process Modelling" and "Chapter 13. Asynchronous continuations" talk at a very high/abstract level and only briefly mention CommandExecutorThread. (And the JavaDocs for these classes are empty). So, in theory, it sounds like jBPM does what I want, but I can't find any specifics on how to go about implementing a solution in practice.
Is there any example of code for how to use the CommandExecutorThread? i.e. If I wanted a very simple program that just started a CommandExecutorThread and responded to messages by invoking the correct workflow, what would I put in the main() method to (fully) configure and start the CommandExecutorThread?
in my previous response I mention the examples and testcases, so yes there are. Testcases are normally in the sourcecode, so that is at least what you need. I personnaly do not know the advances/changes between 3.1.x and the yet unreleaseed 3.2. In the 3.2 there is also an example using async continuations but I think it is based on jms