Use a connector in a Listener

I was thinking about the same issue. The solution (workaround?) i came up with was to execute a message:

execution.getProcessEngineServices().getRuntimeService().createMessageCorrelation("sendMessage").setVariable(...).correlateStartMessage()

I could see some stand alone scenarios where you need one-off connector usage. But a lot of the use cases i generally can imagine are sending the same type of information multiple items (such as the email, or logging, or events, etc), and so a message seems to be a great abstraction to handle this.

(of course you could just start a new process instance through the java api in your listener, which would be your “send email” process)

edit: changed the code example, as there was the incorrect usage.