Dear community,
I try to start a workflow, initiated by a JQuery Ajax Post request from my website. This works well if I put no data on it.
$('#start-workflow-button').on('click', function() {
$.ajax({
url: 'http://sma6434:8081/engine-rest/process-definition/key/ToolingWorkflow/submit-form',
method: "POST",
contentType: "application/json",
dataType: 'json',
success: function(result){
console.log(result);
}
})
})
Now I add some JSON:
$('#start-workflow-button').on('click', function() {
$.ajax({
url: 'http://sma6434:8081/engine-rest/process-definition/key/ToolingWorkflow/submit-form',
method: "POST",
contentType: "application/json",
dataType: 'json',
data: {
"variables": {
"myrequest" : {
"value" : "aStringValue",
"type": "String",
"valueInfo" : {
"transient" : true
}
}
},
"businessKey" : "myBusinessKey"
},
success: function(result){
console.log(result);
}
})
})
This leads to a response of 400 with the body of {"type":"InvalidRequestException","message":""}
The picture below shows how I setup the entrypoint of the Process
below the JSON of the connected form
{
"schemaVersion": 2,
"components": [
{
"label": "myrequest",
"type": "textfield",
"id": "Field_1tnyq7k",
"key": "myrequest",
"validate": {
"required": false
},
"description": "some text from external app"
}
],
"type": "default",
"id": "Form_1nxvfgw"
}
Has somebody an idea what is going wrong here?
Thanks a lot for your help
Michael