Core LIMS Training:
More Velocity Templates
Course Topics
» Custom Inventory Reports
» Custom E-mails
CONFIDENTIAL
Review
» Velocity Template Language (VTL) is a simplified
language that can be used to define customized
reports in PFS
» It is not the only method to make custom reports!
» Available Velocity Template Reports
» Instrument Files: Create formatted file outputs from an experiment
to be loaded into an instrument
» Experiment Reports: Write customized experiment reports to a
folder after experiment is published
» CoA Reports: Output a Certificate of Analysis report to a lot after an
experiment is published
» Inventory Reports: Create customized inventory reports to run from
Containers or Samples List Functions page
» E-mail Reports: Custom e-mail reports that are activated by a trigger
or set on a recurring alert
CONFIDENTIAL
Default Inventory Report
Reports are accessed from either
container, sample, or lot list functions
» Default is simple text export
with hard-coded columns
» You can create your own
format with velocity templates!
CONFIDENTIAL
Creating a Custom Inventory Report
» LIMS Setup By Admin:
» If missing, add the Inventory Velocity Report Super Type
and the Container Inventory Velocity Report/Sample
Inventory Velocity Report Entity Types
» Create a new container or sample inventory velocity
report record and fill in the ci_velocity_template attribute
with a report defined using VTL
» End User Process:
» Transfer or paste in a list of containers or samples into a
list functions page
» Select the report from the Inventory Report option and
Submit
CONFIDENTIAL
Admin SetupCheck Velocity Entity Types Exist
» You will need the Inventory
Velocity Report Super Type
with the 2 Entity Types below
» These require just the
ci_velocity_template attribute
CONFIDENTIAL
Admin SetupCreate Velocity Report Record
Report Name will appear in pull down
menu on List Functions page
Enter the velocity script that defines how the
inventory report is displayed
CONFIDENTIAL
End UserCall Report From List Functions Page
Select the custom report
with velocity script
CONFIDENTIAL
End UserReport Will Be an Exported File
»
»
This allows admins to expose other columns of
data not available in the default Inventory Report
Useful for creating reports with sample, lot, and
container info together
CONFIDENTIAL
Example Velocity Script for
Inventory Report
Container Type${tab}Container
Barcode${tab}Location${tab}Cell${tab}Well${tab}Amount${tab}Unit${tab}Sample${tab}Lot${tab}
#foreach( $container in $containerList)
#set( $containerFormat = ${container.getValue("Container Format")} )
#set( $cellMap = ${formatToCellMap.get($containerFormat)} )
#foreach( $cell in $container.getCellList())
#set( $cellNum = ${cell.getCell()} )
#foreach( $content in $cell.getContents())
${container.getEntityTypeName()}${tab}${container.getBarcode()}${tab}${container.getFullLocation()}
${tab}${cell.getCell()}${tab}${cellMap.get("$cellNum")}${tab}${cell.getAmount()}${tab}${cell.getUnit()}$
{tab}${content.getLot().getSample().getBarcode()}${tab}${content.getLot().getBarcode()}
#end
#end
#end
This velocity template creates the report shown
on the previous slide
CONFIDENTIAL
Available Global Variables for
Inventory Reports
» cellist (List of container cells/wells)
CONFIDENTIAL
Variables Available in cellList
Object
Object Type
Available Variables
Description
cellContent
Cell Contents
Objects
$cell.cellContent.concentration
Gets the concentration of a cell
cell.cell.cell
Gets the cell number
$cell.cell.amount
Gets the numerical amount (without units)
$cell.cell.unit
Gets the amount unit
cell
Cell Object
$cell.cell.getColumnMajor("Contain
er Format")
lot
container
Entity Object
Container Object
cellList is used to loop
through a list of container
cells
cell.lot.name
Gets the name of the lot in the container cell
$cell.lot.barcode
Gets the barcode of the lot in the container cell
$cell.lot.getValue("attribute name")
Gets the value of an attribute on the lot stored in the container
cell
$cell.lot.sample.
name
Gets the name of the sample in the container cell
$cell.lot.sample.barcode
Gets the barcode of the sample in the container cell
$cell.lot.sample.getValue("attribute
name")
Gets the value of an attribute on the sample stored in the
container cell
$cell.container.name
Gets the name of the container
$cell.container.barcode
Gets the barcode of the container
$cell.container.getValue("attribute
name")
Gets the value of an attribute of the container
CONFIDENTIAL
Sample Inventory Report Example
Container Type${tab}Container
Barcode${tab}Location${tab}Cell${tab}Amount${tab}Amount
Unit${tab}Sample${tab}Lot${tab}Concentration
#foreach( $infoMap in $cellList)
$infoMap.container.getEntityTypeName()${tab}${infoMap.container.getBarcode()}
${tab}${infoMap.container.getFullLocation()}${tab}${infoMap.cell.getCell()}${tab}${
infoMap.cell.getAmount()}${tab}${infoMap.cell.getUnit()}${tab}${infoMap.lot.getSa
mple().getBarcode()}${tab}${infoMap.lot.getBarcode()}${tab}${infoMap.cellConten
t.getConcentration($tenant)}
#end
CONFIDENTIAL
Default E-mail
» Default e-mail gives basic info on what record is created
with hyperlink to record
» You can create your own format with velocity templates!
CONFIDENTIAL
Creating Customized E-mails
Multiple ways that formatted e-mails can be sent
» Option 1
» Velocity Template with message content on a trigger
» Recipients on object
» Option 2 (see documentation)
» Velocity Template with message content on a trigger
» Recipients defined in associated message
CONFIDENTIAL
Workflow for Option 1
» LIMS Setup By Admin:
» Configure the object that the trigger will be put on (like a
request) with an attribute to hold e-mails OR associate to
employee records that have e-mails populated
» Create e-mail trigger type if missing
» Create trigger record with velocity template
» Define trigger on the entity that will invoke the trigger
» End User Process:
» User performs action defined by trigger (creates request)
» Users on specified in the e-mail attribute OR associated
employee records receive e-mail report
CONFIDENTIAL
Configure the Request
Email Group
attribute can store
e-mail addresses
of recipients
(attribute spelling
must match value
in email trigger)
OR associate
Employee records
that have e-mail
addresses stored
CONFIDENTIAL
Configure Trigger Impl Type
If you don’t already
have this Trigger
Impl Type, you can
add it manually and
configure it with
these attributes
CONFIDENTIAL
Trigger Attributes
» Implementation Class: stores the code that defines what trigger
will do. Set default to
com.coreinformatics.core.trigger.impl.sendEMessageTriggerImpl
» Trigger Type: another class attribute. Set default to
com.coreinformatics.core.message.Efax
» Action Type: defines when the trigger will be fired
» Email Address Attribute Name: specify the name of the attribute
on the request that holds the email addresses (if not using
associated employee records)
» Traversal: uses CoreScripts to fetch data to use in e-mail
» Email Subject: text to be displayed in subject of e-mail
» Email Body: e-mail content defined with a velocity template
CONFIDENTIAL
Create a Trigger Impl Record
Create a new
trigger record
that holds the
velocity template
CONFIDENTIAL
Traversal Attribute
» Traversal allows you to pull information from the request and any associated entity
types into the e-mail
» E-mail recipients can get information they need without logging in
» Uses standard CoreScripts syntax
» Must include a RECIPIENTS variable to define which method you are using to
choose recipients
» [ ${this}, ${RECIPIENTS} ] tells LIMS to send to e-mails in e-mail attribute on the
request (allows you to use external e-mails)
» OR [ ${this}.$ASC{REQUESTOR}, {RECIPIENTS}] would tell LIMS to look up e-mail
addresses on any employees that are associated to the request and send to those
addresses
» Additional traversals can fetch data through other associations
CONFIDENTIAL
Velocity Template
A new request has been created, the information is below. Please review and go
into the system to approve
» Can use standard HTML
» The getValue and name
<br><br>
commands can pull in
attributes and associations
that were fetched in the
<b>REQUEST INFORMATION </b> <br><br>
Traversal
<b>Submitter:</b> $REQUESTOR[0].name<br>
<b>Date of Request:</b> $this[0].getValue("Date of Request")<br>
<b>Due Date of Request:</b> $this[0].getValue("Date Of Delivery") <br>
<b>Priority:</b> $this[0].getValue("Priority")<br>
<b>Protein Requested:</b>
$PROTEINLOT_PROTEINREQUEST[0].name<br><br><br>
Please approve this request by following <a
href="https://na1training.platformforscience.com/corelims?cmd=get&entityType=
$this[0].entityType&entityId=$this[0].getId()">link here</a>
CONFIDENTIAL
Common Variables
Object
Available Variables
$this[0].name
$this[0].barcode
$this[0].getCreationDate()
This Entity $this[0].getPublishDate()
$this[0].getValue("attribute
name")
$this[0].name
$this[0].barcode
Description
Get name of Entity type that trigger is on
Get barcode of Entity type that trigger is on
Get date created of Entity type that trigger is on
Get date published of Entity type that trigger is on
Get attribute on Entity type that trigger is on
Get name of Entity type that trigger is on
Get barcode of Entity type that trigger is on
CONFIDENTIAL
Hyperlinking to PFS Record
Update the URL
Please approve this request by following
path to your system
<a
href="https://na1training.platformforscience.com/corelims?cmd=get
&entityType=$this[0].entityType&entityId=$this[0].getId()">
link here</a>
You can edit the text that
will display the link here
CONFIDENTIAL
Add Trigger to Request
Select trigger record you
created in Event Only section
CONFIDENTIAL
End User Creates Request
Depending on
what admin
setup, user
should either fill
out E-mail
attribute or
select records
for Requestor
(Employee
records should
have e-mail
addresses
stored)
CONFIDENTIAL
End User Gets E-mail
CONFIDENTIAL
Review
» Custom Inventory Reports
» Custom E-mails
CONFIDENTIAL
© Copyright 2026 Paperzz