Beginner: how to reference attribute of entity (scope, context, ??) [message #987451] |
Mon, 26 November 2012 11:34  |
Eclipse User |
|
|
|
Hi,
sorry if this is a simple question, or if it has been answered already, but as I'm new to this topic, I might not have used the correct search terms to find the proper solution.
We're using two grammars that are mixed (only the important parts are copied here), the first one describes a data model, the second one should provide a mapping from an input layer to this data model:
grammar 1:
ConcreteEntity:
'entity' name = ID ('extends' superType = [ConcreteEntity])? 'belongs to' group=[Group] 'uses metadataType' metadataType = MetadataType '{'
('oracleName' oracleName=STRING)?
('oracleColumnPrefix' oracleColumnPrefix=STRING)?
pk=PrimaryKey
attributes += Attribute*
businessRules += BusinessRule*
'}'
;
grammar 2:
DocumentBasedUC:
'documentBasedUseCase' name=ID '{'
'uses' datastructure=[DataStructure]
'inputToHeader {'
inputToHeaderMappings+=InputToHeaderMapping*
'}'
'}'
;
InputToHeaderMapping:
name=ID '=>' ref=[hubmodel::Attribute]
;
In the end we would like to have something like this in the models:
entity PARTY belongs to BasicSetup uses metadataType SMALL {
ID : PK
CODE short 'CODE': VARCHAR2(20) mandatory
second model should refer to "CODE" attribute:
documentBasedUseCase MIP03 {
uses Document
inputToHeader {
Code => CODE
}
}
The problem now resides in the [hubmodel::Attribute] thingy: we want to reference to an attribute of the ConcreteEntity instance of the first domain model, and I guess we need some scope provider to make the editor aware of the relation (the "uses Document" thing would limit the sources for the attribute to reference to ConcreteEntity with ID="PARTY" in this case). I simply don't know where to start even though I've read the documentation - any help very much appreciated!
|
|
|
|
Re: Beginner: how to reference attribute of entity (scope, context, ??) [message #987792 is a reply to message #987451] |
Wed, 28 November 2012 03:10  |
Eclipse User |
|
|
|
From where should it be known that "CODE" belongs to PARTY? I see no context here:
documentBasedUseCase MIP03 {
uses Document
inputToHeader {
Code => CODE
}
}
Christian is right, either allow qualified names or you need a scope implementation that collects the attributes of a ConcreteEntity. First approach would look like this:
documentBasedUseCase MIP03 {
uses Document
inputToHeader {
Code => PARTY.CODE
}
}
[Updated on: Wed, 28 November 2012 03:10] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03805 seconds