mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
- Added client pieces for handling ad hoc workflow tasks
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3614 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.alfresco.repo.workflow.jbpm;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -74,7 +75,21 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
|
||||
// extract action configuration
|
||||
String expression = null;
|
||||
List<VariableAccess> variableAccesses = null;
|
||||
if (script.isTextOnly())
|
||||
|
||||
// is the script specified as text only, or as explicit expression, variable elements
|
||||
boolean isTextOnly = true;
|
||||
Iterator<Element> iter = script.elementIterator();
|
||||
while (iter.hasNext())
|
||||
{
|
||||
Element element = iter.next();
|
||||
if (element.getNodeType() == Element.ELEMENT_NODE)
|
||||
{
|
||||
isTextOnly = false;
|
||||
}
|
||||
}
|
||||
|
||||
// extract script and variables
|
||||
if (isTextOnly)
|
||||
{
|
||||
expression = script.getTextTrim();
|
||||
}
|
||||
|
@@ -12,8 +12,8 @@
|
||||
<variable name="adhocpriority" access="write" mapped-name="wf:adhocPriority"/>
|
||||
<variable name="adhocdescription" access="write" mapped-name="wf:adhocDescription"/>
|
||||
<variable name="notify" access="write" mapped-name="wf:notifyMe"/>
|
||||
<variable name="package" access="write" mapped-name="bpm:package"/>
|
||||
<variable name="context" access="write" mapped-name="bpm:context"/>
|
||||
<variable name="workflowpackage" access="write" mapped-name="bpm:package"/>
|
||||
<variable name="workflowcontext" access="write" mapped-name="bpm:context"/>
|
||||
</controller>
|
||||
</task>
|
||||
<transition name="" to="adhoc"/>
|
||||
@@ -33,6 +33,8 @@
|
||||
<task name="wf:adhocTask" swimlane="assignee">
|
||||
<controller>
|
||||
<variable name="adhocdescription" access="read" mapped-name="wf:adhocDescription"/>
|
||||
<variable name="workflowpackage" access="read" mapped-name="bpm:package"/>
|
||||
<variable name="workflowcontext" access="read" mapped-name="bpm:context"/>
|
||||
</controller>
|
||||
</task>
|
||||
<transition name="" to="completed">
|
||||
@@ -42,10 +44,10 @@
|
||||
{
|
||||
var mail = actions.create("mail");
|
||||
mail.parameters.to = initiator.properties["cm:email"];
|
||||
mail.parameters.subject = "Adhoc Task " + adhocDescription;
|
||||
mail.parameters.subject = "Adhoc Task " + adhocdescription;
|
||||
mail.parameters.from = assignee.properties["cm:email"];
|
||||
mail.parameters.text = "It's done";
|
||||
mail.execute(package);
|
||||
mail.execute(workflowpackage);
|
||||
}
|
||||
</script>
|
||||
</action>
|
||||
@@ -53,9 +55,11 @@
|
||||
</task-node>
|
||||
|
||||
<task-node name="completed">
|
||||
<task name="wf:completedTask" swimlane="initiator">
|
||||
<task name="wf:completedAdhocTask" swimlane="initiator">
|
||||
<controller>
|
||||
<variable name="adhocdescription" access="read" mapped-name="wf:adhocDescription"/>
|
||||
<variable name="workflowpackage" access="read" mapped-name="bpm:package"/>
|
||||
<variable name="workflowcontext" access="read" mapped-name="bpm:context"/>
|
||||
</controller>
|
||||
</task>
|
||||
<transition name="" to="end"/>
|
||||
|
Reference in New Issue
Block a user