В одной из камундов bpmn у меня есть служебная задача, определенная так:
<bpmn:serviceTask id="ps2FreigebenEmail" name="E-Mail an Versicherer:" camunda:asyncBefore="true">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="to">${mailRecipient}</camunda:inputParameter>
<camunda:inputParameter name="html">
<camunda:script scriptFormat="freemarker" resource="${"classpath://email/statistik2_freigeben_email_".concat("de").concat(".ftl")}" />
</camunda:inputParameter>
<camunda:inputParameter name="subject">Statistik 2 prüfbereit</camunda:inputParameter>
</camunda:inputOutput>
<camunda:connectorId>mail-send</camunda:connectorId>
</camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="url">${urlResolver.getFrontendUrl()}</camunda:inputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>...</bpmn:incoming>
<bpmn:outgoing>...</bpmn:outgoing>
</bpmn:serviceTask>
Шаблон Freemarker выглядит следующим образом:
<html>
<body>
<p>Guten Tag</p>
<p>
Die Statistik 2 der Versicherungsgesellschaft ${gesellschaft.gesellschaftsnummer?c}
${gesellschaft.bezeichnung} wurde erstellt.
</p>
</body>
</html>
Переменная "gesellschaft" сериализуется следующим образом:
Gesellschaft gesellschaft = .. some POJO
ObjectValue gesellschaftValue =
Variables.objectValue(gesellschaft)
.serializationDataFormat("application/json").create();
delegateExecution.setVariable("gesellschaft", gesellschaftValue);"
Затем сериализованное значение сохраняется в таблице act_ge_bytearray и выглядит так:
{"gesellschaftsnummer":20060,"bezeichnung":"Zürich","dabTennantId": "41c6dbea-d160-48ae-9000-6d5db4b55d14"}
Когда электронное письмо отправлено, кодировка "bezeichnung" -Field теряется:
Guten Tag
Die Statistik 2 der Versicherungsgesellschaft 20060 Z�rich wurde erstellt.
- Я попытался установить:
- ftl для кодировки UTF-8
- для электронной почты в кодировке UTF-8
- VMкодирование в UTF-8