Regarding the solution described here
Is there a way to listen on transactions concerned with specific events?!
For example, in case I want to execute a function after the TaskListener.EVENTNAME_CREATE
transaction is committed, using the transaction listener described in the previous solution
@CamundaSelector(type = "userTask", event = TaskListener.EVENTNAME_CREATE)
private final class OnCreationListener implements TaskListener {
@Override
public void notify(DelegateTask delegateTask) {
Context.getCommandContext().getTransactionContext()
.addTransactionListener
(TransactionState.COMMITTED,
new TransactionListener() {
@Override
public void execute(CommandContext commandContext) {
// do action
}
});
}
}
is not specific for the create event
, this may fire on a wrong transaction commit (a commit for another DB query rather than the create task).
I know that this is an internal API, but is there a way to specify the type of transaction commit?
Thanks in advance,