Hi Kevin,
The codes I showed you comes from org.jbpm.jpdl.internal.xml.JpdlParser.java. The PVM will parse mail-template and register them to MailTemplateRegistry, so we could find MailTemplate by template name from MailTemplateRegistry. I cannot find a way to inject MailTemplate object only use the XML configuration. So I am afraid that we have to write these codes to get MailTemplate.