In this video we will take a look at the Time Off Request Form, and the business rules that were used to author this particular form. So this form is a fairly basic form that is used to request time off. This form has two panels, one is for the Submitter Details, that will capture the name and the department of the person requesting the time off, and the start date and end date. And then the second section is the Approved By section, where the approver of this request can approve or decline, and also add some comments related to that particular request. The two business rules are, the Approved By section needs to be hidden or shown, depending on the person viewing the form, and there need to be a mechanism by which the Submitter Details section needs to be disabled if this form is being viewed by an approver. So lets take a look at the first business requirement, where we need to hide or show the Approved By section. So to do that I have created an initial step, text field in my Submitter Details panel. Let’s take a look at this configuration. So this field will be hidden from both the submitter as well as the approver, and that is accomplished by clicking this checkbox, which allows us to hide the object. And the default value of this field is going to be Yes. Because when the first time a person is requesting a time off the value of this field will be Yes, and then depending on this particular value we will hide or show the Approved By section. And to do that, we have created a simple rule on the Approved By section here, so if you open up this rule on the Approved By section, which shows that we need to show this Approved By section when the initials steps value is equal to No, if not we need to hide that particular section. So when the form is rendered for the very first time the initial step value is Yes, and when the value is Yes, we hide the Approved By section. The next rule or the business rule that we need to take care of is to make the Submitter panel disabled so the person approving the request will not be in the position to change the values. So to do that we have another rule on the initial step here, so when the initial step value is equal to No, then we disable the Submitter Details panel. So whenever a person is reviewing this time off request, he will not be able to modify the data entered by the submitter in the Submitter Details. The next section that we need to take care of is the configuration or configuring a form to trigger an AEM blockflow. So to do that, I’ve opened up the form container, and go into the submission properties here. You select the Submit Appropriate submit action, in this case it’s going to be AEM blockflow. Select your workflow model and specify the data filepath. The data filepath is the name of the file that will hold this submitted data. The name of the file here is irrelevant, you can call it anything you want, data.XML, data.json or its totally up to you. The only thing that you need to remember is make sure you use the same file name in our workflow as you will see in the second video. We are not going to use the attachment part and the document of record part here. So now that our form is configured, we have authored the necessary business rules to hide and show the Approval section, let’s take a look at the form at run time. So I’m going to preview this form here.
So think of this as a person requesting a time off, because I’m requesting a time off I don’t need to see the Approved By section here, so here I’m going to, I can enter my details here.