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?

https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&objId=67789539&objAction=browse&viewType=1

Best Answers

Answers

  • 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.

  • AJ Gorczyca
    edited December 3, 2019 #7

    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.

  • I am not aware of the existence of such documentation.

  • 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.

  • 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

  • Hi!

    How to get workflow data/information ?

  • appuq
    appuq Member

    As a typical reply to questions like this, I usually answer this

    1. 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)
    2. 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.
    3. As always an Oscript developer can get this or add any new REST api's.

  • Hello @appuq, I'm new, could you share an example with me?
    
  • appuq
    appuq Member
    edited March 19 #14

    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

    https://appukili.wordpress.com/2022/04/17/take-some-rest/

  • 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.

  • appuq
    appuq Member
    edited November 6 #16

    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..

  • 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.

  • 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.

  • I am glad it worked so did you design it with WR Tags or REST? note calling a REST API using a browser, WR is a client action like Ajax so it will not run like a back ground aspect.WR tags are resolved at the server so you have better luck there.RESTClient is another option.

  • 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 .

    @Jacopo

  • 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

  • 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.

    @appuq

  • 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 …