Localization of user task texts

Hi,
I´m wondering about the support for localized texts on user tasks. The requirement would be that a user sees the task subject (in his inbox) in his local language. To my understanding this is not commonly supported in activiti (e.g. the persistence only supports one text for a task instance, but not multiple texts in different languages). However, the java API provides methods like getLocalizedXYZ(). Is there an easy way that activiti supports this?
Best regards,
Stefan

Hi Stefan,

This is already supported. Have a look at TaskQueryTest testLocalizeTasks:

You can use the DynamicBpmnService API to set the values programmatically, but you can also define it as part of the BPMN XML like done for example in:

Best regards,

Tijs

Hi Tijs,
cool feature I was trying this and got it working, but only with one additional locale :frowning:
I was basically extending the bpmn model by adding a second localization tag (see below). The behavior is that only the first locale is accepted, but the second is not being recognized by the deployment.
Looking at the class “BpmnDeployer”, it seems that after the first occurrence, additional locales are skipped.
Could you confirm?
Best regards,
Stefan

<userTask id="usertask1" name="Original Hello World">
  <documentation>This is the Original Hello World user task for ${name}</documentation>
	<extensionElements>
		<activiti:localization locale="de" name="Hallo Welt">
			<activiti:documentation>Das ist die Hallo Welt Aufgabe für ${name}</activiti:documentation>
	  	</activiti:localization>

	  	<activiti:localization locale="en" name="Hello World">
			<activiti:documentation>This is the Hello World user task for ${name}</activiti:documentation>
	  	</activiti:localization>
	</extensionElements>
</userTask>

Hi Stefan,

I’ve confirmed the issue you describe in the BpmnDeployer class and will submit a pull request to resolve the issue shortly.

thanks,
Rob

The following pull request has been created to resolve this issue.

https://github.com/flowable/flowable-engine/pull/251

Hi Robert,
many thanks for fixing this issue so fast. Meanwhile I used the DynamicBpmnService to add the respective texts. I now figured out that expressions are not evaluated for multi language texts. This does only happen for the original name and documentation. From how I understand the DynamicBpmnService all multi language texts are solely stored on level of the process definition, but not the process instance. Is this right?
Best regards,
Stefan

Hi Stefan,

Yes, it’s stored on a process definition level. The idea is that allows you to override or to enhance parts of a deployed process definition.

Best regards,

Tijs