Hi Ville,
the "Relationship Role Condition" provides only 2 "Predicate" option: "In" and "Not In". So, you cannot achieve your goal using it, because the "In" predicate will always return all the elements in B having a relationship with any selected element in your multi selection field.
In order to solve your problem I think there are 2 possible solution:
- Using a "Script" Component:
you can add in your model a Script Component and write a custom SQL query in order to get exactly the desired result from your entities A and B.
You can find more details about how to use a Script Compontent at the following link:
http://www.webratio.com/learn/learningobject/using-the-script-component
- Using an operation chain and a volatile entity for filtering your data
For example, let's consider the case where you have the entities "Product" and "Colors" connected by a N-N relationship. In this case you should build a model such as the following one:
https://drive.google.com/file/d/0Bwj4WXZL5K0Vc0Voc0VhTkdUTHc/view?usp=sharing
As you can see in the attached image, the model these steps:
- The user selects one or more colors in the multiselection field (2) and press the Button corresponding to the navigation link
- The operations no.3 and no.4 copy all the existing products in the volatile entity
- The loop component receives from the Form component the array of the selected colors.
- The selector no.6 get all the products currently recorded in the volatile entity and pass their key to the selector no.7
- The selector no.7 computes (starting from the original entity of product) which of the products in the volatile entity are related to the colors selection (the colors selection is passed as input via the data flow starting from the Loop Component)
- Then the Delete component (no.8) deletes all the products in the volatile that are not included in the set resulting from the selector no.7
- In this way, while looping, you will clean the product list from the elements not having a relationship with the selected colors.
- Finally the selector no.9 simply return all the remaining elements in the volatile entity of products and pass the resulting filtered key set to the List Component in the page.
- In this way the list will show the expected result
Remeber that the "Create" Operation automatically create the oid key, so in order to avoid problems, we use the product_oid attribute in the volatile entity to store the original key for each product in the Product entity.
If you need to learn how to use the loop content, please refer to this online lesson:
http://www.webratio.com/learn/learningobject/looping-branching
Let me know if this helps.
Regards