Configuring Adaptive Form to trigger AEM Workflow
Last update: March 25, 2025
- Applies to:
- Experience Manager 6.4
- Experience Manager 6.5
- Topics:
- Workflow
CREATED FOR:
- Beginner
- Developer
Prerequisites
The sample form used in this workflow is based on a custom adaptive form template which needs to be imported into your AEM server. The sample form that is provided needs to be imported after importing the template.
Get the Adaptive Form Templates
- Download Adaptive Form Template
- Import the template using package manager
- Upload and install the Adaptive Form template
Get the sample Adaptive Form
- Download Adaptive Form
- Browse to Form And Documents
- Click Create -> File Upload
- The sample adaptive form is placed in a folder called Application Forms
The following video explains how to configure an Adaptive Form to trigger an AEM Workflow
The following video shows you the workflow payload and other details in the crx repository
Transcript
So now that we have triggered our workflow from the Adaptive Form Submission, let’s take a look at what happens when a workflow is completed. So for that, I’ve logged into my AEM Forms instance, I’ll go into the tools menu from there, go into my CRXDE Lite by clicking on this here. So this is my CRXDE repository. So from there, I’m going to go into the var folder, and in the var folder, there’s a folder called workflow. And in that workflow folder, expand instances, which lists the instances of the workflows. Under that there’s serve0, and under serve0, you’ll find a number of folders and each folder representing a date. So whenever you restart your server, it will create a folder for that particular day, and if you have restarted a server multiple times on a particular day, it will append the number. Therefore example here, 17_1, that means I started the server two times on that particular day. So go to the latest folder in that hierarchy, in my case, it’s 9-10. And under that, you will see the various workflow instances. So in my case, review submitted data is a workflow instance. Expand that folder. And under the data folder, you will see two notes called metadata and payload. So click on the metadata folder and look at its properties. So you’ll see a number of properties here, and some of these properties represent the variables and their values from the workflow. For example, grand total is a property that represents a variable from our workflow, and it has a value of 12,000. Similarly, submitted data is available with its value here. The value is the submitted data in an XML format, and then there’s a user action taken variable with the value approve. The next thing of interest is the payload folder. And in that folder, there’s a property called path and there’s a value here. So set copy that value and go to that value specified by the path here, copy and paste it here and here. So under here, this is the payload folder, under here, you will see two files. One is the data.xml that holds the submitted data. Because remember, when we configured our adaptive form to trigger the workflow, we asked the workflow engine to create a file called data.xml and store that file under the payload folder of our workflow instance. So that’s why you’re seeing a file called data.xml. And it contains the data that was submitted from the adaptive form. And here is there a DoR.pdf. So in our workflow, we had a step called generate document of record. And in that step, we specified to name or create a file called DoR.pdf, which will be the document of record and to place that file relative to the payload. So that’s our payload folder and under that you’ll see DoR.pdf. So this is the actual document of record that was created by the AEM Forms workflow engine and stored here. So if you want to see this file, you can copy this part here, copy this part and go open up another tab here and paste it here, the part. So then it should download the PDF, which is the document of record. So this is the document of record that was generated here, right? So we did not customize this as a default document of record, but definitely you can customize this document of record. That will be part of another video or another article, but for now it’s suffice to say that we have been successful in creating a document of record from the data that was submitted using the workflow. So this concludes our course on creating a review and submit workflow and triggering that workflow from an adaptive form submission. -
recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e