flowable / flowable-engine

A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users.
https://www.flowable.org
Apache License 2.0
8k stars 2.62k forks source link

Change the parameter type from FlowableEngineEventType to FlowableEventType in RuntimeService . #3927

Open LinZhaoguan opened 4 months ago

LinZhaoguan commented 4 months ago

Describe the bug

The addEventListenermethod of the RuntimeServiceinterface, which receives an event type parameter, accepts an implementation class FlowableEngineEventTyperather than interface FlowableEventType.

void addEventListener(FlowableEventListener listenerToAdd, FlowableEngineEventType... types);

Expected behavior

Change the parameter type from FlowableEngineEventType to FlowableEventType.

void addEventListener(FlowableEventListener listenerToAdd, FlowableEventType... types);

Code

Custom event type enumeration class: RdmFlowableEventType.

@Getter
@AllArgsConstructor
public enum RdmFlowableEventType implements FlowableEventType {

    STEP_TASK_ENTERED;

}

Config Custom Listener With SpringBoot.

@Configuration
@RequiredArgsConstructor
public class FlowableListenerConfig {
    private final RuntimeService runtimeService;
    private final CustomListener listener;

    @PostConstruct
    public void init() {
        // This line results in a compilation error.
        runtimeService.addEventListener(listener, RdmFlowableEventType.STEP_TASK_ENTERED);
    }

Additional context

Flowable V6.8.0 With SpringBoot.