Nuxeo Studio - How to link a schema A with a schema B - both autonomous

Hi,

I got an issue I'd like to share with you:

Imagine a concept with a class “Test” and a class “Procedure”.

The object “Test” requires, to be executed, to be linked to one (or more) “Procedure“. e.g: Test1 is executed according to Procedure1 and Procedure2

More precisely, I have a determined number of created procedures instances. I require them to be independent from “Test“. e.g: I want to modify “Procédure1” while not impacting “Test1” - although linked to “Procedure1

Consequently, based on Nuxeo solutions, what's the best way to implement my issue ?

How would I proceed ?

Under Nuxeo Studio, Create documents (and their schemas):

  • a document “Test“,

  • a document “Procédure“,

Under the web application, create:

  • one instance “Test1” of the document “Test

  • two instances “Procedure1” & “Procedure2” of the document “Procedure

From my point of view, I have spotted three solutions to implement the issued described above (would you confirm this assertion):

  • Create a “Relation” between documents “Procedure1” and “Test1” and a “Relation” between documents “Procedure2” and “Test2“. In this case, would it be possible to parameter document “Test” so that it requires a “Relation” of type “Procedure” (like a linkset) ?

  • In the document “Test“, inherit a schema “Procedure“,

  • Define a document “Test” as a “Folderish” and allocate it “Procedure” schema as a child schema

Is there any other solution existing through Nuxeo ? What is the solution best matching my need ?

Many thanks,

Matthieu,

0 votes

1 answers

2642 views

ANSWER



Hi,

Your use case is very interesting, although it is not simple :)

If you need to link one instance of “test” to one instance (or several) instance of “procedure” the 2 solutions I see are:

  • Use relations : that's nice to display in the UI, but not easy to configure with Studio. Also, you did not mentioned versioning on your docs but it become quickly complicated to handle when you mix relations and versioning.
  • Or use a dedicated metadata to link the 2 instances. Put it on test for instance (String Type) and use the “document suggestion widget” to store the Ids of linked procedure.

You can configure the document suggestion widget so that you can only look for procedures :)

If you need to know from a procedure, what are the tests referencing it, you can create a “content view” attached to procedure that will list all tests referencing this procedure.

From what I've understood from your use case, the second solution is the simplest solution to answer most your needs.

Fred

0 votes