Creating workflow to review submitted data
- Applies to:
- Experience Manager 6.4
- Experience Manager 6.5
- Topics:
- Workflow
CREATED FOR:
- Beginner
- Developer
Workflows are typically used to route submitted data for review and approval. Workflows are created using the workflow editor in AEM. The Workflows can be triggered on Adaptive Form submission.
Prerequisite
Please make sure you have a working instance of AEM Forms. Please follow the installation guide to install and configure AEM Forms
The following video explains the creation of Review and Approval workflow using AEM Forms Components
Transcript
Hi, in this video, we will create an AEM workflow to handle this adaptive form submission. The workflow will be triggered when the user clicks the submit button. In the workflow we will also out this form to the appropriate person for review and approval, depending on the value of this grand total field.
By default, the submitted data from the adaptive form submission is stored in an XML format. It can also be stored in json format if the adaptive form is based on json schema, or it is based on a form data model. Since our adaptive form is not based on any XML schema, the submitted data will be stored in an XML format and the entire submitted data will be stored under the afUnboundData node. Under that is a node called data. And under that you will see the submitted data from the adaptive form. So these are the element county. And under that there’s a value Alameda, means that there’s a field called county in your adaptive form and the value is Alameda. So as a best practice, we recommend you to name your fields appropriately so that it’s easier to understand the element names and its values. So in our workflow, we will extract the value from the grand total element and route the form appropriately to the right person.
So to create an AEM workflow, I’ve logged into my AEM instance as an administrator, and I’m going to go into the tools menu, click on the workflow tab and click on the models. So here I’m going to create a new workflow or a workflow model by clicking on the create and create model. Give a meaningful title. So I’m going to call my workflow review submitted data and click on done. So this creates our workflow model. Let’s go and add some variables or some steps to this particular workflow model. So by default, when you create a workflow models, it has a step one. So as part of building your workflow, we’ll add some more steps to this workflow. And on the left hand side are the various workflow components that you can take advantage of when you’re building your workflow model. You can filter these workflow components by its category. So for example, if you filter by forms workflow, it will only list you the workflow components which are specific to AEM Forms.
And on the left hand side here allows you to create variables. So the variables are typically used in your workflow and these variables hold the submitted data or some values from the submitted data. So let’s go ahead and create our first variable to hold the submitted data. And we’re going to call it submitted data here.
So if you remember, our adaptive form was not based on any schema, hence the submitted data will be of type XML. So we’re going to select the type XML and leave the description in the schema part blank and create your variable. The next variable that will go into create is to hold the grand total.
Yeah, that’s the grand total and it is going to be of type long, right? So, so far we have created two variables, one for holding the submitted data from the adaptive form. And other one is to hold the grand total. So from the submitted data, we’ll extract the value of the element grand total and store that value in this variable. So to do that, the first thing we need to do is to insert a component called set variable, which allows us to initialize these variables. So, search for set variable component here and drag it to the, make it the first step in your workflow. So make it your first step. And you can delete this step one. We don’t need this for our workflow, right? So this is our set variable component, which allows us to initialize the variables. So let’s go ahead and initialize these two variables that we have. Go to the mapping step and click on mapping, map variables, and select the variable that you want to initialize. In this case, it’s submitted data and the mapping mode, the mapping mode is going to be related to payload. So what that means is when you submit the adaptive form, there will be a file called data.XML, which will be stored relative to the payload. And this data.XML file is the same name that we will use when configuring the adaptive form to trigger the AEM workflow. The next variable that we need to initialize is going to be the, grand total fields. So here we go to the grand total element and the mapping mode is going to be XPath because of our submitted data is of type XML.
And the variable here is going to be submitted data. And here we need to provide deep XPath for the grand total elements. So if you remember, the submitted data is going to look like this, and we need to XPath into this grand total element here and to XPath, we can write our XPath expression here. So this is my XPath expression. So if you see it drills down under afUnboundData, under the data element, there’s an element called grand total. That is what we are going to specify in our workflow model. So here we go and specify that and save your settings. So, so far we have created two variables and initialize those two variables.
The next thing we need to do is to assign the task to the appropriate user depending on the value of this grand total element.
Since we need to route the adaptive form based on the value of the grand total, we need to create what we call as an split condition in our workflow. So let’s go ahead and add the Or Split component here. So this allows us to create multiple branches in your workflow and depending on the condition, the various branches will be executed. So let’s go ahead and configure the Or Split component here. So let’s first give a meaningful name here.
“Route To The Correct User.” And by default, the Or Split component has two branches. And we can specify which branch to execute based on a condition. To specify a condition, there are these three options here. The easiest is to use the rule definition, which allows you to create a business rule using a graphical user interface. So click on this here. So what we want to do is to create a rule based on the grand total, based on the value of the grand total and the grand total is a workflow variable. And here we can say, if it is greater than, greater than 10,000 or we can add another condition here, is equal to 10,000. So all we are doing is creating a rule. If the grand total is greater than 10,000 or the grand total is equal to 10,000, then follow this part in my workflow. So let’s go ahead and rename this branch as well here.
So we rename this branch.
If grand total is equal to or greater than 10,000. And then for the second branch here, we’ll create another condition, here. Second branch. Again, we go to the rule definition, open up, and here we’ll say if the grand total is less than 10,000.
So if the grand total is less than 10,000, then follow this route here. So if we can rename this branch here.
It’s less than 10,000. If you wanted to add some more branches, you can do so by clicking on this add branch button here. So then save this. So, so far we have added a split condition in our workflow, and that split condition has two branches. If the grand total is greater than 10,000, it goes this route. If the grand total is less than 10,000, it goes this route. So in each of these branches, we can add as many workflow steps as you want. So the first thing we need to add here is to add and assign task component here. So let’s go ahead and add an assigned task.
So assigned task component allows someone to review the submitted data and we’ll add the same assigned task component here as well.
In this video, we’re going to configure our assigned tasks component that was added our workflow. So I’m going to open the assign task component and open up its configuration properties.
As you can see, the component has five tabs and each of these steps have various settings that you can use to customize or configure your assigned task component. So the first thing we need to do is to provide a meaningful title here, give a meaningful description. And here, if you want, you can specify the due date associated with this particular assigned tasks. So in our case we’re going to leave it as off. The next thing we are doing is to associate an adaptive form with the assigned task. So what that does is, it opens up the form that you have configured here when the user is interacting with the task. So in our case, we are going to say that use an adaptive form that was submitted to the workflow. And that particular adaptive form will be opened when the user is interacting with this assigned task. And then every form needs to have some data. And what we are saying here is, use the data in the variable called submitted data to pre-populate the adaptive form that is associated with this particular task. And in a similar manner, when the user has finished interacting with the task, store the form data in a variable called submitted data.
The next thing we’re going to do is to configure the assignee, meaning the user that is going to interact with that task. So that user can either be specified by to a specific user, meaning you hand quote the user or the user can be specified dynamically using custom code. In our case, we’re going to hand quote the user and you select the user by typing in the user’s name here and selecting the appropriate user.
Then there are some additional properties that you can specify by giving the user the option to share the inbox or to allow the assignee to share the inbox via inbox sharing. We are not going to use any of these options for now. And then, in the action step, this specifies what actions the user has when he’s interacting with this particular task. So by default, we provide you these three actions submit, save and reset. But in our case, we’re going to add two custom actions here. And those two custom actions are approve and reject. And each of these actions are associated with the Coral icon called check and the close. AEM provides a number of Coral UI icons. And those icons are listed here and you can use whichever icon you feel appropriate with that particular action.
The next thing I wanted to talk about was the route variable. So when the user has finished interacting with the task, he would have selected one of these two options to complete the task, either approve or reject. And you will typically store that action in a variable. And that variable is called UserActionTaken. And that’s a variable of type string which I had created here. So we will take a look at using this route variable or the UserActionTaken in the next video. And in the advanced tab we are not going to modify any of those default settings. We’re not going to check any of these options. We can leave them as blank. So once your assigned tasks type is called is configured. The next video, we will show you how to use the action taken, use the action taken variable and route the form accordingly.
In this video, we will add a routing condition based on the action taken by the user in the assigned task step here. So to do that, I’m going to add Or Split component. This is the same component that we added earlier in our workflow. And we’re going to configure this component here by giving a meaningful split name. And this component is going to have two branches, one branch for the approved action. If the user selects the approve action in the assigned task, it will go this particular route and that’s the name here, approve. And the second branch is going to be called reject. So if the user has selected the reject action in the assigned task, it will go this particular route, here, so. And then we need to specify a routing expression. And the easiest way to specify a routing expression is to use the rule definition builder here.
We’re going to use the UserActionTaken. Remember, this is the variable that will hold the action taken by the user while interacting with the assigned tasks steps. So we’re going to drag and drop that here. And we’re going to say if it is equal to, and select approve.
Sorry, select approve and save your action. In a similar manner, do the similar thing for your reject route.
Drag the user action.
Is equal to, reject. Save done and then save your settings here. So, so far based on the approve or reject action, we have created two branches. And in the next video, we’ll add some more components to these individual branches. So if the user clicks on the approve button, what do you want to do? And if the user clicks on the reject button, what do we want to do? So I have completed the workflow by adding generate document of record component under the approved branch and send email component under the reject branch. At a high level, gender document of record, creates a PDF from the data that was submitted from the adaptive form.
So this PDF is typically called a document of record. So in the generate document of record configuration properties, we are saying use the adaptive form submitted to the workflow and use the data that is stored in the variable called submitted data and generate a document of record or the PDF and store that PDF under the payload folder of the AEM workflow in the AEM repository and store that in a file called DoR.PDF.
I’m not going to go into the details of configuring send email component here. We have extensive documentation and also a video on configuring and using send email component. I encourage you to take a look at that. And also I’m not going to configure the other route where the grand total was less than $10,000. It’s up to you how you want to configure this. But as a practice exercise, I encourage you to configure this route based on what you have learned so far. So this concludes our video on creating review workflow on adaptive form submission. In the next video, we will see how to configure an adaptive form to trigger this particular workflow. And we’ll also see the end user experience in interacting with the adaptive form, through the inbox. -
If for some reason you are not able to build the workflow, you can download the completed workflow from here and import the same using package manager in to your AEM instance.
Experience Manager
- Overview
- Best practices to follow
- Setting up OKTA authentication with AEM Author
- Creating your first Adaptive Form
- 1 - Introduction and Setup
- 2 - Create Adaptive Form template
- 3 - Create form fragment
- 4 - Create Adaptive Form
- 5 - Configuring root panel and adding child panels
- 6 - Adding components to People panel
- 7 - Adding table to income panel
- 8 - Configuring assets panel
- 9 - Using custom functions and code editor
- Handling Form Submissions
- Useful Integrations
- Creating OSGi bundle
- Adaptive Forms
- Installing AEM Forms on Windows
- Installing 32 bit packages on Linux
- Prefill Service in Adaptive Forms
- Populate Adaptive Form using query parameters
- QR Code in AEM Forms
- Custom Submit in Adaptive Forms
- Captcha in Adaptive Forms
- Custom Functions in Rule Editor
- Embedding Adaptive Form in web page
- Creating array of strings
- Item Load Path in AEM Forms
- Using Set Value in XML in OSGI Workflow
- Using Set Value in JSON in OSGI Workflow
- Send Email Component in AEM Forms Workflow
- Generating DocumentOfRecord using API
- Displaying Inline Images
- Displaying DAM images inline
- Using GeoLocation API
- Using Transaction Reporting
- User Profile Data Integration in AEM Forms
- Microsoft Dynamics with AEM Forms
- Rule Editor Enhancements
- Restricting Access to Rule Editor
- Theme Editor Enhancements
- Form Editor Enhancements
- Automated Testing Of Adaptive Forms
- Automated Testing Of Adaptive Forms
- Integrating LDAP with AEM Forms
- Using Service User in AEM Forms
- Tagging and Storing DoR on Adaptive Form Submission
- Populating table with the results from Form Data Model Service Invocation
- Capturing workflow comments
- Storing Submitted Form Data in DB
- Inserting form attachment in DB
- Modify Data Source Configuration
- Override Form Data Model Properties
- Form Data Model Service in AEM 6.4 Workflow
- Handling Error Messages in Form Data Model Service Step
- Form Data Model Service in AEM 6.5.1 Workflow
- Form Data Model without Data Source
- Computed Form Data Model Element
- Setting up JDBC Data Source in AEM Forms
- JDBC Based Form Data Model
- Create Associations between 2 entities in Form Data Model
- Using Form Data Model’s invoke service in Rule Editor
- Post Binary Data to AEM DAM Using Form Data Model
- Creating Re-Usable Workflow Models
- Custom Process Step AEM Workflow
- Pre-Populating HTML5 Forms
- Form Data Model with Salesforce
- Adding Items Dynamically to Choice Component
- Fill a PDF form with ChatBot
- Core- Components based forms
- Select and assemble DAM folder content
- Prefilling adaptive form using form data model
- UI Tips and Tricks
- Customizing inbox
- Email form attachments
- Prefilling form with data and attachments
- Storing and Retrieving Adaptive Form
- Import data from pdf file
- Exporting Submitted Data in CSV Format
- HTML5 Forms
- AEM Forms and Acrobat Sign
- Introduction
- Set up SSL
- Create Acrobat Sign API Application
- Create Acrobat Sign Cloud Configuration
- Create Workflow to send document for signing
- Create and Configure Adaptive Form
- Configure Adaptive Form for single signer
- Configure Adaptive Form for two signers
- Configure Automated Forms Conversion Service
- Convert PDF Form into Adaptive Form
- Configure converted Adaptive Form
- Using XDP templates with Acrobat Sign
- Using Acrobat Sign helper methods
- Sign Multiple Forms
- Custom workflow steps
- Custom workflow component
- Variables in AEM Workflow
- Review form data
- Storing and Retrieving Form Data in MySQL DB
- Triggering AEM Workflow on PDF Form submission
- Trigger AEM workflow on Mobile Form Submission
- Querying Form Submissions
- Listing Custom Asset Types in Forms Portal
- AEM Forms With Marketo
- AEM Forms with Adobe Campaign Standard
- Welcome Kit
- Headless Forms API
- React App with Forms and Acrobat Sign
- Document Services
- Types of PDF forms
- Embed pdf in adaptive form
- PDF’s in carousel component
- Using Assembler Service in AEM Forms
- XDP Stitching with Assembler Service
- Using Watched Folder in AEM Forms
- Using Barcode Service in AEM Forms
- Using PDFG Service in AEM Forms
- Encrypt PDF with permissions password
- Using Output and Forms Service in AEM Forms
- Using xdp fragments in output service
- ECMA script to generate pdf with fragments
- Generating multiple pdf’s from one data file
- Generate PDF on Mobile Form Submission
- Generate PDF on Core Component based form submission
- Generate Interactive PDF from Mobile Form
- Generate Interactive DoR from Adaptive Form
- Configure Reader Extensions Credential
- Apply Usage Rights to PDF on XDP Rendition
- Apply Usage Rights to Uploaded PDF
- Certify Documents
- Assemble Form Attachments
- Useful Utility Services
- Forms Designer
- AEM Forms Workbench
- Interactive Communications for Print Channel
- 1 - Introduction
- 2 - Set up Tomcat
- 3 - Create Data Source
- 4 - Create Form Data Model
- 5 - Create XDP Layout using Forms Designer
- 6 - Create Document Fragment
- 7 - Create Print Channel Document
- 8 - Adding Content to Target Areas
- 9 - Configuring Line Chart
- 10 - Adding Table to Print Channel
- 11 - Using Watched Folder to Generate Documents
- 12 - Opening Agent UI on Form Submission
- Save and Retrieve Draft Letters
- Interactive Communications
- Using Batch API
- MultiSeries Charts
- Generate Print Channel Documents From Submitted Data
- Using Reducer Functions
- Two Column Layout in Print Channel Documents
- Using Table Component in AEM Forms Print Channel Document
- Generating Interactive Communications Document for Print Channel using Watch Folders
- Customize text editor
- Interactive Communications For Web Channel
- 1 - Introduction
- 2 - Set up Tomcat
- 3 - Create Data Source
- 4 - Create Form Data Model
- 5 - Creating Web Channel Document Template
- 6 - Creating Document Fragment
- 7 - Creating Interactive Communication Document
- 8 - Adding Text and Images
- 9 - Configuring Line chart
- 10 - Configuring Table
- 11 - Configuring Column Chart
- 12 - Configuring Pie Chart
- 13 - Delivery Of Web Channel Document
- Email Delivery of Web Channel Document
- Troubleshooting
- Document Services: Steps to troubleshoot DDX related issues
- Document Services: Steps to troubleshoot PDFA conversion issues
- Document Services: How to debug font related issue for Forms and Output Service
- Document Services: How to embed fonts for Forms and Output Service
- Document Services: How to enable performance logging to debug Forms and Output Service
- Document Services: How to increase aries transaction timeout for conversion of large files
- Document Services: How to run load tests using FormsIVS and OutputIVS
- Document Services: How to update custom XDPs and data files in FormsIVS and OutputIVS
- Document Services: Steps to enable verbose ORB trace
- Document Services: Steps to tweak bmc pool size for XMLFormService part1
- Document Services: Steps to tweak bmc pool size for XMLFormService part2
- Document Services: Steps to tweak parameters on JMX console
- Enable merging of large xml data files with template
- PDFG: How to change the transaction timeouts in PDFG
- PDFG: How to update CORBA timeout in PDFG
- PDFG: How to update the timeouts in PDFG
- PDFG: Steps to add PDFG user in windows server 2016
- PDFG: Steps to check and install 32 bit libraries and their dependencies
- PDFG: Steps to check folder permission on windows server 2016
- PDFG: Steps to enable strace on unix
- PDFG: Steps to install required 32bit Microsoft Visual C++ redistributables
- PDFG: Steps to run and interpret output of System Readiness Tool
- PDFG: Steps to troubleshoot acrobat specific issues
- PDFG: Steps to troubleshoot HtmltoPDF issues on windows
- PDFG: Steps to troubleshoot HtmltoPDF specific issues on unix(PhantomJS)
- PDFG: Steps to troubleshoot HtmltoPDF specific issues on unix(WebKit conversion)
- PDFG: Steps to troubleshoot multi user PDFG Conversion on unix
- PDFG: Steps to troubleshoot multi user PDFG Conversion on windows
- PDFG: Steps to troubleshoot OpenOffice specific issues on unix
- PDFG: Steps to troubleshoot OpenOffice specific issues on windows
- Document Security: How to apply policy created using document security module in Acrobat
- User Management: How to add users or groups in AEM Forms JEE
- User Management: How to increase UM Session timeout
- Workbench: Connecting workbench using https
- Workbench: Gathering Workbench logs from help menu
- Workbench: How to enable debug output for Workbench
- Workbench: How to tweak workbench memory parameters
- Workbench: How to tweak workbench performance parameters
- Designer: Dependency of Designer on C++ redistributable
- Designer: How to enable HTML Preview
- Designer: How to enable PDF Preview
- Designer: How to install Designer Patches
- JEE Foundation: How to change the value of entropy
- JEE Foundation: How to change transaction timeout of any service in AEM Forms JEE
- JEE Foundation: How to purge process records from the Job Manager table
- JEE Foundation: How to run process purge from command line
- JEE Foundation: Steps to bootstrap manually
- JEE Foundation: Steps to capture debug logs for mobile forms
- JEE Foundation: Steps to mitigate ForcedDisconnectException
- General: How to add management user for JBoss admin console
- General: How to capture HAR logs
- General: How to capture heap dumps of a JVM on a unix server
- General: How to capture heap dumps of a JVM on a windows server
- General: How to capture network logs
- General: How to capture Thread dumps of a JVM on a unix server
- General: How to capture Thread dumps of a JVM on a windows server
- General: How to generate a self signed certificate
- General: How to make web service call from HTML5 form
- General: Steps to enable debug logging for any classes in AEM Forms OSGI
- General: Steps to enable debug logging for any classes in JBOSS Application Server
- General: Steps to enable debug logging for any classes in Websphere Application Server
- General: Steps to enable SSL for AEM Forms OSGi
- General: Steps to encrypt keystore password to be used in lc_turnkey.xml
- General: Steps-to-reset-default-password-for-users-in-AEM-Forms-JEE
- General: Steps-to-reset-default-password-for-users-in-AEM-Forms-OSGI
- General: Steps to set up gemfire locators in a cluster and perform related configuration