Merged V4.0-BUGFIX into HEAD

36343: ALF-13898: starting workflow from IMAP now using workflowDefs with engine name included, fallback to appending $jbpm when not present, to preserve backwards compatibility.
  36342: ALF-14120: fix only completed tasks returned

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@36344 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Frederik Heremans
2012-05-14 10:27:55 +00:00
parent a6529c9b66
commit 07f6923a61
2 changed files with 16 additions and 4 deletions

View File

@@ -1,10 +1,11 @@
<webscript> <webscript>
<shortname>IMAP Workflow Handler</shortname> <shortname>IMAP Workflow Handler</shortname>
<description> <description>
This webscript starts a different workflow. It is used in the IMAP email body links. This webscript starts a different workflow. It is used in the IMAP email body links. The workflowType should be a fully-qualified worklfow-definition name, with
engine-name included. eg: activiti$activitiAdhoc. If engine-name is left out, JBPM is used as engine-name for the process.
(The optional feature is the reply email with a report.) (The optional feature is the reply email with a report.)
</description> </description>
<url>/imap/start-workflow?alfTicket={ticket}&amp;nodeRefId={id}&amp;workflowType={wt}&amp;assignTo={at}&amp;workflowDueDateDay={ddd}&amp;workflowDueDateMonth={ddm}&amp;workflowDueDateYear={ddy}&amp;description={desc}</url> <url>/imap/start-workflow?alfTicket={ticket}&amp;nodeRefId={id}&amp;workflowType={wt}&amp;assignTo={at}&amp;workflowDueDateDay={ddd}&amp;workflowDueDateMonth={ddm}&amp;workflowDueDateYear={ddy}&amp;description={desc}&amp;workflowPriority={wp?}</url>
<format default="html">extension</format> <format default="html">extension</format>
<authentication>user</authentication> <authentication>user</authentication>
<transaction>required</transaction> <transaction>required</transaction>

View File

@@ -9,7 +9,13 @@ function main()
status.redirect = true; status.redirect = true;
return; return;
} }
var workflowType = "jbpm$wf:" + args.workflowType;
// ALF-13898: accept FULL workflow-definition name if provided, otherwise revert to prefixing behavior
var workflowType = args.workflowType;
if(workflowType.indexOf('$') < 0) {
workflowType = "jbpm$wf:" + workflowType;
}
var assignTo = people.getPerson(args.assignTo); var assignTo = people.getPerson(args.assignTo);
if (assignTo == undefined) if (assignTo == undefined)
{ {
@@ -32,7 +38,12 @@ function main()
workflow.parameters.workflowName = workflowType; workflow.parameters.workflowName = workflowType;
workflow.parameters["bpm:workflowDescription"] = description; workflow.parameters["bpm:workflowDescription"] = description;
workflow.parameters["bpm:assignee"] = assignTo; workflow.parameters["bpm:assignee"] = assignTo;
if (args.workflowPriority != null)
{
workflow.parameters["bpm:workflowPriority"] = args.workflowPriority; workflow.parameters["bpm:workflowPriority"] = args.workflowPriority;
}
if (dueDate != null) if (dueDate != null)
{ {
workflow.parameters["bpm:workflowDueDate"] = dueDate; workflow.parameters["bpm:workflowDueDate"] = dueDate;