Skip to content

Commit

Permalink
fix(metamodel) Properly resolve built-in type names
Browse files Browse the repository at this point in the history
Signed-off-by: jeromesimeon <[email protected]>
  • Loading branch information
jeromesimeon committed Aug 12, 2021
1 parent f341124 commit c093e64
Show file tree
Hide file tree
Showing 4 changed files with 1,006 additions and 11 deletions.
8 changes: 7 additions & 1 deletion packages/concerto-core/lib/introspect/metamodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ function validateMetaModel(input) {
* @return {object} mapping from local to fully qualified names
*/
function createNameTable(modelManager, metaModel) {
const table = {};
const table = {
'Concept': 'concerto',
'Asset': 'concerto',
'Participant': 'concerto',
'Transaction ': 'concerto',
'Event': 'concerto',
};

// First list the imported names in order (overriding as we go along)
const imports = metaModel.imports;
Expand Down
17 changes: 9 additions & 8 deletions packages/concerto-core/test/data/model/person.cto
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ concept Address identified {
o String city default="NYC"
o String country default="USA"
o String[] street
o Boolean isResidential default=true
o Boolean isPrivate default=false
o Boolean isResidential default=true
o Boolean isPrivate default=false
}

@Address("x",1,"y","foo","z",true,Gender,TemporalUnit[])
@Address2()
@Address3
concept USAddress extends Address {
@Zip("x",1,"y","foo","z",true)
@Zip2()
@Zip3
@Zip("x",1,"y","foo","z",true)
@Zip2()
@Zip3
o Integer zip4 range=[-365,365]
o Integer zip41 range=[,365]
o Integer zip42 range=[-365,]
Expand All @@ -81,7 +81,8 @@ event E {
}

transaction T identified by id {
o String id
o TemporalUnit tu
o Month month // This is imported from the org.accordproject.time namespace
o String id
o TemporalUnit tu
o Month month // This is imported from the org.accordproject.time namespace
o Participant p
}
Loading

0 comments on commit c093e64

Please sign in to comment.