Skip to content

Commit c093e64

Browse files
committed
fix(metamodel) Properly resolve built-in type names
Signed-off-by: jeromesimeon <[email protected]>
1 parent f341124 commit c093e64

File tree

4 files changed

+1006
-11
lines changed

4 files changed

+1006
-11
lines changed

packages/concerto-core/lib/introspect/metamodel.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,13 @@ function validateMetaModel(input) {
247247
* @return {object} mapping from local to fully qualified names
248248
*/
249249
function createNameTable(modelManager, metaModel) {
250-
const table = {};
250+
const table = {
251+
'Concept': 'concerto',
252+
'Asset': 'concerto',
253+
'Participant': 'concerto',
254+
'Transaction ': 'concerto',
255+
'Event': 'concerto',
256+
};
251257

252258
// First list the imported names in order (overriding as we go along)
253259
const imports = metaModel.imports;

packages/concerto-core/test/data/model/person.cto

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ concept Address identified {
5252
o String city default="NYC"
5353
o String country default="USA"
5454
o String[] street
55-
o Boolean isResidential default=true
56-
o Boolean isPrivate default=false
55+
o Boolean isResidential default=true
56+
o Boolean isPrivate default=false
5757
}
5858

5959
@Address("x",1,"y","foo","z",true,Gender,TemporalUnit[])
6060
@Address2()
6161
@Address3
6262
concept USAddress extends Address {
63-
@Zip("x",1,"y","foo","z",true)
64-
@Zip2()
65-
@Zip3
63+
@Zip("x",1,"y","foo","z",true)
64+
@Zip2()
65+
@Zip3
6666
o Integer zip4 range=[-365,365]
6767
o Integer zip41 range=[,365]
6868
o Integer zip42 range=[-365,]
@@ -81,7 +81,8 @@ event E {
8181
}
8282

8383
transaction T identified by id {
84-
o String id
85-
o TemporalUnit tu
86-
o Month month // This is imported from the org.accordproject.time namespace
84+
o String id
85+
o TemporalUnit tu
86+
o Month month // This is imported from the org.accordproject.time namespace
87+
o Participant p
8788
}

0 commit comments

Comments
 (0)