RISE supports a view being used inside another view. This is useful when combining filtering with structure rollups or when traversing a structure having a larger depth. Joining a view is done in exactly the same way as joining an entity. All views based on a given entity are available when creating a view for another entity related to the first entity. Clear? Well, hopefully the example below will sort it out because it's really quite simple yet powerful.
In this example, which loosely continues the examples in
Filtering an entity and
Flattening out a structure, we are dealing with a registry of records where a record could consist of a document. Although, this might apear overly general at the moment this construct allows the record to represent other object types than merely documents, in the future. The model could easily be extended for record keeping of objects such as Movie, Music or something entirely different, see the article on
information inheritance for more details. If we sum up the previous examples we get a starting model like the one below. However, we would like to be able to list all approved documents of registry.
To accomodate our new need we create a view named DocumentsInRegistry based on the Record entity and open the view editor to assemble it. We extend our view with the ApprovedDocument view attached to the Record entity via its document relation. For sake of clearity, since we already know that the document returned by ApprovedDocument is approved we ignore the Approved attribute.
Once having joined the approved documents with the record we stand the choice of either creating yet another view, base on the Registry entity, joining our new view into that one or extend our existing view by joining the Registry entity. As indicated by the name DocumentsInRegistry we've favored the latter approach. Thus, we extend the view by the Registry entity as well.
Once completed we close the view editor and end up with the following model where the DocumentsInRegistry view will return all approved document records together with their respective registry.