1 person found this helpful
This is a really good example of why it is best practice to always include the entity text in attributes associated with the entity.
Your problem is that you have specifically defined that "MNO" belongs to XYZ.
"MNO is correct" is another attribute - so far as the parser is concerned that attribute is at the Global level (it does not include ABC or XYZ and it has not been explicitly created as being associated with an entity so it must be global).
So you have a rule of the form:
attribute at global level if
attribute at XYZ level
so you have the classic "which XYZ?" concundrum and the compiler won't let you compile this.
So two solutions:
1) explicitly add "MNO is correct" to the entity XYZ
2) (better) start using the entity text in your definitions giving you a rule like:
MNO for XYZ is correct if
MNO for XYZ = "Mark"
you'll note that when you "add attribute" from within Word that is uses this same concept (does the attribute contain the entity text) when it suggests which entity it will add the attribute to.
In terms of "why the difference" - I would guess that they have loosened the compilation validation in cases where the attributes are using containment of 1:1 in 10.4.
But if you have a look at the build model in 10.4 and you'll see that "MNO is correct" is still put into the Global entity - which is probably not your intention.
Thanks a lot
I am new to OPA, i am actually trying to set a value to a attribute of global using a rule table based on the value of attribute in the XYZ like below
Value of global attribute is attribute of the global entity
MNO XYZ attribute of XYZ entity
[p3] Value of global attribute
[p4 = "Mark"] MNO XYZ = "Mark"
but i am facing the same error ..
I'd strongly recommend undertaking some formal training. While OPA is easy to get up and running with, it's like any other powerful tool in that once you start delving into the more powerful bits you need to have a better understanding of the underlying concepts to really get the best value.
You should also make sure you read Jasmine's excellent best practice guide
So assuming we're still using the very limited model above (it's unusual to see too many 1:1 relationships in practice) and you need to get this working in 10.3... essentially what you are going to need to do is to traverse the relationships to pass the information up the entity levels - I'll use your entity names as per the example but they do make writing the rules more difficult to understand.
I'm assuming the standard auto-generated containment relationship text.
value of the global attribute
1 For(all instances of ABC, ABC has an MNO of "Mark")
ABC has an MNO of "Mark"
For(all instances of XYZ for ABC, MNO XYZ = "Mark")
Although personally I'd also break the condition in the second rule out into a separate conclusion as well.