[
http://jira.jboss.com/jira/browse/JBPM-1172?page=comments#action_12412263 ]
Ronald van Kuijk commented on JBPM-1172:
----------------------------------------
cool, there is NO test for createMailDelegation in JpdlXmlReader... lucky me...
I added this
if (!Mail.templateExists(template)) {
if (template.startsWith(Event.EVENTTYPE_TASK_ASSIGN)) {
template = Event.EVENTTYPE_TASK_ASSIGN;
} else if (template.startsWith("task-reminder")) {
template = "task-reminder";
} else {
log.warn("Mail template \"" + template + "\" not found.
Will cause run-time problems");
}
}
to this method so not much can go wrong
and I added
public static boolean templateExists(String templateName) {
if (templateName != null) {
templates = new HashMap();
String mailTemplatesResource =
JbpmConfiguration.Configs.getString("resource.mail.templates");
org.w3c.dom.Element mailTemplatesElement =
XmlUtil.parseXmlResource(mailTemplatesResource).getDocumentElement();
List mailTemplateElements = XmlUtil.elements(mailTemplatesElement,
"mail-template");
Iterator iter = mailTemplateElements.iterator();
while (iter.hasNext()) {
org.w3c.dom.Element mailTemplateElement = (org.w3c.dom.Element) iter.next();
if (templateName.equals(mailTemplateElement.getAttribute("name"))) {
return true;
}
}
}
return false;
}
to the base Mail class. This method in this class will also be used if the mail class is
overridden by the property jbpm.mail.class.name or mail.class.name
I would want to implement a test for this, but there is NO template test at all (at least
not that I can find). I'll see what I can come up with... will not be extensive
though...
support templates for assignment and reminder mail
--------------------------------------------------
Key: JBPM-1172
URL:
http://jira.jboss.com/jira/browse/JBPM-1172
Project: JBoss jBPM
Issue Type: Feature Request
Components: Core Engine
Affects Versions: jBPM jPDL 3.2.2
Reporter: Ronald van Kuijk
Assigned To: Ronald van Kuijk
Fix For: jBPM 3.3
Time Spent: 1 hour
Remaining Estimate: 2 hours
jBPM supports templates for mail nodes and mail actions, but not for task assignment and
reminder mail. In our company we've run into this and (ab)use mail nodes now to send a
kind of assignment mail. Would be nice if templates are supported as well for reminders
and assignment mail
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira