Going over the CS RestAPI documentation, in the Process section, there isn't an endpoint to update Workflow forms or attributes. Also under the Forms section, they refer to the forms as alpaca. Whatever that is, I don't see a way to update form inside a Workflow Package.
Any guidance?
https://developer.opentext.com/ce/products/content-management/apis/content-server-23-3-0
If there are Accepted Answers, those will be shown by default. You can switch to 'All Replies' by selecting the tab below.
The doco for this is awful but I managed to put a solution together late last week based on hitting up Google which pulled some results from the forum and elsewhere.
In my solution (still in build), I created this jQuery function:
function setWorkflowAttributes(wfId, type, dataid, division){ $.ajax({ url: "[LL_REPTAG_URLPREFIX /]/api/v2/workflows/draftinstances/" + wfId, method: "PUT", headers: { "OTCSTicket": "[LL_REPTAG_OTCSTICKET /]", "Content-Type": "application/x-www-form-urlencoded" }, data: { "body": "{\"action\":\"formUpdate\",\"values\":{\"WorkflowForm_2\":\"\",\"WorkflowForm_3\":"+dataid+",\"WorkflowForm_4\":\""+type+"\",\"WorkflowForm_5\":\""+division+"\"}}" }, beforeSend: function(){ $('#btnspan' + dataid).html('Setting attributes'); $('#img' + dataid).removeClass('bi-hourglass-top').addClass('bi-hourglass-split'); }, success: function(data){ initiateWorkflow(wfId, type, dataid, division) } }); }
This updates workflow attributes based on the attribute id. I don't have any forms so I can't advise on the difference between updating attributes and form fields. I also went through the process of capturing the REST calls in Dev Tools when I initiated the workflow using the Smart UI. That helped me put it together with what Google had helped with too.
A lot of us old timers look at the payload the smartui produces. The clue is that if you can do a workflow with forms using the Smartui, you can do it via REST, as smartui is the first client OT produced to consume its REST APIs. Such an approach is shown in my blog here. I think I was showing how one updates workflow attributes so you could try the same approach by looking at the payload.
https://appukili.wordpress.com/2022/04/17/take-some-rest/ I wrote this after seeing this thread https://forums.opentext.com/forums/developer/discussion/300725/initiate-workflow-from-rest#latest
so, /draftprocess is where it is. thank you so much!
EDIT
No it's not. Draftprocess is for when you are staging a new workflow for initiation. What i really want is to update a form after a workflow is initiated.
Just to confirm, you are trying to do this on an adhoc basis, as and when an administrator or an external process needs to make a change to a workflow without being associated with a user step, or a workflow process step (or WebReports WWX steP)?
Yes and No. Yes I want to be able to update the form on an Adhoc basis, but I do want this to be done when the workflow is parked at a User or Form step. I can see that the Form Template view can already kind of do this, but I want to see if I can get away from working with the _w_x_y_z syntax; and if I can build my workflow application in a more isolated sandbox, and communicate with Content Server Workflow only when I wanted to via RestAPI.