Starting with AEM Forms 6.4, we now have the ability to invoke Form Data Model Service as a step in AEM Workflow. This article will walk you through a sample use case for posting Document of Record using Form Data Model Service.

The use case is as follows:

  1.     A user fills and submits Adaptive Form.
  2.     The adaptive form is configured to generate Document Of Record.
  3.     On submission of this adaptive forms, AEM Workflow is triggered which will use the invoke Form Data Model Service to     POST the Document Of Record to AEM DAM.

 

posttodamshot1
Form Data Model Tab - Properties

In the Service Input tab we map the following

  • file(The Binary Object that needs to be stored) with DOR.pdf property relative to payload. What that means is when the Adatpive Form is submitted, the Document Of Record that is generated will be stored in a file called DOR.pdf relative to the workflow payload.Make sure this DOR.pdf is the same that you provide when configuring the Adaptive Form's submission property.
 
  • fileName - This is the name by which the binary object will be stored in DAM. So you want this property to be dynamically generated, so that each fileName would be unique per submission. For this purpose we have used the process step in the workflow to create metadata property called filename and set its value to combination of Member Name and Account Number of the person submitting the form. For example if the member name of the person is John Jacobs and his account number is 9846, the file name would be John Jacobs_9846.pdf

 

FDMInputService
Service Input

Note:

Trouble Shooting Tips - If for some reason the DOR.pdf is not created in DAM, reset the data source authentication settings by clicking here. These are the AEM authentication settings, which by default is admin/admin.

To test this capability on your server, please follow the steps mentioned below:

  1. Import the assets associated with this article into AEM using the package manager.You will get the following
    1.  Workflow Model
    2. Adaptive Form configured to submit to the AEM Workflow
    3. Data source configured to use PostToDam.JSON file
    4. Form Data Model which uses the Data Source
  2. Point your browser to open the Adaptive Form
  3. Fill the form and submit.
  4. Check the Assets application if the Document of Record is created and stored.

Download

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy