Hi every one.
I want to design a process in this way.
A customer orders a products. when the order is submitted, a service task get the stock data from a data base(here is google spreadsheet) and then decide which path should become active based on the amount of the order.
I have two problem:
1: when ever I reach the first service task, this message puped up : An error happened while submitting the task form :
Cannot submit task form c3d43cea-3b51-11ee-bda6-160a6459c529: Unable to compile script: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script7.groovy: 3: expecting ‘(’, found ‘def’ @ line 3, column 1.
def user=slurper.parseText(response.toString())
^
2: I dont know if the conditions on my gate ways are correct or not.
here is the link to my google spreadsheet:
and here is the web app url
https://script.google.com/macros/s/AKfycbwearkv0rySxI5-IDp_ySwnj9DOzF0T4bfYmd0A86FzPpcGNHYCBTJeOb79Yztr8d0/exec
ad the app script code
function doGet() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(“store”);
var data = sheet.getDataRange().getValues();
var headers = data.shift(); // Remove headers from data
var result = [];
for (var i = 0; i < data.length; i++) {
var row = data[i];
var item = {
brand: row[0],
type: row[1],
amount: row[2]
};
result.push(item);
}
var output = {
data: result
};
return ContentService
.createTextOutput(JSON.stringify(output))
.setMimeType(ContentService.MimeType.JSON);
}
purchase Form.bpmn (15.1 KB)
requestform.form (1.6 KB)