Skip to content

Commit

Permalink
Fix errors in examples scriptlets
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo291196 committed Jan 31, 2022
1 parent efb5e4b commit 6827953
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
11 changes: 6 additions & 5 deletions examples/bpmn/profile/js/generate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

clout.exec('tosca.lib.traversal');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

tosca.coerce();
traversal.coerce();

let bpmn = puccini.newXMLDocument();

Expand Down Expand Up @@ -55,8 +56,8 @@ function createPolicyProcess(id, vertex) {
}

let startGateway, startEvent, endGateway, endEvent, endTask;
let startGateway = startEvent = createEvent(process);
let endEvent = createEvent(process, true);
startGateway = startEvent = createEvent(process);
endEvent = createEvent(process, true);

let code = puccini.sprintf('\nstartProcess("%s");\n', policy.properties.bpmn_process_id);
endGateway = endTask = createScriptTask(process, clout.newKey(), 'startProcess', code);
Expand Down Expand Up @@ -104,7 +105,7 @@ function createWorkflowProcess(id, vertex) {
// Link previous tasks in graph
for (let name in tasks) {
let task = tasks[name];
for (n in task.next) {
for (let n in task.next) {
let nextName = task.next[n];
tasks[nextName].prev.push(name);
}
Expand Down
5 changes: 3 additions & 2 deletions examples/dgraph/dgraph.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

// See: https://docs.dgraph.io/mutations/#json-mutation-format

clout.exec('tosca.lib.traversal');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

tosca.coerce();
traversal.coerce();

let vertexItems = [];
let cloutItem = {'clout.vertex': vertexItems};
Expand Down
4 changes: 2 additions & 2 deletions examples/javascript/imports/endpoints.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This scriptlet gathers all endpoint capabilities and generates a report

traversal = require('tosca.lib.traversal');
tosca = require('tosca.lib.utils');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

// "traversal.coerce" calls all intrinsic functions and validates all constraints
traversal.coerce();
Expand Down
4 changes: 2 additions & 2 deletions examples/javascript/imports/extract.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This scriptlet extracts all artifacts to the output directory

traversal = require('tosca.lib.traversal');
tosca = require('tosca.lib.utils');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

traversal.coerce();

Expand Down
5 changes: 3 additions & 2 deletions examples/neo4j/neo4j.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@

// See: https://neo4j.com/docs/http-api/3.5/

clout.exec('tosca.utils');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

tosca.coerce();
traversal.coerce();

let statements = [];

Expand Down
5 changes: 3 additions & 2 deletions examples/openstack/profile/js/generate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

clout.exec('tosca.lib.traversal');
const traversal = require('tosca.lib.traversal');
const tosca = require('tosca.lib.utils');

tosca.coerce();
traversal.coerce();

// Vars
writeTopology();
Expand Down

0 comments on commit 6827953

Please sign in to comment.