Skip to content

Commit 4c6993d

Browse files
Fix hosted service syntax: match grammar specification exactly
1 parent 77e40bf commit 4c6993d

File tree

1 file changed

+32
-21
lines changed
  • showcases/data/Lambda/Activator - Hosted service

1 file changed

+32
-21
lines changed

showcases/data/Lambda/Activator - Hosted service/code.pure

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,49 @@ function model::greet(name: String[1]): String[1]
88
function model::processData(data: String[1]): String[1]
99
{
1010
'Processed data: ' + $data
11-
}###HostedService
11+
}
12+
13+
###HostedService
1214
// Basic hosted service with UserList ownership
1315
HostedService model::BasicHostedService
1416
{
15-
pattern : '/api/greet/{name}';
16-
ownership : UserList { users: [
17-
'user1',
18-
'user2'
19-
] };
20-
function : model::greet(String[1]):String[1];
21-
documentation : 'A simple hosted service that greets users by name';
22-
autoActivateUpdates : true;
17+
pattern: '/api/greet/{name}';
18+
ownership: UserList
19+
{
20+
users: [
21+
'user1',
22+
'user2'
23+
]
24+
};
25+
function: model::greet(String[1]):String[1];
26+
documentation: 'A simple hosted service that greets users by name';
27+
autoActivateUpdates: true;
2328
}
2429

2530
// Hosted service with Deployment ownership and stereotypes
2631
HostedService <<meta::pure::profiles::doc.doc>> {doc.doc = 'Example with deployment ownership'} model::DeploymentHostedService
2732
{
28-
pattern : '/api/process/{data}';
29-
ownership : Deployment { identifier: '12345' };
30-
function : model::processData(String[1]):String[1];
31-
documentation : 'A hosted service that processes data with deployment ownership';
32-
autoActivateUpdates : false;
33+
pattern: '/api/process/{data}';
34+
ownership: Deployment
35+
{
36+
identifier: '12345'
37+
};
38+
function: model::processData(String[1]):String[1];
39+
documentation: 'A hosted service that processes data with deployment ownership';
40+
autoActivateUpdates: false;
3341
}
3442

3543
// Hosted service with post-deployment actions
3644
HostedService model::AdvancedHostedService
3745
{
38-
pattern : '/api/advanced/{param}';
39-
ownership : UserList { users: [
40-
'admin'
41-
] };
42-
function : model::processData(String[1]):String[1];
43-
documentation : 'Advanced hosted service with post-deployment actions';
44-
autoActivateUpdates : true;
46+
pattern: '/api/advanced/{param}';
47+
ownership: UserList
48+
{
49+
users: [
50+
'admin'
51+
]
52+
};
53+
function: model::processData(String[1]):String[1];
54+
documentation: 'Advanced hosted service with post-deployment actions';
55+
autoActivateUpdates: true;
4556
}

0 commit comments

Comments
 (0)