IT Process Automation

Expand all | Collapse all

How can I get ROWID of an instance by instance name ?

Jump to Best Answer
  • 1.  How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 05:22 AM

    Hi Community,

    I am trying to find ROID of a process Instance by instance name. For example:

    my running process' instance name is Pending_Task_12062016

    I want abort this process instance with "controlProcess" web service method. this method takes "processID" as parameter.

    So first of all I must find ROWID of "Pending_Task_12062016" process instance. 

    For this operation, Is there any web service method or any database query which I can use.

    Thanks for your help.



  • 2.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 08:50 AM

    That soap call is actually looking for the Process ID.  And that Process ID is part of the process instance name.  So your call would look like this:

     

    <tns:controlProcess xmlns:tns="http://www.ca.com/itpam">
    <tns:ProcessID>12062016</tns:ProcessID>
    <tns:action>abort</tns:action>
    <tns:auth>
    <!--xsd:Choice Type-->
    <tns:token>token__</tns:token>
    <tns:user>user__</tns:user>
    <tns:password>password__</tns:password>
    </tns:auth>
    </tns:controlProcess>

     

    Where 12062016 is the Process ID at the end of your Process Instance name.  

     

     



  • 3.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 09:09 AM

    Hi Andrew,

    I think I couldn't define my problem exactly.

    We customize our process instance names like that:

    Process.UserInstName = "Pending_Task_" + Process.RequestID;

     

    Here Process.RequestID is a parameter; Especially   we use service catalog request number. So at my example "12062016" doesn't define Process ID. It defines our request number. 

    So I should query my Process ID by using process instance name  to trigger our "controlProcess"  process behind the service catalog events using Service Catalog request number.

    Could you advice something for this scenario ?

    Thanks



  • 4.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 09:17 AM

    Regardless of how you customize the Process Instance name I believe Process Automation will still tag the Process ID to the end of the process instance name.  If you login to Process Automation and go to the Operations tab, take a look at your process instance names here.  Do they not have an additional number appended to the end of the instance names?



  • 5.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 09:49 AM

    No,

    they dont have an additional number,however they have I wont get the Process ID by that, will I ?

    for example my instance name is : Pending_Task_54321_10987

    here, 

    54321 is my request number, 10987 is process ID and I know only request ID information and want to abort the process instance which contains  "Pending_Task_54321". First of all I should learn the "10987" information. Is there any webservice method or database table which I can achieve this ?



  • 6.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 10:20 AM

    In a process instance there is a variable in the dataset called Process.InstanceName that will contain the process instance name.  So the number after the last underscore will be the Process ID.  You can perform a substring command on that variable to pull the Process ID and then pass this to the web service call.



  • 7.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 02:30 PM

    Ok I know the dataset and Process.InstanceName variable. But The main problem is I dont know which process instance I Should look for.

    The whole scenario is like that step by step:

    • User fulfills a service catalog request form (for example Request ID : 54321) and rejects it.
    • When the form was rejected, an service catalog event triggers a Start Request Form (SRF) and Request ID is sent to this SRF.
    • SRF calls a new process (named as Abort_Waiting_Process_54321)  process which I am trying to create that aborts the process which is at waiting state named as Pending_Task_54321

    So this process will abort the past process which is at waiting state. For this reason I need the waiting process's Process ID.



  • 8.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-16-2016 03:25 PM

    To address this question first and foremost, which I think will clear most of the confusion in this thread up:

    "I am trying to find ROID of a process Instance by instance name. For example:

    my running process' instance name is Pending_Task_12062016"

     

    The Process Automation soap API is documented here:

    https://docops.ca.com/ca-process-automation/4-3/en/reference/web-services/soap-api-reference/soap-web-services-methods

    The soap calls all require a specific instance identifier.   There is no way to query the Process Automation API to find instance named 'instance for request 54321'

     

    So to get the ROID of the Process Automation Process originally launched for 12062016 you would either have to query the Catalog API, or more likely query the MDB directly for the ROID value associated with Request 12062016.

     

     

     

    This seems like an over complication, instead of trying to build this 2nd process that gets launched and has to query the MDB for the ROID value of the process instance that a Catalog request is associated with, why not just build in an occasional check into the original process that checks if the Catalog Form has been rejected and if it has been cleans itself up?



  • 9.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-19-2016 09:13 AM

    Hi Michael,

    Thanks for your help,

    I solved my problem as only querying PAM database.

    Regards



  • 10.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-18-2016 11:36 PM

    Hi Nuran,

     

    You can try to retrieve the ROID associated to the request in two steps as follows:

     

    1 - Query the Service Catalog Database (MDB) to find the object_info associated to your request_id, in the usm_object_wf_instance_ref table: 

     

    select object_info from usm_object_wf_instance_ref where object_id1 = <CatalogRequestID>

     

    The first result is actually the PAM's ParentProcessROID, that is, the process that initiated the actual PAM process instance. In this case, it's the Start Request Form(SRF).

     

    2 - Query the PAM Runtime database to find the ROID using the Parent Process ID found in step 1: 

     

    SELECT ROID
    FROM [dbo].[C2ORuntimeObjects]
    where ParentID = <ParentProcessROID>
    and DocumentType = 'FlowChart' -- Object of type "Process"

     

    Please, Let us know the results

    Best Regards



  • 11.  Re: How can I get ROWID of an instance by instance name ?
    Best Answer

    Posted 09-19-2016 09:13 AM

    Hi Eric, thank to all of you.

    I had tried your solution. One of the our use cases didn't run in with it. we use also "Start Process" operators in our workflows.

    So I solved it only querying our PAM database.

    Our Instance names like Instance Name_RequestID , so

    I used this query :

    select ROID from dbo.C2ORuntimeObjects where Instance like '%RequestID%'

    After getting ROID from this query I am using it with controlProcess method :

     

    <tns:ProcessID>ROID <tns:ProcessID>

    .

    .

    .

    Thanks,

    Regards



  • 12.  Re: How can I get ROWID of an instance by instance name ?

    Posted 09-19-2016 02:41 PM

    Excellent Nuran!

    As long as you are appending the request ID to the name of the instance runs this will work!