jakartaee / faces

Jakarta Faces
Other
107 stars 55 forks source link

Allow pass parameter to faces flow #1572

Open FabriSr opened 3 years ago

FabriSr commented 3 years ago

Currently, it is possible to pass parameters between flows (when a flow invokes another flow), but it is not possible to pass parameters from outside of the flow (e.g through a request to start a flow). When passing parameters to a start flow request, the parameters are redirected to the first view of the flow. There is no concept of flow parameters or flow initialization parameters. Please add support to invoke a flow with parameters, allowing us to define, for example, parameters that are mandatory for starting a flow.

Related questions:

https://stackoverflow.com/questions/26379044/how-to-pass-parameter-to-faces-flow https://stackoverflow.com/questions/31457008/how-can-i-initiate-a-jsf-flow-and-pass-it-parameters

arjantijms commented 3 years ago

This surely sounds reasonable at a glance.

Problematic is that at the moment I don't think we have anyone in the team really working on flows. @tandraschko @BalusC ?

tandraschko commented 3 years ago

nope sorry! Maybe @FabriSr can think about a spec feature and provide a draft PR

FabriSr commented 3 years ago

Would it be a good idea to take advantage of the current feature of inbound parameters?

It would be necessary to change the flow initialization algorithm to check if in the request there are parameters that match those declared in the inbound parameters. If exists, initialize the flow with these parameters (similar to what happens when parameters are passed between two flows). If there are no parameters or if the request parameters do not match those declared, forward the parameters to the view (as is already the case today). The validation of the parameters could occur via a backing bean properties and bean validation.