mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
ALF-800 Externalized the exception messages for JB PMEngine.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19806 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2,18 +2,34 @@ function main()
|
||||
{
|
||||
// Task ID
|
||||
var taskId = url.templateArgs.taskId;
|
||||
if (taskId === undefined)
|
||||
if (taskId === undefined || taskId == null )
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "TaskID missing when ending task.");
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO Quick-fix, workaround to handle $ being removed from taskId.
|
||||
// C;heck taskId contains $ and add if not.
|
||||
var separatorIndex = taskId.indexOf('$');
|
||||
if(separatorIndex == -1)
|
||||
{
|
||||
if(taskId.indexOf('jbpm') == 0)
|
||||
{
|
||||
taskId = 'jbpm$' + taskId.substring(4);
|
||||
}
|
||||
else
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "TaskID missing when ending task.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check TaskId is valid
|
||||
var task = workflow.getTask(taskId);
|
||||
if (task === null)
|
||||
{
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Invalid TaskID when ending task.");
|
||||
return;
|
||||
status.setCode(status.STATUS_BAD_REQUEST, "Invalid TaskID when ending task.");
|
||||
return;
|
||||
}
|
||||
|
||||
model.taskId = taskId;
|
||||
|
Reference in New Issue
Block a user