diff --git a/src/ogc/connection.js b/src/ogc/connection.js index efd5c0f..4828759 100644 --- a/src/ogc/connection.js +++ b/src/ogc/connection.js @@ -44,7 +44,7 @@ class OgcConnection extends Connection { } return Boolean(spec && spec.ogcapi); }); - let requestBody = Migrate.executeSync(openEO); + let requestBody = Migrate.executeSync(this.connection, openEO); let headers = {}; if (mode === 'async') { headers.Prefer = 'respond-async'; diff --git a/src/ogc/migrate.js b/src/ogc/migrate.js index 03a0cc9..363efd5 100644 --- a/src/ogc/migrate.js +++ b/src/ogc/migrate.js @@ -161,20 +161,21 @@ class OgcMigrate { * Executes an OGC API process synchronously. * * @todo Check whether implementation still works + * @param {Connection} connection * @param {object} requestBody * @returns {object} */ - static executeSync(requestBody) { + static executeSync(connection, requestBody) { const graph = Object.values(requestBody.process.process_graph); const valid = graph.every(node => { - let spec = OgcMigrate.connection.processes.get(node.process_id); + let spec = connection.processes.get(node.process_id); return Boolean(spec && (spec.ogcapi || spec.id === 'load_collection')); }); if (!valid) { throw new Error('Process must consist only of OGC Processes and Collections'); } - const parser = new PgParser(requestBody.process, OgcMigrate.connection.getBaseUrl()); + const parser = new PgParser(requestBody.process, connection.getBaseUrl()); return parser.parse(); }