RESOLVED: Parent Process Instance/Definition IDs

Comments

6 comments

  • Avatar
    Loren Bratzler

    You should be able to access the Parent Process ID field from any activity.  Here is an example where I am getting the Parent Process ID in an Update Process Data activity that is part of a sub-process:

     

     

    0
    Comment actions Permalink
  • Avatar
    Danielr

    Thanks for the reply!

    Unfortunately, what I'm trying to access is the Parent Process Instance ID, not the Parent Process ID. Is there a way to access that outside of an eForm?

    0
    Comment actions Permalink
  • Avatar
    Loren Bratzler

    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:

    0
    Comment actions Permalink
  • Avatar
    Danielr

    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

    0
    Comment actions Permalink
  • Avatar
    Loren Bratzler

    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.

    0
    Comment actions Permalink
  • Avatar
    Danielr

    Another token, huh? Well, I think that answers everything. Thanks for the detailed responses, Loren!

    0
    Comment actions Permalink

Please sign in to leave a comment.