[jboss-user] [JBoss jBPM] - Re: Bug in Mail.java
kukeltje
do-not-reply at jboss.com
Wed Dec 12 18:40:01 EST 2007
Not true (from what I see in the code)
evaluate(to) is implemented as:
| String evaluate(String expression) {
| if (expression==null) {
| return null;
| }
| VariableResolver variableResolver = JbpmExpressionEvaluator.getUsedVariableResolver();
| if (variableResolver!=null) {
| variableResolver = new MailVariableResolver(templateVariables, variableResolver);
| }
| return (String) JbpmExpressionEvaluator.evaluate(expression, executionContext, variableResolver, null);
| }
|
There are even a unittest
| public void testToVariableExpression() {
| ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
| "<process-definition>" +
| " <start-state>" +
| " <transition to='end'>" +
| " <mail name='send email' to='#{user.email}' subject='s' text='t' />" +
| " </transition>" +
| " </start-state>" +
| " <end-state name='end' />" +
| "</process-definition>"
| );
|
| User mrNobody = new User("hucklebuck at example.domain");
|
| ProcessInstance processInstance = new ProcessInstance(processDefinition);
| processInstance.getContextInstance().setVariable("user", mrNobody);
| processInstance.signal();
|
| assertEquals(1, server.getReceivedEmailSize());
| Iterator emailIter = server.getReceivedEmail();
| SmtpMessage email = (SmtpMessage) emailIter.next();
| assertEquals("hucklebuck at example.domain", email.getHeaderValue("To"));
| }
|
|
So I'm inclined to close http://jira.jboss.com/jira/browse/JBPM-1073 as 'worksforme'
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112407#4112407
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112407
More information about the jboss-user
mailing list