Hook to intercept flow transitions only

To be able to provide more detail about the exact process/execution/task/user on FlowableException.
I currently have AbstractCommandInterceptor but that intercepts absolutely everything.

On top of that i use the RuntimeService(Once on appcontext) to gather information which just sends more Commands through the interceptor through the various QueryImpl’s.

Where would be the correct place for this custom code?

Spring Boot 2.4.2 with embedded Flowable Engine 6.6.0.

I’m not entirely sure what you are trying accomplish exactly but I don’t think using the command interceptor is the best way to be informed of transitions in the workflow. Maybe using a event listener might work better for you. A event listener can be implemented as follows:

public class EventListener implements FlowableEventListener {
    public void onEvent(FlowableEvent flowableEvent) {

        FlowableEngineEventType eventType = (FlowableEngineEventType) flowableEvent.getType();
        switch (eventType) {
             //trap on the events of interest here
             //such as process starting,ending, transitions taken,etc.

The event listener is installed in the runtime service through the addEventListener method.

1 Like

Thanks, certainly an option. I already have a customization implemented around jobRetriesDecremented. Was wondering if there was already an encapsulating hook for this grouping of events.

A comand interceptor is very low level and will capture the command, but not the consequences of the command execution. In that sense an event listener will get more insights.

Both can be added using an EngineConfigurer:

        public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> myBean() {
            return engineConfiguration -> ...;

Thanks, i have implemented a listener which i added to the Configuration.
I also still have my CommandInterceptor.

My CommandInterceptor obviously pics up everything.
My FlowableEngineEventListener doesn’t.

Which Exception/Event should i listen for to catch all?

I need to expand on the limited info available for FlowableException to enable the Configurator to easily identify the origin of the error.
On ANY FlowableException I would like to report Execution and Activity information of the unioned Cached and flushed DB info already available through the api queries.

I need the list of executions for the active Root process - cached or on DB.

Any ideas? No flag somewhere to dump the current Flow info onto the log on exception maybe :slight_smile: ?