简体   繁体   中英

Localize workflow task title in alfresco activiti

I followed this tutorial to create a custom alfresco activiti workflow: http://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html

I tried to externalize the contained strings by creating .properties files and made them known in the xyz-context.xml . While this is working I face a problem with changing the title of a worfklow task.

I use the following sampleWorkflow.properties file:

 sampleWf.task.confirmTask.title=Confirm this, with a title which is different than the task name
 sampleWf.task.confirmTask.description=Confirm please

The bpmn-snippet for this tasks, is configured like this:

<userTask id="confirmTask" name="Confirm" activiti:assignee="${bpm_assignee.properties.userName}" activiti:formKey="samplewf:customTypeTask"></userTask>

My question is

Why only the description of the workflow tasks change, but not the title?

The above localization works, when I don't use the task ID but it's property like this:

sampleWf.task.samplewf_customTypeTask.title=This changes the title

If this the only possibility I'd need to deploy a lot of custom types just for naming purposes. Can't I reuse types across workflows and just change the title (name) by this configuration?

Please refer to this link in order to have a better idea on how strings could be localized in a workflow in Alfresco :

 <workflow_prefix>_<workflow_name>.workflow.[title|description] <workflow_prefix>_<workflow_name>.node.<node_name>.[title|description] <workflow_prefix>_<workflow_name>.node.<node_name>.transition.<transition_name>.[title|description] <workflow_prefix>_<workflow_name>.task.<task_prefix>_<task_name>.[title|description] 

where:

 <workflow_prefix> is the workflow model namespace prefix <workflow_name> is the workflow name <node_name> is the name of a node within the workflow <transition_name> is the name of a node transition within the workflow <task_prefix> is the task namespace prefix <task_name> is the task name <transition_name> is the workflow transition name 

Which suggests you should be putting something like :

sampleWf_<workflow-name>.task.sampleWf_confirmTask.title=Confirm this, with a title which is different than the task name

Which -in theory- should give you the possibility of using the same task model in multiple workflows with different localization, but I guess you still have to duplicate your model in order to be able to have multiple localizations in the same workflow!

Update : Oops! I got tricked by this statement:

This page was last modified on 13 March 2015, at 02:22.

That was a bot marking the page as obsolete! The page is obviously outdated and it is talking about jbpm, not activiti, hopefully you still can use the same naming conventions!

Otherwise , worst case scenario, you got to create new task models that basically just extend your original task model to be able to customize the task title as needed (No need to redefine properties/constraints ...).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM