spring-projects / spring-webflow

Spring Web Flow
https://spring.io/projects/spring-webflow
Apache License 2.0
331 stars 233 forks source link

Transitioning from a flow found in parent flow registry to a subflow found in a child flow registry doesn't work [SWF-1026] #297

Open spring-operator opened 15 years ago

spring-operator commented 15 years ago

Andrei Stefan opened SWF-1026 and commented

A modified version of booking-portlet-faces sample application has been used to test this scenario. /WEB-INF/config/application-config.xml file contains a parent flow registry that has as its only flow location - main.xml /WEB-INF/config/hotelbooking-portlet-config.xml contains a child flow registry, which has as its parent the parent from application-config.xml; its flow locations are view.xml and booking.xml

When the application is tested, after a hotel is chosen from the list and "Booking" is clicked an exception is thrown: NoSuchFlowDefinitionException: No flow definition 'booking' found

Debugging the Web Flow code it seems that even if FlowExecutionImplFactory is aware of all the DefaultFlowRegistries (the parent and the child one) and is able to get the flow definition from the parent registry, when trying to build the "main" flow the subflow is not found. My gut reaction would be that the search space, when resolving flow definitions, should include the complete path from the leaf to the root of the flow definition registry hierarchy.

I think the way it behaves now is the intended behavior, but this will somewhat limit the possibilities of structuring the flow definitions in a web app: moving all the common flows to a higher level (war app level in this case) and the specific flows (sub-flows in this case) to portlet-specific level.


Affects: 2.0.5

Attachments:

spring-operator commented 15 years ago

Keith Donald commented

Flows in a child registry can reference flows in parent registry, but not vice versa. This is how it was designed, and it allows a flow in a child context like a Portlet to reuse flows defined in a parent context like the root application context. I'm not sure I understand the usecase for allowing a flow in a parent registry to register a flow in a child registry. Can you elaborate?

I don't expect we'll make any changes in 2.0.x here; I need more information on use case we can't support well to warrant any changes in future releases to the registry system design.