7 Replies Latest reply on Feb 26, 2013 9:22 AM by shyjues

    How to get process instance id

    developwf Level 1

      Hi,

      We are invoking a long lived process from a client using Java API (EJB end point).

      We are getting the JobId in return. Is there a way to get the process instance Id through API.

       

      Searched a lot in the documentation. Finally inclining to query the table directly

      TB_PROCESS_INSTANCE  on LONG_LIVED_INVOCATION_ID.

       

      Appreciate a lot if any expert point us to an API way of doing the same

        • 1. Re: How to get process instance id
          Steve L Walker Level 5

          See http://help.adobe.com/en_US/livecycle/9.0/programLC/javadoc/index.html

           

          com.adobe.idp.taskmanager.dsc.client.query

           

          interface ProcessInstanceRow

           

          getProcessInstanceId() retrieves a unique identifier for the process instance

           

          Steve

          • 2. Re: How to get process instance id
            developwf Level 1

            Thanks Steve.

            How do we get the ProcessInstanceRow from JobId / Invocation id.

             

            We are looking to obtain the process isntance right after invoking a processw.

            • 3. Re: How to get process instance id
              developwf Level 1

              We have tried to use the following approach to get process instance id right after invoking a process.

              - Define an OUT process variable to contain process id

              - A set value step right after invocation sets this out variable with process id variable value which is available by default

              - InvocationResponse.getOutputParameters() to read the output variable

               

              The problem is in the map returned by getOutputParameters() is not having our output variable , but just the JobId.

               

              Anyone tried this before? Are we missing sometiing?

               

              Any expert help is highly appreciated..

              • 4. Re: How to get process instance id
                Jasmin Charbonneau Level 4

                You get a job id because the process is long lived (asynchronous). So we return a job id because we don't know when it going to terminate (it could take days if you use a user service).

                 

                You can use the Job Manager to check the status of your job. See http://help.adobe.com/en_US/livecycle/9.0/programLC/javadoc/com/adobe/idp/jobmanager/servi ce/JobManager.html.

                 

                The function getStatus will tell you if it's completed. When it'completed, you can use getResponse to get the value of the process variables.

                 

                If you process is short lived, you'll get the result after you call since it's a synchronous call.

                 

                Jasmin

                1 person found this helpful
                • 5. Re: How to get process instance id
                  avi_nyc

                  Hi Jasmin,

                  Can you please answer my following questions for my understanding:

                  1. What is the difference between invocation id, job id and process id? What is the significance of each in a long lived process?

                  2. When should I use JobManager and TaskManager API?

                  3. If I just need a functionality where I keep track of the tasks assigned to different users in a process then what will be required..job id or process id?

                  4. Assume that I have a screen that shows me all the forms that are inputs to a process but are assigned to different users in the process which is long lived. So in other words, the screen will have two columns..column1: Form and column 2: Status

                  Column1 will show how many forms are currently floating in the process. And status will tell that whether the form is assigned to some user or is it done with the process. In this example which is called process instance or process id? And what is the job id in this scenario?

                   

                  Thanks!

                  • 6. Re: How to get process instance id
                    sams1884 Level 1

                    We have a requirement which reads that " As one of a group of people who are submitting comments on a form, I want to see comments made on the form by others before I submit my comments".

                     

                    I wonder if I can get TaskResultCollection info from the "Assign multiple Tasks" operation using xpath?

                     

                    If I do JAVA API?? Can anybody offer some pointers?

                     

                    Thanks a lot.

                    Sam

                    • 7. Re: How to get process instance id
                      shyjues

                      Hi All,

                       

                      Are you able to get retrieve the ProcessInstanceID from the processSearch(filter) method with the filter set to invocation id. I am doing something as below using the long lived invocation id

                       

                      processSearchFilter.addCondition(ProcessSearchingConstants.pINVOCATION_ID, Operator.EQUALS, "16876887a102aca157d201e76c760f17");

                       

                      I am not getting any results back, is this correct. any pointers please.

                       

                      Thanks

                      Shjyju