[
https://jira.jboss.org/jira/browse/JBPM-2844?page=com.atlassian.jira.plug...
]
Alejandro Guizar updated JBPM-2844:
-----------------------------------
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
Description:
When using a custom email producer, the JpdlParser doesn't seem to set the
MailTemplate. The following snippet was taken from the projects SVN
(
http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/jpdl/src/main/jav...)
public MailProducer parseMailProducer(Element element, Parse parse, String
defaultTemplateName) {
// check whether the element is a generic object descriptor
if (ObjectBinding.isObjectDescriptor(element)) {
// TODO test custom mail producer
ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
return (MailProducer) WireContext.create(objectDescriptor);
}
// parse the default producer
MailProducerImpl mailProducer = new MailProducerImpl();
mailProducer.setTemplate(parseMailTemplate(element, parse, defaultTemplateName));
return mailProducer;
}
I believe that when the condition "ObjectBinding.isObjectDescriptor(element)" is
verified, the MailTemplate should be set before returning the MailProducer. This is
performed when the default email producer is chosen.
was:
When using a custom email producer, the JpdlParser doesn't seem to set the
MailTemplate. The following snippet was taken from the projects SVN
(
http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/jpdl/src/main/jav...)
---------------------------------------------------------------------------------------------------------------------------------------
public MailProducer parseMailProducer(Element element, Parse parse, String
defaultTemplateName) {
// check whether the element is a generic object descriptor
if (ObjectBinding.isObjectDescriptor(element)) {
// TODO test custom mail producer
ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
return (MailProducer) WireContext.create(objectDescriptor);
}
// parse the default producer
MailProducerImpl mailProducer = new MailProducerImpl();
mailProducer.setTemplate(parseMailTemplate(element, parse, defaultTemplateName));
return mailProducer;
}
---------------------------------------------------------------------------------------------------------------------------------------
I believe that when the condition "ObjectBinding.isObjectDescriptor(element)" is
verified, the MailTemplate should be set before returning the MailProducer. This is
performed when the default email producer is choosen.
As commented in the code snippet above, custom mail producers were envisioned but not
tested. I checked in a CustomMailProducerTest today. While the code (almost miraculously)
works, it is not that useful because the mail producer is wired at parse time instead of
execution time, when most objects are unavailable.
Rather than a MailProducer instance, parseMailProducer() should return a UserCodeReference
pointing to the object descriptor parsed from the given element. In case the element is
not an object descriptor, the UserCodeReference should point to a descriptor that
constructs a MailProducerImpl instead.
In simple words, full support for custom mail producers requires backwards-incompatible
changes to the existing mail classes. However, since all of them are outside the API, it
is possible to do it. Existing processes that use the default mail producer will not be
affected.
Custom Mail Producer does not set the MailTemplate
--------------------------------------------------
Key: JBPM-2844
URL:
https://jira.jboss.org/jira/browse/JBPM-2844
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Reporter: Telmo Simoes
Assignee: Alejandro Guizar
Priority: Minor
Fix For: jBPM 4.4
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
When using a custom email producer, the JpdlParser doesn't seem to set the
MailTemplate. The following snippet was taken from the projects SVN
(
http://anonsvn.jboss.org/repos/jbpm/jbpm4/trunk/modules/jpdl/src/main/jav...)
public MailProducer parseMailProducer(Element element, Parse parse, String
defaultTemplateName) {
// check whether the element is a generic object descriptor
if (ObjectBinding.isObjectDescriptor(element)) {
// TODO test custom mail producer
ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
return (MailProducer) WireContext.create(objectDescriptor);
}
// parse the default producer
MailProducerImpl mailProducer = new MailProducerImpl();
mailProducer.setTemplate(parseMailTemplate(element, parse, defaultTemplateName));
return mailProducer;
}
I believe that when the condition "ObjectBinding.isObjectDescriptor(element)"
is verified, the MailTemplate should be set before returning the MailProducer. This is
performed when the default email producer is chosen.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira