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.
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.
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 ?
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?
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
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 ?
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.
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:
So this process will abort the past process which is at waiting state. For this reason I need the waiting process's Process ID.
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:
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?
Thanks for your help,
I solved my problem as only querying PAM database.
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
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 :
As long as you are appending the request ID to the name of the instance runs this will work!