我创建了邮件任务配置
<serviceTask id="mailtask_name" name="Name" flowable:delegateExpression="${STCustomMail}" flowable:type="mail" >
<extensionElements>
<flowable:field name="to">
<flowable:string><![CDATA[mail@mail.com]]></flowable:string>
</flowable:field>
<flowable:field name="subject">
<flowable:string><![CDATA[Subject]]></flowable:string>
</flowable:field>
<flowable:field name="text">
<flowable:string><![CDATA[Text]]></flowable:string>
</flowable:field>
</extensionElements>
</serviceTask>
和类:
@Log
@Service
public class STCustomMail implements JavaDelegate {
private Expression subject;
private Expression to;
private Expression text;
public void execute(DelegateExecution execution) {
log.info("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
String subjectText = "New subject";
execution.setVariable(subject.getValue(execution).toString(), subjectText);
execution.setVariable(to.getValue(execution).toString(), "newmail@newmail.com");
execution.setVariable(text.getValue(execution).toString(), "newtext");
}
}
不幸的是,我的 STCustomMail 类不起作用。我无法修改任何邮件数据。
怎么了?
也许还有另一种解决方案如何动态配置/创建(?)邮件数据位置?