RESOLVED: Parent Process Instance/Definition IDs
Hi all.
Does anyone know how to have a Subprocess access the Parent Process Instance iID during execution without using an eForm or requiring any user input?
At my company, we're trying to just this. As far as I can tell form exploring AgilePoint and reading the docs, only eForms can access the Parent Process Instance ID from the System Data section on the side of the screen. The goal is for other AgilePoint developers to be able to simply include the Subprocess within their own process models and everything would just work with no additional effort.
As a work around, we're experimenting with including an unreachable eForm within the Subprocess containing the Parent Process Instance ID in its one field and having our reachable REST Activity use the form data, but this doesn't seem like how these activities were meant to be used at all.
Is there a better approach?
(in case this helps, the purpose of our Subprocess is to send a REST request to an external server. The Parent Process Instance ID will be included in the request payload.)
-
They are the same thing. The variable ${ParentProcessID} will contain the Process Instance ID of the parent process.
Here is a screen-shot from my parent process from the "General Info" tab showing its Process Instance ID:
And here is a screen-shot from the sub-process showing the process data field that was populated from the ${ParentProcessID} variable by the Update Process Data activity that I showed above:
-
Thanks for the clarification!
That solves that, but it also spawns a whole new issue for me. You see, for my REST API call, I need to pass in both the Parent Process Instance ID and the Parent Process Definition ID. I had thought to use the Parent Process ID field as the Parent Process Definition ID, but if it's really then Parent Process Instance ID, then where am I supposed to get the Parent Process Definition ID?
By the way, in case it helps someone with their research, I'm using this doc page as a reference for a process's System Data variables. It has separate entries for the Parent Process ID and Parent Process Instance ID, which are what I believe had confused me: https://documentation.agilepoint.com/00/appbuilder/cloudenvProcessVariablesSystemDataWin.html
-
Yeah, it looks like the documentation needs to be cleaned up. As far as I know, there is no System Data variable called "Parent Process Instance ID".
And I don't think there is a variable that has the Definition ID in it either. I think the only way you will be able to get the Definition ID is to do a query against the AgilePoint database. You would need to query the WF_PROC_INSTS table using the Parent Process ID. Here is a query and results from my example above:
You could do a database "Query Record" activity to get the Parent Definition ID into your sub-process. It would require creating an access token to the AgilePoint database. If you don't already have one, I would suggest creating a Global Access Token for your AgilePoint database so that you can access AgilePoint tables and data from any of your applications.
Please sign in to leave a comment.
Comments
6 comments