Mobile Form is a form after all, a way to capture user data at the end of the day. Once you got the data from users, you want to feed that data for further business processing. If you see my first post on mobile forms you would notice there is a API parameter submitUrl that can be of help here. You can configure your Mobile Form to post data in xml format to your service on submission of the forms. Since you can invoke any LiveCycle process or service RESTfully, you can technically trigger a process on form submission. In this post, I’ll describe how to trigger a process on form submission in detail. You can follow the same approach to POST the form data to any service.
All LiveCycle processes can be configured to be invoked over REST endpoint. You can create a process in your application and configure it for default start point. You can create a process to have input and output variable.
Mobile Form posts data to the specified submitUrl via data request parameter. If you don’t specify custom any “submitUrl”, the default submission servlet will show you the data in your browser. You can easily customize the default submission servlet and send data for further processing.
Now download the FormSubmission LiveCycle process and import it following the instructions. You can create your own process as well. The important part is to get the REST url of the process. The rest url of the process turns out to be http://localhost:8080/rest/services/<ApplicationName>/<ProcessName>:1.0 as shown in the screenshot of workbench.
If you hit the REST url in the browser, it will ask for credentials of a user that can run this service or process. You can also disable the authentication required for running this process, for details look for adobe help.
http://localhost:8080/lc/content/xfaforms/profiles/default.html with the following parameters:
- contentRoot repository:///Applications/FormSubmission/1.0
- submitUrl=Encode the URL and then pass(http://localhost:8080/lc/content/xfaforms/submission/default.lcprocess?postProcess=http://localhost:8080/rest/services/FormSubmission/archiveForm:1.0)
As you can see, the submitUrl is pointing to the custom servlet with a request parameter “postProcess” where custom servlet further posts data. The “postProcess” service could be any other servlet but in this case it is the REST url of the LiveCycle process.
The attached form in the Form Submission collateral has just two fields and the “archiveProcess” creates a flat pdf from the submitted data. You can test the form by rendering it and when you submit the form, it triggers the LiveCycle process and generate pdf out of it and serve it in the browser.