14.4. Registering flow dependencies

If your flow has dependencies on externally managed services, also override configureFlowBuilderContext(MockFlowBuilderContext) to register stubs or mocks of those services:

@Override
protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
    builderContext.registerBean("bookingService", new StubBookingService());
}
        

If your flow extends from another flow, or has states that extend other states, also override getModelResources(FlowDefinitionResourceFactory) to return the path to the parent flows.

@Override
protected FlowDefinitionResource[] getModelResources(FlowDefinitionResourceFactory resourceFactory) {
   return new FlowDefinitionResource[] {
       resourceFactory.createFileResource("src/main/webapp/WEB-INF/common/common.xml")
   };
}