Is it possible to expose EventSubscriptionEntityManager as a "EventSubscriptionQuery" interface? The queries available in the EventSubscriptionEntityManager would allow me to discover what events subscriptions are available to an Execution.
You can use the ExecutionQuery to check if an execution is subscribed on a certain message/signal, in case you know what signal/message name you're looking for. I don't immediately see any use cases for exposing that. On top of that, the EventSubscriptionEntity is an internal class, not exposed in our API, so it's a lot of work to get that exposed in a decent manner.
What usecase do you have for this, that is not covered by the ExecutionQuery?
We want to use Activiti to control what actions are available to the user for the user task in the workflow. We want to implement this via message and signal events.
The ExecutionQuery will require that you know what actions are available. Instead, I would like to make it so that the workflow informs me what actions are available without hardcoding this. EventSubscriptionEntity provided the methods and data we needed to solve this use case.
I see… That makes sense. A quite safe workaround whould be to implement a custom command (org.activiti.engine.impl.interceptor.Command<T>), this has access to all managers and sessions, using the commandContext. Run the command using the managementService.executeCommand(). Your command can return a list of Strings of message-names, for example.
I went with extending BoundaryEventParseHandler. During parse time, the extension would store all of the Activity and Events combination. During runtime, I use this stored info to retrieve the list of message-names per Activity ID. It works for now.