Use a connector in a Listener

I think it will be interesting to add this feature if not available or planned.
Maybe we can do an extension from the community? Would it be possible?

Thanks,
Leonardo

@homer1980 whats the use case?

In general that technical details can be invisible for the analyst and that you do several connecting points.

Suppose I have to do 3 technical communications after a task is completed, for exampling, connecting to an API and sending an email and so on. Right now if I want to do that, I have to create a service task for it and can not use the connector in the 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.