How to set up an Entity Template / Workflow Completion Certificate
This entry describes the steps to create a PDF document that displays data about an entity and how to send a link to that PDF via an email.
Overview
When someone completes a common Workflow, like an Examination or Course, we often want to produce an electronic artifact that displays the details of that activity in a pleasant and usable graphical form. We use the Workflow Completion feature for this purpose.
We also may want to produce a PDF document that supports a process such as an Invoice to pay by check or a downloadable summary of an employee evaluation or letter of reference.
Other examples of electronic artifacts are Certificates of Completion that a person uses to download and then share with an external source and Score Reports that provide a sophisticated interpretation of their exam results. We may also want to email a link to download the certification. Please see the PDF Templates entry for the various kinds of PDFs other than Entity Templates.
Step-by-Step Instructions
Follow these steps to create an Entity Templates:
Configure your Workflow to contain the attributes you want to show in the PDF;
Use an external HTML editor to create a visually pleasing document without the substitution variables;
We usually ask Sara to assist with this because she has the best access to HTML editors and graphics (not to mention talent);
Create the template object in the System Administration → App Config → PDF Templates area
Create the template on the same page in the PDF Template Section
On the step in the Workflow you wish to display the PDF, use the Action menu to create a PDF in the quick actions. Configure the permissions to make sure:
The person you wish to see the PDF meets the conditions you describe, such as access to the Workflow Step
Complete a Workflow Instance to the point you see the PDF. Confirm that the PDF displays as you want with static values.
Edit the PDF to introduce the substitution variables where you want them.
Proceed to enter all substitution variables;
Test with a variety of values, like:
No values
Long values
Values with the wrong data type
To then enable sending a link to the template in an email:
Add a row on the System Administration → App Config → PDF Templates page in the Entity Template Area as follows:
PDF Template ID - The ID of the template created above.
Entity ID - The Entity ID from the table on the page in the Entity Template Area that corresponds to the workflow on which you have configured the behavior.
Area - 8: Public; which allows access from an email without first logging in.
Make note of the Entity Template ID assigned to the new row.
Create a new email template (or add to an existing one) the following code where you want the link to appear:
${@model.UrlForPublicTemplate(Entity_Template_ID)} where Entity_Template_ID is the ID from the Entity_Template table (not the PDF_Template table).
Add a behavior in the workflow to send the email at the appropriate point in the process.
Examples
We have several examples that can serve as starting points, including:
Score Report:
ABOM Score Report
Baseline Score Report
Certificate of Completion:
LearningBuilder Academy Certificate
Baseline Activity Completion Certificate