Hi Anton,
That's not possible via public API.
You can use a TransactionListener though. In your TaskListener, write the following:
public void notify(DelegateTask delegateTask) {
Context.getCommandContext().getTransactionContext()
.addTransactionListener(TransactionState.COMMITTED, new TransactionListener() {
@Override
public void execute(CommandContext commandContext) {
// send your notification here
}
});
}
The transaction listener is called once the process engine transaction has been committed.
Disclaimer: This is internal API, meaning we do not guarantee any stability with upcoming releases.
Cheers,
Thorben