The summary page displays task-related information. This article describes how you can reuse task-related information in the summary page.
In this sample orchestration, an employee submits a leave application form. The application form then goes to the employee's manager for approval.
Create a sample HTML renderer (html.esp) for resourseType Employees/PtoApplication.
The renderer assumes the following properties to be set on the node:
Note: This renderer is the summary page template.
The following sample code for this renderer is contained in:
<html> <body> <table style="background-color: #647B7B;color: WHITE;text-align: left;width: 100%;font-size: 24px;line-height: 40px;"> <tbody> <tr> <td style="width:50%;"> <h3>Employee Name: <%= currentNode.ename %></h3> <h3>Employee ID: <%= currentNode.eid %></h3> <h3>Leave duration: <%= currentNode.duration %> days</h3> <h3>Reason: <%= currentNode.reason %></h3> </td> </tr> </tbody> </table> </body> </html>
Modify the orchestration to extract the four properties from the submitted form data. After this create a node in CRX of type Employees/PtoApplication, with the properties populated.
In the create PTO summary process, use the set value component to set the input details in a nodeProperty (nodeProps) map.
The keys in this map should be the same as the keys defined in your HTML renderer in the previous step.
Also, add a sling:resourceType key with value Employees/PtoApplication in the map.
Use the subprocess storeContent from the ContentRepositoryConnector service in the create PTO summary process. This subprocess creates a CRX node.
It takes three input variables:
- Folder Path: The path where the new CRX node is created. Set the path as /content.
- Node name: Assign the input variable nodeName to this field. This is a unique node name string.
- Node Type: Define the type as nt:unstructured. The output of this process is nodePath. The nodePath is the CRX path of the newly created node. The ndoePath would be the final output of the create PTO summary process.
In HTML Workspace, when you open a task, the summary Url accesses the CRX node, and the HTML renderer displays the summary.
The summary layout can be changed without modifying the process. The HTML renderer displays the summary appropriately.