OPEN : ALF-11176: Untranslated strings in Group Review and Approve Task form

Activiti has one default transition "Next".  If there is no transition then the model builder was not finding a translation for the task outcome (and just using the english word, e.g. "Approve").  Now it looks up the translation workflowtask.outcome.[wf:outcome property]

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32724 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2011-12-13 13:14:03 +00:00
parent b0886a877c
commit 975efc8bb6

View File

@@ -59,6 +59,7 @@ import org.alfresco.service.namespace.QName;
import org.alfresco.util.Pair;
import org.alfresco.util.collections.CollectionUtils;
import org.alfresco.util.collections.Function;
import org.springframework.extensions.surf.util.I18NUtil;
import org.springframework.extensions.surf.util.ISO8601DateFormat;
/**
@@ -148,6 +149,8 @@ public class WorkflowModelBuilder
public static final String WORKFLOW_DEFINITION_START_TASK_DEFINITION_TYPE = "startTaskDefinitionType";
public static final String WORKFLOW_DEFINITION_TASK_DEFINITIONS = "taskDefinitions";
public static final String TASK_OUTCOME_MESSAGE_PREFIX = "workflowtask.outcome.";
private final NodeService nodeService;
private final PersonService personService;
private final WorkflowService workflowService;
@@ -625,11 +628,18 @@ public class WorkflowModelBuilder
}
if (outcomeLabel == null)
{
// TODO: is this okay -> no real transitions exist for activiti
String translatedOutcome = I18NUtil.getMessage(TASK_OUTCOME_MESSAGE_PREFIX+outcomeId);
if (translatedOutcome != null)
{
outcomeLabel = translatedOutcome;
}
else
{
outcomeLabel = outcomeId;
}
}
}
}
return outcomeLabel;
}