Search code examples
business-rulesmds

MDS business rule on more then one domain based attribute


I'm stuck with this problem on Master Data Service (MDS).

I have an entity that has two domain based to other two entities. I created the first business rule with the first domain based and it works perfectly.

But when I try to create a second business rule with the second domain based, an error appears:

200095 : Cannot specify more than one entity in MetadataGet 

  400003 : The attribute reference is not valid. The attribute was not found. 

  400003 : The attribute reference is not valid. The attribute was not found.

Obviously the attribute is valid. In fact, if I delete the first business rules, the second one is published correctly.

I think that MDS block a second business rules if you try to apply to a second domain based attribute.


Solution

  • This happened to us as well, and it seems that this error only occurs if a specific set of actions is taken:

    1. We first restored the MDS 2012 database on SQL Server 2017
    2. We upgraded a database using MDS management tool. Mind that the multi-entity business rules work fine now - they return no errors upon saving, can be published and successfully evalueted
    3. We then realized that we are missing some code changes, so we decided to create a full model package using MDSModelDeploy.exe in our old MDS 2012
    4. We deployed that package using MDSModelDeploy deployupdate command. After that the existing multi-entity rules are failing to publish, you are also unable to create new rules based on different entities within one entity. Unfortunately, we have found no fix for it, as there are simpler ways around it.

    At this point we took a step back, restored and upgraded the old database once again, and it turned out that the rules worked, so it got to be the package that has broken those. I do not know what your situation was, since when we created a fresh model in SQL 2017 all of the multi-entity based rules worked perfectly, so I am curious to know what steps should be taken to reproduce the error in your case.

    The only possible approach I can think of to fix the situation in point 4, would be to create an MDSModelDeploy update package from the corrupted model and another one from a new, healthy model, and then compare how the XMLs of the multi-entity business rules are structured. We did not try this one though, since we found the workaround described previously.