[Applies only to AEM Forms 6.4. In AEM Forms 6.5 please use the variables feature to achieve this use case]
A common request is for the ability to include the comments entered by the task reviewer in an email. In AEM Forms 6.4 there is no out of the box mechanism to capture the user entered comments and include these comments in email.
To meet this requirement, a sample OSGi bundle is provided that can be used to capture comments and store these comments as workflow metadata property.
The following screenshot shows you how to use process step in AEM Workflow to capture comments and store them as metadata property. The “Capture Workflow Comments” is the name of the java class that needs to be used in the process step. You need to pass the metadata property name that will hold the comments. In the screenshot below,managerComments is the metadata property that will store the comments.
To test this capability on your system, please follow the following steps:
Deploy the SetValue bundle. This bundle contains the sample code to capture the comments and store it as a metadata property
Download and unzip the assets related to this article on to your file system The assets contain workflow model and sample Adaptive Form.
Import the 2 zip files into AEM using package manager
Fill in the form fields and submit the form
Open the task from the inbox and submit the form. Please enter some comments when prompted.
The comments is stored in the metadata property called
managerComments in AEM’s repository. To check for the comments login to crx as admin. The workflow instances are stored in the following path:
Select the appropriate workflow instance and check for the property managerComments in the metadata node.