Rest API: create process with item

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 01:00 PM
Hello,
I am currently trying to create a process by using the REST API : HTTP POST request at /alfresco/api/-default-/public/workflow/versions/1/processes with the following data:
{ "processDefinitionKey": "mbWfAddContent", "variables": { "bpm_assignee": "...", "bpm_sendEMailNotifications": true, "bpm_workflowPriority": 0, "mbwf_contentType": "Recording" }but it fails with error 500 and this message "Incorrect number of document attached to this workflow. Only one document is accepted". This is because the workflow's startEvent script has
if(bpm_package.children.length == 1) ..... elseIs there a way to add items to a process directly in the process creation request ?
throw new Error("Incorrect number of document attached to this workflow. Only one document is accepted");
I cannot use the POST request to alfresco/api/-default-/public/workflow/versions/1//processes/{processId}/items because the process does not exist yet at this point, so it does not have an id yet.
Thanks !
Labels:
- Labels:
-
Alfresco Content Services
0 REPLIES 0
