4 Replies Latest reply: Mar 12, 2012 6:34 AM by Han Dao RSS

    Process ID get lost or returns -1 in workbench ES

    Han Dao Community Member

      Hello,

       

      I am currently working on a process to write a PDF file name to a specific folder and name its filename as its process ID. For some reasons the process ID is gestting lost at the end of the process so when it created pdf file, its name comes with a "-1" instead of the process ID.

       

      I tried to record the process and see that every thing is workfing fine but as soon as after it flatten the pdf and write it to a folder, its name got changed to "-1". Since it does not show any errors in the log file so I am not sure what is wrong with it.

       

      Can any one please advise on how to fix this issue.

       

      Thank you in advance,

      Han

        • 1. Re: Process ID get lost or returns -1 in workbench ES
          $Nith$ Community Member

          Please answer the following questions to narrow down the problem statement..

           

          1. Is your process is short-lived?

              If yes, there won't be any process Id created. You will always get -1 as process Id

           

          2. While playback of process recording, do you see a ProcessId created and lost when the PDF is flattened?

             To check that, create a process variable of type long and assign /process_data/@id value to it. Then see the recording what value is saved in your variable.

           

          If you cascade the process, I mean if you call a sub process (short-lived) from a main process (which is long-lived), you can pass the parent process's ProcessId so that you will get a real number that can be used as filename.

           

          Non confidential process/forms can be shared with nith.igate@gmail.com for further troubleshooting.

           

          Nith

          • 2. Re: Process ID get lost or returns -1 in workbench ES
            Han Dao Community Member

            Hello Nith,

             

            Here are my answers:

             

            1. The process is a long-lived one.

             

            2. While playback of process recording, I do see the processID (PID) when I assisged it to the process variable. It just got lost after when it writes the flatten pdf file to the folder. Note that the folder is located on the LC server.

             

            3. That's what I have been trying to do by calling a short-lived (sub-process) from a main long-lived one to pass the PID but for some unknow reason, I keep having the above issue.

             

            The strange thing is if I copy the whole sub-process into the main process instead of drag it into the main process as a service then it works just fine which is recommended to do.

             

            Thanks,

            Han

            • 3. Re: Process ID get lost or returns -1 in workbench ES
              $Nith$ Community Member

              Is your short-lived process receives the PID that you supply from the main process?

               

              Record the short-lived process and check if it receives the value or not.

              • 4. Re: Process ID get lost or returns -1 in workbench ES
                Han Dao Community Member

                The short-lived process did receive the PID from the main process, it just lost after it flatten the PDF and write to a specific folder.

                 

                Thanks,

                Han