Change the parameter type from FlowableEngineEventType to FlowableEventType in RuntimeService .
LinZhaoguan opened this issue · 0 comments
LinZhaoguan commented
Describe the bug
The addEventListener
method of the RuntimeService
interface, which receives an event type parameter, accepts an implementation class FlowableEngineEventType
rather 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.