Skip to content

Commit 3082dd2

Browse files
Simplify hosted service syntax to match parser expectations
1 parent 09b39f4 commit 3082dd2

File tree

1 file changed

+7
-16
lines changed
  • showcases/data/Lambda/Activator - Hosted service

1 file changed

+7
-16
lines changed
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,38 @@
11
###Pure
2-
// Define a simple function to be used by our hosted service
32
function model::greet(name: String[1]): String[1]
43
{
5-
'Hello, ' + $name + '! Welcome to the hosted service.'
4+
'Hello, ' + $name + '!'
65
}
76

87
function model::processData(data: String[1]): String[1]
98
{
10-
'Processed data: ' + $data
9+
'Processed: ' + $data
1110
}
1211

1312
###HostedService
14-
// Basic hosted service with UserList ownership
1513
HostedService model::BasicHostedService
1614
{
1715
pattern : '/api/greet/{name}';
18-
ownership : UserList { users: [
19-
'user1',
20-
'user2'
21-
] };
16+
ownership : UserList { users: ['user1', 'user2'] };
2217
function : model::greet(String[1]):String[1];
23-
documentation : 'A simple hosted service that greets users by name';
18+
documentation : 'A simple hosted service';
2419
autoActivateUpdates : true;
2520
}
2621

27-
// Hosted service with Deployment ownership and stereotypes
2822
HostedService <<meta::pure::profiles::doc.doc>> {doc.doc = 'Example with deployment ownership'} model::DeploymentHostedService
2923
{
3024
pattern : '/api/process/{data}';
3125
ownership : Deployment { identifier: '12345' };
3226
function : model::processData(String[1]):String[1];
33-
documentation : 'A hosted service that processes data with deployment ownership';
27+
documentation : 'A hosted service with deployment ownership';
3428
autoActivateUpdates : false;
3529
}
3630

37-
// Hosted service with post-deployment actions
3831
HostedService model::AdvancedHostedService
3932
{
4033
pattern : '/api/advanced/{param}';
41-
ownership : UserList { users: [
42-
'admin'
43-
] ] };
34+
ownership : UserList { users: ['admin'] };
4435
function : model::processData(String[1]):String[1];
45-
documentation : 'Advanced hosted service with post-deployment actions';
36+
documentation : 'Advanced hosted service';
4637
autoActivateUpdates : true;
4738
}

0 commit comments

Comments
 (0)