Design Note: AssociationTypeIdentifier Role Filter Parsing
Background
QueryBasedAssociationTypeIdentifiers are defined in the paper “Multi-language support for attribute
values in Windchill: Approach”, by Joe McKinley, March, 26, 2013.
Role Filter
ModeledAssociationTypeIdentifers and QueryBasedAssociationTypeIdentifiers have roles which may
contain filter specifications that define the association. An example of an MBA with a role filter is:
WCTYPE|wt.part.WTPartMaster~MBA|masterReference[(name='foo')AND
(iterationInfo.latest=TRUE)]@WCTYPE|wt.part.WTPart
This MBA has a role named 'masterReference'. The text enclosed within the '[ ]' is the role filter.
(The '[' and ']' characters are
not
part of the role filter.)
An example QBA with a role filter is:
WCTYPE|wt.part.WTPart~QBA|
[(foo=masterText)AND(authoringLanguage=sourceLanguage)AND(123456789=dictionaryReferen
ce.key.id)AND('en_us'=targetLanguage)AND(thePersistInfo.modifyStamp>effectiveStart)AN
D((NULL=effectiveEnd)OR(thePersistInfo.modifyStamp<=effectiveEnd))]@WCTYPE|
com.ptc.core.td.server.dictionary.TranslationDictionaryEntry
The filter in the QBA does not have a name component, but it is still enclosed in '[' and ']' characters.
Language Grammar and Lexical Rules
Role filter strings are described by the following grammar:
1. <expression> ::= <term>
2. <expression> ::= <expression> 'OR' <term>
3. <term> ::= <factor>
4. <term> ::= <factor> 'AND' <term>
5. <factor> ::= '(' <expression> ')'
6. <factor> ::= <relation>
7. <factor> ::= 'NOT' <factor>
8. <relation> ::= '(' <id> <relop> <id> ')'
9. <relation> ::= '(' <id> <relop> <constant> ')'
10. <relation> ::= '(' <constant> <relop> <id> ')'
The lexical tokens of this language are:
( Left parenthesis
) Right parenthesis
NULL Manifest constant
TRUE Manifest constant
FALSE Manifest constant
AND Boolean operator
Page 3