Skip to content

Commit

Permalink
add and count now running on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lathoub committed Feb 12, 2025
1 parent 65dc453 commit 07f08ee
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 7 deletions.
36 changes: 36 additions & 0 deletions Bruno/OGC-API/Processes/Execute Add async.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
meta {
name: Execute Add async
type: http
seq: 3
}

post {
url: http://localhost:8080/demoservice/v1/processes/add/execution
body: json
auth: none
}

headers {
Prefer: respond-async
}

body:json {
{
"inputs": {
"number1": 19,
"number2": 7
},
"outputs": {
"sum": {
"transmissionMode": [
"value"
]
}
},
"subscriber": {
"successUri": ":serviceUrl/callback/:jobId?type=success",
"inProgressUri": ":serviceUrl/callback/:jobId?type=inProgress",
"failedUri": ":serviceUrl/callback/:jobId?type=failed"
}
}
}
32 changes: 32 additions & 0 deletions Bruno/OGC-API/Processes/Execute Add.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
meta {
name: Execute Add
type: http
seq: 2
}

post {
url: http://localhost:8080/demoservice/v1/processes/add/execution
body: json
auth: none
}

body:json {
{
"inputs": {
"number1": 19,
"number2": 7
},
"outputs": {
"sum": {
"transmissionMode": [
"value"
]
}
},
"subscriber": {
"successUri": ":serviceUrl/callback/:jobId?type=success",
"inProgressUri": ":serviceUrl/callback/:jobId?type=inProgress",
"failedUri": ":serviceUrl/callback/:jobId?type=failed"
}
}
}
31 changes: 31 additions & 0 deletions Bruno/OGC-API/Processes/Execute Count.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
meta {
name: Execute Count
type: http
seq: 4
}

post {
url: http://localhost:8080/demoservice/v1/processes/countFeatures/execution
body: json
auth: none
}

body:json {
{
"inputs": {
"uri": "http://localhost:8080/demoservice/v1/collections/NAPPeilmerken/items"
},
"outputs": {
"count": {
"transmissionMode": [
"value"
]
}
},
"subscriber": {
"successUri": ":serviceUrl/callback/:jobId?type=success",
"inProgressUri": ":serviceUrl/callback/:jobId?type=inProgress",
"failedUri": ":serviceUrl/callback/:jobId?type=failed"
}
}
}
35 changes: 35 additions & 0 deletions Bruno/OGC-API/Processes/Execute echo async.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
meta {
name: Execute echo async
type: http
seq: 5
}

post {
url: http://localhost:8080/demoservice/v1/processes/echo/execution
body: json
auth: none
}

headers {
Prefer: respond-async
}

body:json {
{
"inputs": {
"uri": "http://localhost:8080/demoservice/v1/collections/NAPPeilmerken/items?f=json"
},
"outputs": {
"echo": {
"transmissionMode": [
"value"
]
}
},
"subscriber": {
"successUri": ":serviceUrl/callback/:jobId?type=success",
"inProgressUri": ":serviceUrl/callback/:jobId?type=inProgress",
"failedUri": ":serviceUrl/callback/:jobId?type=failed"
}
}
}
11 changes: 11 additions & 0 deletions Bruno/OGC-API/Processes/get processes.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
meta {
name: get processes
type: http
seq: 1
}

get {
url: http://localhost:8080/demoservice/v1/processes
body: none
auth: none
}
10 changes: 4 additions & 6 deletions data/processes/addNumbers/add.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@ECHO OFF

echo %1 %2
@set a=%1%
@set b=%2
@set /a "sum=%a%+%b%"

set /a v = %1
set /a v2 = %1 + 1
set /a v3 = %1 * 2

echo %v% %v2% %v3%
echo %sum%
2 changes: 1 addition & 1 deletion data/processes/countFeatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Count features",
"description": "Count the total number of features from an API Features endpoint.",
"version": "0.0.1",
"jobControlOptions": ["async-execute", "dismiss"],
"jobControlOptions": ["sync-execute"],
"outputTransmission": ["value", "reference"],
"inputs": {
"uri": {
Expand Down
1 change: 1 addition & 0 deletions src/models/processes/execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function post(neutralUrl, processId, parameters, prefer, callback) {
process_.location.replace(/\.[^/.]+$/, ""),
"launch.js"
);

const fileExists = existsSync(pathToLauncher);
if (!fileExists)
return callback(
Expand Down
4 changes: 4 additions & 0 deletions src/models/processes/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ export function get(neutralUrl, format, jobId, callback) {
* @param {*} callback
*/
export function execute(path, process_, job, isAsync, parameters, callback) {

if (process.platform == 'win32')
path = 'file://' + path;

try {
import(path)
.then((module) => {
Expand Down

0 comments on commit 07f08ee

Please sign in to comment.