9 Replies Latest reply on Aug 17, 2013 10:40 PM by Varun_Nohria

    How do I make a process/service asyncronous.

    JosephDoggie

      When I invoke a long-lived process from another process, I get the following run-time error:

       

      "The Long Lived Service x cannot be invoked synchronously."

       

      How can I change the process/service so that is invoked asynchronously?

       

      Thanks.

       

      {NOTE:  It'd be really nice to be able to copy-n-paste into these forum windows.}

        • 1. Re: How do I make a process/service asyncronous.
          WASIL Adobe Employee

          You should also change the calling process to be long-lived, with this you'll be able to invoke it asynchronously. In workbench, right click the process, select configure, click on Advanced tab and change the "Type" to "long-lived".

           

          Hope this helps.

           

          Thanks,

          Wasil

          1 person found this helpful
          • 2. Re: How do I make a process/service asyncronous.
            JosephDoggie Level 1

            Thanks for the answer.  It appears to be *part* of the solution.

             

            However, I am now getting a run-time error "Long lived operation and is not supported on transient branches".

             

            Unfortunately, it doesn't "point' to a specific process or sub-process that I need to change.

             

            Any ideas?

             

            I am not allowed to post my code or files, at least not w/o special permission; however, one long-term process is invoking another long-term process ....

            1 person found this helpful
            • 3. Re: How do I make a process/service asyncronous.
              WASIL Adobe Employee

              I am not sure what's the version of LiveCycle you are using  . In case, it is 7.x, please refer to this : http://ncifrederick.cancer.gov/about/readingroom/css/COTS/LiveCycle/Adobe-LiveCycle-Workfl ow.pdf

               

              If not, just try to find the branch which is transient/synchronous and change it to asynchronous(you can also refer to server log file to get some more info).

               

              Thanks,

              Wasil

              1 person found this helpful
              • 4. Re: How do I make a process/service asyncronous.
                JosephDoggie Level 1

                I am using Live Cycle Workbench ES3, version 10.0.2.x

                • 5. Re: How do I make a process/service asyncronous.
                  WASIL Adobe Employee

                  Can you please share your lca through Acrobat.com ?

                  • 6. Re: How do I make a process/service asyncronous.
                    Mark Lindberg Level 2

                    You can use a Script Object within your Short-Lived process to invoke a long-lived process, if that is the issue.

                     

                    import javax.servlet.ServletException;

                    import java.util.*;

                    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;

                    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;

                     

                    import com.adobe.idp.dsc.InvocationRequest;

                    import com.adobe.idp.dsc.InvocationResponse;

                    import com.adobe.idp.dsc.clientsdk.ServiceClient;

                    import com.adobe.idp.Document;

                     

                     

                    String strResultFlg = "FAIL";  //Assume failure status until completed successfully

                    Document inXML = patExecContext.getProcessDataDocumentValue("/process_data/formData");

                    System.out.println("formData =  " +  inXML);

                     

                          try

                          {

                                // Create the service client factory

                                ServiceClientFactory myFactory = ServiceClientFactory.createInstance();

                     

                                //Create a ServiceClient object

                                ServiceClient myServiceClient = myFactory.getServiceClient();

                               

                                //Create a Map object to store the XML input parameter value

                                Map params = new HashMap();

                                params.put("formData", inXML);

                               

                                //Create an InvocationRequest object

                                InvocationRequest lcRequest =  myFactory.createInvocationRequest(

                                    "<app_Name>/processes/<Process_Name>", //Specify the long-lived process name

                                        "invoke",           //Specify the operation name   

                                        params,               //Specify input values

                                       false);               //Create an asynchronous request

                               

                                //Send the invocation request to the long-lived process and

                                //get back an invocation response object

                                InvocationResponse lcResponse = myServiceClient.invoke(lcRequest);

                                String invocationId = lcResponse.getInvocationId();

                     

                             // Print the verification message

                              System.out.println(invocationId + " was successfully invoked." );

                                 strResultFlg = "DONE";

                     

                               

                            }catch (Exception e) {

                                System.out.println("Exception thrown while trying to invoke process " +      e.getMessage());

                          }

                     

                     

                    patExecContext.setProcessDataValue("/process_data/@strResultFlg", strResultFlg);

                     

                     

                    Hope this helps

                    Mark

                    • 7. Re: How do I make a process/service asyncronous.
                      Mrsunilg Level 1

                      @JosephDoggie

                       

                      Did you get the solution of your posted problem?

                       

                      Regards

                      Sunil

                      • 8. Re: How do I make a process/service asyncronous.
                        Bibhu Bikash Nayak Level 4

                        How about making a custom event of the short lived process of event Throw type and use the same event as an Event start point in the long lived process?

                         

                        Lets say you have 1 Short Lived process which will accept a document variable as an input and you have one Longlived process which will use that document variable for creating a Task in workspace.

                         

                        So what gonna you do is create a custom event in the short lived process and capture the document variable. Then in the long lived process use the same event as a Event start point use Xpath to map the event data value to a process variable.

                         

                        One more thing you can try i.e invoking the long lived process through a webservice.

                         

                        Does this help?

                         

                        Thanks,

                        Bibhu.

                        • 9. Re: How do I make a process/service asyncronous.
                          Varun_Nohria Level 1

                          I think it is a bug or a limitation in ES3.

                          I quickly tested this scenario (long-lived process calling another long-lived process) in ES2 SP2 and it is working.

                           

                          On ES3, its not working and "Long lived operation and is not supported on transient branches" exception is thrown in server logs.

                           

                          Request you to open a Support case for this issue by contacting Adobe LiveCycle Support and we can take it from there.

                           

                          Regards,

                          Varun Nohria