Hi OS-Team,
in your documentation of the BPM-API, there is a part where i can add a process file to a running process. See here.
Unfortunately, this script does not work. I get this error: "File element not found".
We try to add a file to the BPM-Process. The File is already uploaded to yuuvis and we select it on the form by id.
For adding the file we use the syntax from here
Our Scriptcode:
var dmsObjectId = $.variable("exchangedocumentid").value; // the id of the dms object to be added
$.log.info("Add Element: " + dmsObjectId);
var http;
if ($.file.get().length > 0) { // if any objects in the process file exist
http = $.http.put();
} else { // if not
http = $.http.post();
}
var response = http
.service('bpm')
.path('/api/bpm/process/'+$.process.id+'/file/'+dmsObjectId)
.param('processId', $.process.id)
.param('dmsObjectId', dmsObjectId)
.query('type', dmsObjectType)
.execute();
$.log.info(JSON.stringify(response));
$.done();
The Logs:
Add Element: 733E8FF0F2DA41C398668B87A4390123
{"status":"404","reason":"","data":{"key":"service.bpm.file.element.not.found","message":"File element not found."}}
The Element can be found by this ID.
Do you have any idea why there is this 404 error?
Jan