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. So you can specify an input variable named “data” in your LiveCycle process and it will be mapped to the request parameter automatically.
The rest url would turnout to be http://localhost:8080/rest/services/<ApplicationName>/<ProcessName>:1.0 as shown in the screenshot of workbench.
Image may be NSFW.
Clik here to view.
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.
If you configure your submitUrl to be REST url of the process, Mobile Form posts the data in xml format as a request parameter “data”. As you can see from the above screenshot, I have configured the “data” input variable as a “Document” type for the process. That is it. As soon as you submit the form, it will trigger the process.
You can download the FormSubmission process and give it a try yourself. Here is the URL that is to be used while rendering the form:
http://localhost:8080/lc/content/xfaforms/profiles/default.html with the following parameters:
- contentRoot repository:///Applications/FormSubmission/1.0
- template=SimpleForm.xdp
- submitUrl=http://localhost:8080/rest/services/FormSubmission/archiveForm:1.0
As you can see, the submitUrl is pointing to the FormSubmission LiveCycle process.
You can use the same strategy as above in your custom servlet to extract data out of the form. You can receive the data and process it further in the custom servlet.