Expand my Community achievements bar.

SOLVED

Submit to Livecycle Endpoint from AEM

Avatar

Level 4

Hi Folks,

I have a livecycle process that expects a input xml as shown in the attached process diagram. I got to pass the xml value from my AEM Form to this Livecycle process on the click of a button (named downloadPDF). The process gets the XML, Merges the xml to the form design a return the reader extended PDF to AEM, where we are supposed to handle the returned PDF for download.

I am able to get the data as a xml with the guideBridge.js API as follows

 window.guideBridge.getDataXML({
                success: function(result){
                    alert(result.data);
                    $.ajax({
                        type    : 'POST',
                        url     : 'http://10.72.0.30:9083/rest/async_invoke/SomeProject/Process/databaseTest:1.0', 
                        data    : {
                            'dataXML' : result.data
                        },
                        success : function (pdfDoc) {
                            //TODO - code to handle the returned pdf form
                        },
                        error:  function (error) {
                            alert(error.responseText);
                        }
                    });
                },
                error: function(result){
                    alert("Get XML Failed to get the xml data");
                },
                guideState : null,
                boundData  : true
            });

 

But I am not able to hit my Livecycle endpoint from the above code. Please let me know if I am taking the right direction to atain my goal of sending XML to the Livecycle endpoint.

 

Regards -

Ashok Deivasigamani

1 Accepted Solution

Avatar

Correct answer by
Employee

If your LiveCycle server is on different host/port then might be be hitting cross-domain restriction of browser. In that case, you would to write a proxy jsp/servlet deployed in AEM which in turn calls LiveCycle post process. You can optionally use LiveCycle AEM connector(helpx.adobe.com/livecycle/help/aem/aem-livecycle-connector.html) to invoke LiveCycle from AEM.

View solution in original post

5 Replies

Avatar

Correct answer by
Employee

If your LiveCycle server is on different host/port then might be be hitting cross-domain restriction of browser. In that case, you would to write a proxy jsp/servlet deployed in AEM which in turn calls LiveCycle post process. You can optionally use LiveCycle AEM connector(helpx.adobe.com/livecycle/help/aem/aem-livecycle-connector.html) to invoke LiveCycle from AEM.

Avatar

Level 4

The AEM and Livecycle instance are right now running on the same instance. And I lately found out that the service invocation does happen and the payload is passed to the livecycle process. but the issue is, the call is always handled by the error function of my ajax callback. Also my livecycle process is a short lived process. The service returns a PDF and I got to handle it in my invocation to download the returned READER EXTENDED PDF to the users desktop. Is there any reason why my ajax call, though successfully after invocation is handled by the error function.

Please enlighten me on how I can use the AEM connector to get my invocation done and how to handle the result of the invocation.

 

Regards -

Ashok D

Avatar

Level 4

Deepak,

I found the following info while reading through the net, 

1) Ajax handles only text as response (which explains why my call to the livecycle process though invokes the service, gets to the error function as my returned data is a binary file)

2) Now that Ajax  call is out of the equation, I have to stick with the AEM Livecycle connector to get my job done.

Now that I know which direction to go, I have a few things to be understood before I take the leap.The call on submit action on AEM forms is directed to the submit call in the GuideBridge.js, having said that I wish to understand how the call is propagated from the submit function in GuideBridge.js to the Livecycle process invocation incase the author of the form has selected the submit action to be "Submit to Workflow".

 

Regards -

Ashok D

Avatar

Employee

Details about How Adaptive Form submission work and how you can customize it is available http://helpx.adobe.com/aem-forms/6/custom-submit-action-form.html . Connector invocation sample are available in link I sent you earlier. You can write your own custom submit action and invoke connector from there to get PDF, write that in temp storage. Then in Thank you page jsp, you can read that from temp storage and write in response.

B/w from the above use case, it does not look like you want to submit the form. Such cases are usually handled by writing the pdf in temp storage and then return the url of temp storage in process response in your ajax call. And then you can do window.open with returned url which would open the PDF in new window.

Avatar

Level 4

Thats right Deepak,

I do not want to submit the form, rather I want to generate a PDF form with user filled data from AEM Form, so that that author can fill it offline and submit it later on.

So I have to stay on the form, but just build a PDF in back end and prompt the user to download the file.