REST Api - Workflow Attributes
I see that the Rest API documentation for Processes has been updated with some new endpoints. However, it's hard to tell from the documentation if it's possible now to update Workflow Attributes from the Rest Api. Is this something that can be done yet? And if so are there any examples?
Best Answers
-
The
Manage processes / workflows
endpoints that are currently available in the REST API do not show any signs of this possibility. Based on thePUT
actions, you're only able to either change the state of the workflow or push a workflow by its disposition.5 -
To update WF attribute using REST API:
URI - /api/v2/processes/{process_id}/subprocesses/{subprocess_id}/tasks/{task_id}
Method - PUT
HTTP Body (Form Data) example:
body: {"action":"formUpdate","values":{"WorkflowForm_2":"Company1"}}5
Answers
-
The
Manage processes / workflows
endpoints that are currently available in the REST API do not show any signs of this possibility. Based on thePUT
actions, you're only able to either change the state of the workflow or push a workflow by its disposition.5 -
That's disappointing, I had thought that was something that was going to be added in soon. I hope it's on the roadmap still for Workflow APIs.
0 -
To update WF attribute using REST API:
URI - /api/v2/processes/{process_id}/subprocesses/{subprocess_id}/tasks/{task_id}
Method - PUT
HTTP Body (Form Data) example:
body: {"action":"formUpdate","values":{"WorkflowForm_2":"Company1"}}5 -
Thanks Ivan, do you happen to know if there is documentation anywhere for what is acceptable for the different "actions" for this?
The API documentation is really lacking in this area. Very rarely does it show what actually are acceptable values it can accept in cases like this.
0 -
I am not aware of the existence of such documentation.
0 -
How were you able to figure it out without documentation then if you don't mind me asking? Just wondering if I'm missing a way I could discover some of this for myself in the future.
0 -
Hi All, can you please provide an API to fetch the attribute values from the workflow using workflow id, i am able to retrieve the Attribute name via api/v2/workflows/status/processes/{workflowid} but not able to retrieve the values
0 -
As a typical reply to questions like this, I usually answer this
- OT created SmartUI so they can use REST API as the way to offer functionality so if the SMARTUI shows WF Attribute data you can look at the payload using developer tools/fiddler and craft your calls. We all do this as REST API has almost no examples other than a few(including stuff I put out)
- For all Content Server activities(the one they renamed from Livelink) the toolkit called Web Reports(WR) has almost everything/anything conceivable with that. So if you know your workid/subworkid then getting WF Attribute data is like a 2 min job. Add on top of it that any WR can be made to work as a REST API endpoint you have a considerable anvil with which you can please your boss/as well as tide over any crisis:).Well, this is not the REST API OT put out but a different way if one needed a solution.
- As always an Oscript developer can get this or add any new REST api's.
0 -
What have you done now as a starting work can the forum users see it? Are you saying you are a developer who doesn't know how to use Browser Tools or Fiddler?. Can you do F12 when the smartui page of CS opens up and try to identify requests/responses….I sometimes find Fiddler to be easier.
BTW in my blog, I have worked out a fairly decent workflow example with screencaps etc.It was done a few years back so if the API has changed I wouldn't know
0 -
Hello
I'm trying to sendon a process in a workflow but i got this response
what i actually try to do is to make action like sendon or stop a task process from api i will then put in a webreport.
0 -
if the code is correct my guess is if you go and look at the WF Instance in the GUI the step that you are sending should be in "Green" and it should have a button or link that says "Send On".The code may be correct and the API is just spitting what the server says.
In WF a Step can be "actioned" only if it is ready because a map is a set of series of steps with links so to send something "ON" the "Step" has to be "Active".It becomes active if a Prior step or disposition pushes it on. Look at the Map visually to understand what I am saying.
You can also debug it using Smartui look at my recent response on how Smartui can be used
PS: WR also has its tags doing that sp if it works and your rest pi doesn't work then your code is wrong. I suspect you will get that message if you use WR as well..
1 -
Your error is that the user that executes the API function doesn't have the rights to send-on the task, i.e. the task is not assigned to that user.
The CS WF doesn't support stopping a task. It only allows for stopping the workflow.
WebReports has already build-in tags to do this kind of action, so there is no need to make an extra REST call. Look for the tag WFTASKACTION and WFACTION.
1 -
Thanks guys i checked what you refer to. I found everything is okay and checked the request sent from the smartui compared to my request and i successfully sendon the task from the WR.
0 -
One other aspect that I wanted to say is AnswerModules is a great add-on to invest in if you want to make an easy beautiful user interface and functionalities within your existing Content Server or Extended ECM operations.AnswerModules also allows your technical debt to be much smaller as they support the OT cloud as well. I have used AM since 2014 or so and they have greatly reduced needs for WR or Oscript .
1 -
Hi Appu, thanks for tagging me. Yes, as you mentioned, with the Module Suite there is an entire package dedicated to flow manipulation, allowing you to achieve everything programmatically or via the user interface in just a few lines of code. Unlike WebReports, for example, you would also have the ability to add custom logic, manage edge cases easily, and implement error handling to make the code resilient and provide users with error notifications or options on how to proceed. And of course, there are countless other added values, including, as you mentioned, the ability to create ergonomic and appealing forms, components, pages, and dashboards.
Jacopo Malnati
0 -
I designed it with REST, what I was trying to do is to add a webreport to check for a user selected in the attributes if he has permission on an item reference and according to that change attribute to be evaluated on.
the stupid thing in the flow now is the initiator after imitating the workflow instance has to run the web report step as the REST service runs as client-side scripting so the workflow agent cannot run it as you say.0 -
To me it sounds like you have some kind of fixed intention on using programming. What I would do is assign it to a step , then when the step comes access it , by that what I mean is you try to do without using rest , wr etc what you intend to do , does the step user have access to the IR object and change it ? If the answer is yes remove those step and try to choreograph what you just did with instructions written in WR tags . If you accomplish that then you have effectively achieved what you need and people will appreciate you for your ‘auto magic’ . That is how I do these things …0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 151 General Questions
- 146 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 179 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 9 XM Fax
- Follow Categories