Skip to content

Commit 28e7d89

Browse files
author
Istemi Ekin Akkus
committed
merge develop; add GUI changes to workflow editor for checking KNIX extensions to ASL
1 parent bcde445 commit 28e7d89

File tree

11 files changed

+80
-31
lines changed

11 files changed

+80
-31
lines changed

GUI/app/pages/workflows/WorkflowEditorCtrl.js

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,36 @@
5252
var succeed = $.getJSON("lib/asl-validator/schemas/succeed.json", function(json) {
5353
});
5454

55+
// KNIX extensions to ASL
56+
var knix_task = $.getJSON("lib/knix-asl-validator/schemas/task.json", function(json) {
57+
});
58+
59+
var knix_choice = $.getJSON("lib/knix-asl-validator/schemas/choice.json", function(json) {
60+
});
61+
62+
var knix_fail = $.getJSON("lib/knix-asl-validator/schemas/fail.json", function(json) {
63+
});
64+
65+
var knix_mapState = $.getJSON("lib/knix-asl-validator/schemas/map.json", function(json) {
66+
});
67+
68+
var knix_parallel = $.getJSON("lib/knix-asl-validator/schemas/parallel.json", function(json) {
69+
});
70+
71+
var knix_wait = $.getJSON("lib/knix-asl-validator/schemas/wait.json", function(json) {
72+
});
73+
74+
var knix_state = $.getJSON("lib/knix-asl-validator/schemas/state.json", function(json) {
75+
});
5576

77+
var knix_stateMachine = $.getJSON("lib/knix-asl-validator/schemas/state-machine.json", function(json) {
78+
});
79+
80+
var knix_pass = $.getJSON("lib/knix-asl-validator/schemas/pass.json", function(json) {
81+
});
82+
83+
var knix_succeed = $.getJSON("lib/knix-asl-validator/schemas/succeed.json", function(json) {
84+
});
5685

5786
var urlPath = sharedProperties.getUrlPath();
5887

@@ -1212,7 +1241,7 @@
12121241
choice.responseJSON,
12131242
fail.responseJSON,
12141243
parallel.responseJSON,
1215-
mapState.responseJSON,
1244+
mapState.responseJSON,
12161245
pass.responseJSON,
12171246
stateMachine.responseJSON,
12181247
state.responseJSON,
@@ -1225,15 +1254,35 @@
12251254

12261255
if (!valid) {
12271256
console.log("Invalid Amazon States Language (ASL) specification.");
1228-
$scope.errorMessage = "Invalid Amazon States Language (ASL) specification.";
1229-
$uibModal.open({
1230-
animation: true,
1231-
scope: $scope,
1232-
templateUrl: 'app/pages/workflows/modals/errorModal.html',
1233-
size: 'md',
1234-
});
1235-
$scope.aceWorkflowEditor.focus();
1236-
return;
1257+
console.log("Checking KNIX extensions validity...");
1258+
const ajv_knix = new Ajv({
1259+
schemas: [
1260+
knix_choice.responseJSON,
1261+
knix_fail.responseJSON,
1262+
knix_parallel.responseJSON,
1263+
knix_mapState.responseJSON,
1264+
knix_pass.responseJSON,
1265+
knix_stateMachine.responseJSON,
1266+
knix_state.responseJSON,
1267+
knix_succeed.responseJSON,
1268+
knix_task.responseJSON,
1269+
knix_wait.responseJSON,
1270+
],
1271+
});
1272+
var valid_knix = ajv_knix.validate('http://knix-asl-validator.cloud/state-machine#', workflowJson);
1273+
console.log("valid_knix: " + valid_knix);
1274+
if (!valid_knix)
1275+
{
1276+
$scope.errorMessage = "Invalid Amazon States Language (ASL) specification and/or ASL KNIX extensions.";
1277+
$uibModal.open({
1278+
animation: true,
1279+
scope: $scope,
1280+
templateUrl: 'app/pages/workflows/modals/errorModal.html',
1281+
size: 'md',
1282+
});
1283+
$scope.aceWorkflowEditor.focus();
1284+
return;
1285+
}
12371286
}
12381287
}
12391288
enableFunctionCodeTabs(workflowJson);

GUI/lib/knix-asl-validator/schemas/choice.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/choice#",
2+
"$id": "http://knix-asl-validator.cloud/choice#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"definitions": {
55
"Operator": {

GUI/lib/knix-asl-validator/schemas/fail.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/fail#",
2+
"$id": "http://knix-asl-validator.cloud/fail#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {

GUI/lib/knix-asl-validator/schemas/map.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/map#",
2+
"$id": "http://knix-asl-validator.cloud/map#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {
@@ -33,7 +33,7 @@
3333
"minimum": 0
3434
},
3535
"Iterator": {
36-
"$ref": "http://asl-validator.cloud/state-machine#"
36+
"$ref": "http://knix-asl-validator.cloud/state-machine#"
3737
},
3838
"Parameters": {
3939
"type": "object"

GUI/lib/knix-asl-validator/schemas/parallel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/parallel#",
2+
"$id": "http://knix-asl-validator.cloud/parallel#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {
@@ -34,7 +34,7 @@
3434
"type": "array",
3535
"items": {
3636
"types": {
37-
"$ref": "http://asl-validator.cloud/state-machine#"
37+
"$ref": "http://knix-asl-validator.cloud/state-machine#"
3838
}
3939
}
4040
},

GUI/lib/knix-asl-validator/schemas/pass.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/pass#",
2+
"$id": "http://knix-asl-validator.cloud/pass#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {

GUI/lib/knix-asl-validator/schemas/state-machine.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/state-machine#",
2+
"$id": "http://knix-asl-validator.cloud/state-machine#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {
@@ -19,7 +19,7 @@
1919
"type": "object",
2020
"patternProperties": {
2121
"^.{1,128}$": {
22-
"$ref": "http://asl-validator.cloud/state#"
22+
"$ref": "http://knix-asl-validator.cloud/state#"
2323
}
2424
},
2525
"additionalProperties": false
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
{
2-
"$id": "http://asl-validator.cloud/state#",
2+
"$id": "http://knix-asl-validator.cloud/state#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"oneOf": [{
6-
"$ref": "http://asl-validator.cloud/choice#"
6+
"$ref": "http://knix-asl-validator.cloud/choice#"
77
},
88
{
9-
"$ref": "http://asl-validator.cloud/fail#"
9+
"$ref": "http://knix-asl-validator.cloud/fail#"
1010
},
1111
{
12-
"$ref": "http://asl-validator.cloud/parallel#"
12+
"$ref": "http://knix-asl-validator.cloud/parallel#"
1313
},
1414
{
15-
"$ref": "http://asl-validator.cloud/map#"
15+
"$ref": "http://knix-asl-validator.cloud/map#"
1616
},
1717
{
18-
"$ref": "http://asl-validator.cloud/pass#"
18+
"$ref": "http://knix-asl-validator.cloud/pass#"
1919
},
2020
{
21-
"$ref": "http://asl-validator.cloud/succeed#"
21+
"$ref": "http://knix-asl-validator.cloud/succeed#"
2222
},
2323
{
24-
"$ref": "http://asl-validator.cloud/task#"
24+
"$ref": "http://knix-asl-validator.cloud/task#"
2525
},
2626
{
27-
"$ref": "http://asl-validator.cloud/wait#"
27+
"$ref": "http://knix-asl-validator.cloud/wait#"
2828
}
2929
]
3030
}

GUI/lib/knix-asl-validator/schemas/succeed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/succeed#",
2+
"$id": "http://knix-asl-validator.cloud/succeed#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {

GUI/lib/knix-asl-validator/schemas/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/task#",
2+
"$id": "http://knix-asl-validator.cloud/task#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {

GUI/lib/knix-asl-validator/schemas/wait.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$id": "http://asl-validator.cloud/wait#",
2+
"$id": "http://knix-asl-validator.cloud/wait#",
33
"$schema": "http://json-schema.org/draft-07/schema#",
44
"type": "object",
55
"properties": {

0 commit comments

Comments
 (0)