IT Process Automation

Expand all | Collapse all

CAPA 4.3.02 Restful API

  • 1.  CAPA 4.3.02 Restful API

    Posted May 15, 2017 10:01 AM

    Hi,

     

    I just installed CAPA 4.3.02 in my Sandbox environment, and I was taking a look at the new built-in Restful API.

     

    One of the things I noticed was that the Start a Process API accepts only an ID value to start the process

    https://capa-automation.***.***:8443/api/rest/v1/processes/{ID}/start

     

    Currently I have been using the SOAP API to start processes from my other applications.  The SOAP API uses the path of the process to start.  So I was able to use the /v1/processes to convert the path to the ID, and provide the ID to the /processes/{ID}/start to start the process.

     

    However, the SOAP API also allows you to pass additional parameters as part of the call.  This is critical to me, as I usually am passing specific variables to the process when I trigger it.

     

    I can't find anything in the documentation about passing additional parameters to the job as part of the /start API.

     

    Just curious if anyone else has started playing with it.

     

    chivi06

    Thanks,

    Ian



  • 2.  Re: CAPA 4.3.02 Restful API

    Posted May 15, 2017 10:33 AM

    Hi,

     

    I too would like to know if we shall need ID with Restful API in version 4.3 SP2 . We also need to pass arguments in StartRequest.

     

    We haven't installed this version for the moment.

     

    We have been using the previous REST API , and we  used to start process with

    http:/...../node/rest/CA:00074_CA:00074:01/_ops/Start

     

    and in request we send something like that

     

    <StartRequest
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:type="p1:StartRequest"
    xmlns:p1="http://ns.ca.com/2011/09/pam-ops" >
    <EntityID>
    <MdrElementID>'.$path.'</MdrElementID>
    </EntityID>'
    .$args
    .'</StartRequest>'

     

     

    If the path is the ID, we already use it, but if ID is another data than the path, where do we find ID of a task ?

    Thanks,

    Vanessa



  • 3.  Re: CAPA 4.3.02 Restful API
    Best Answer

    Posted May 17, 2017 03:26 AM

    Hi Ian,

     

    As part of the new REST implementation, we have migrated to ID's since they are unique (primary key) and also in alignment with REST standards. However, as mentioned you have other services to retrieve ID's for a specific resource.

    The other use case you mentioned, i.e. passing additional parameters while starting a process seems to be a defect. Could you please raise a support ticket and my team could help you with the resolution at the earliest.

    Thanks for your cooperation.

     

    Regards

    Vinay



  • 4.  Re: CAPA 4.3.02 Restful API

    Posted May 19, 2017 10:34 AM

    Thanks Vinay,

     

    I have opened up support case: 00751520, Potential defect in the 4.3.2 RESTful API start function.



  • 5.  Re: CAPA 4.3.02 Restful API

    Posted Jul 14, 2017 02:05 PM

    I'm looking at 4.3.02 as well. The documentation isn't very helpful - where does one find the ID of an unstarted process? And how does one pass parameters to a process from a REST call?



  • 6.  Re: CAPA 4.3.02 Restful API

    Posted Jul 14, 2017 04:20 PM

    Hi Rob,

     

    1) To get the ID of a process you want to start, you need to request the OID from CAPA via the REST API

     

    For example:

       https://SERVERPATH:PORT/api/rest/v1/processes

       Returns you a list of all the processes in your environment

     

    To narrow it down a little, you can specify a path:

       https://SERVERPATH:PORT/api/rest/v1/processes?path=/Sandbox/Ian_Sandbox/IanSBX

       This would return you just a list of all the processes in that path

    You could then take the OID from that query and use it in the REST request via:  /v1/processes/{ID}/start 

     

    2) Passing parameters from a REST call currently isn't availableI opened a case for this, and they replied that they have created a fix for this, and will be released as Hot Fix 1 for 4.3 SP2.

     

    Hope this helps,

    Ian



  • 7.  Re: CAPA 4.3.02 Restful API

    Posted Jul 17, 2017 09:00 AM

    Oh man. I'm going to need that fix.



  • 8.  Re: CAPA 4.3.02 Restful API

    Posted Jul 18, 2017 05:11 AM

    Hi Rob, Ian,

     

    We have planned for a HF on PAM 4.3.2 which is expected to be released end of this month. You can coordinate with our support team for more details around this.

     

    Thanks

    Vinay



  • 9.  Re: CAPA 4.3.02 Restful API

    Posted Jul 25, 2017 08:15 AM

    Hi Rob, Ian,

     

    Our team has fixed the above use case and a Hot fix is currently available for PAM 4.3.2. Please talk to our L1 support team and they could provide you the required media.

     

    Thanks

    Vinay



  • 10.  Re: CAPA 4.3.02 Restful API

    Broadcom Employee
    Posted Jan 09, 2018 10:00 AM

    This has now been fixed in a publically available cumulative patch pack for 4.3 sp2.

     

    WIN-CA PAM 4.3 SP02 CP01

    Fix #RO98201

     

    This fix can be downloaded from the support.ca.com Solutions download page.

     

     



  • 11.  Re: CAPA 4.3.02 Restful API

    Posted May 04, 2018 12:50 PM

    Hi,

    I have another question.

    Can we start a process in "suspended mode" with OpenApi ? I don't find how to do this.



  • 12.  Re: CAPA 4.3.02 Restful API

    Posted May 04, 2018 12:59 PM

    Hi,

     

    Do you mind if I ask what exactly you are trying to accomplish by starting the job in "suspended mode" ?



  • 13.  Re: CAPA 4.3.02 Restful API

    Posted May 07, 2018 11:23 AM

    Hi,

     

    I mean to start it "suspended" like we can do by right clicking on process in library tab and click on "start suspended".

     

    The goal is to be able to start the process with OpenAPi (with parameters) and to let someone put a break point somewhere in the process before starting the  execution.

    (We don't want to have a break point each time)

     

    Maybe we can do otherwise ?



  • 14.  Re: CAPA 4.3.02 Restful API

    Posted May 07, 2018 04:52 PM

    Hi,

     

    Ok, I understand what you would like (and I understand you may have your reasons for wanting to do that).

     

    I thought it was an interesting thought experiment, so I came up with a simple way for you to do it.

     

    Create a Boolean process variable called something like Process.StartSuspended, whose default value is False.

     

    The first operator in your process can be an evaluate expression which checks to see if the value is true, if it isn't (by default) the process would execute normally.  But if you have passed a value of Process.StartSuspended = True via the REST API to start the job, it would trigger a PUT REST API command to CAPA to suspend the job.

     

    So basically your PUT operator pre-execution code would be something like:

    Process[OpName].TestURL = "https://servername:port/api/rest/v1/processinstances/" + Process.RuntimeROID + "/suspend";

     

    This would pass the current job's ROID to the API and tell it to suspend (itself), I then added a small delay of 30 seconds just in case the API command takes a few seconds to kick in.

     

    From my tests, this seemed to work pretty quickly, and the jobs were suspended.

     

    Hope this helps!

    Ian

    Sample Process



  • 15.  Re: CAPA 4.3.02 Restful API

    Posted May 09, 2018 04:45 AM

    Thanks Ian, I'm going to do like that.