I have built a first small application using CUBA framework, using standard UI screens (browse and edit) mapped directly to persistent entities.
Now, I would like to develop a more complex UI approach :
In our business, we have to create a contract. A contract is a tree of entities collections, containing 7 different types of entities.
We don’t want to commit entity per entity, because we want to guarantee a functionnaly coherent database. So we would like to commit a contract only once all the entities of the tree have been entered and validated functionally.
To illustrate my words, I will describe what we do with our today’s architecture (based on JSF UIs) that we would like to replace :
We use a ContractBean which is a pure JavaBeans tree, and which is stored into the HTTP session, using a @SessionScoped ManagedBean. This ManagedBean manages the filling of the ContractBean across multiple JSF screens (pages). At the end of the screens flow, we validate the whole ContractBean functionally using a business service, and we invoke a save() service which maps the non persistent ContractBean to the equivalent persistent ContractBean tree, and commits the persistent entities tree to the database.
Is it possible to build this kind of architecture with CUBA, where we could use multiples screen to fill a tree of JavaBeans stored in session, and persist this tree of JavaBeans only at the end of the screens flow ?
If yes, could you briefly explain how we could build it ?
Maybe is there an example of this kind of screen flow available somewhere ?
short answer: yes, everything that you mentioned is possible.
I think there is a common misconception that happens if someone gets the first impression of the CUBA generated CRUD screens (and I can relate to that because I was experiencing the same). It seems that the browse/edit screens stuff is the end of the story. But instead, you should see it as the beginning of it.
You can really build any kind of complex UI screen flows that you might imagine.
Here is one very sophisticated example of an app that is built with CUBA: Haulmont Thesis ECM. If you look at the screenshots, you will hardly find any connection to the CRUD screens you saw from came out for the CUBA Studio generator.
Also If you look at some of the Administration Screens you can see various other examples of more complex screens.
Furthermore, if you want to take a look at all the components, you might want to look at the CUBA sampler app.
Last, but not least you have to see that CUBAs UI technology is Vaadin, which in itself is a very enterprise-centric UI framework. It allows you to build highly sophisticated and advanced UIs. Check it out at: https://vaadin.com/
There is another guide: Data Modelling: Composition, which contains an example of nested screens, where you add/edit a complete tree of objects and it gets automatically committed at the end of the interaction.