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:
@@ -64,5 +64,5 @@ wf_workflowmodel.association.wf_assignee.title=Assignee
|
|||||||
wf_workflowmodel.association.wf_assignee.description=Who's doing the task
|
wf_workflowmodel.association.wf_assignee.description=Who's doing the task
|
||||||
wf_workflowmodel.type.wf_adhocTask.title=Adhoc Task
|
wf_workflowmodel.type.wf_adhocTask.title=Adhoc Task
|
||||||
wf_workflowmodel.type.wf_adhocTask.description=Adhoc Task allocated by colleague
|
wf_workflowmodel.type.wf_adhocTask.description=Adhoc Task allocated by colleague
|
||||||
wf_workflowmodel.type.wf_completedTask.title=Adhoc Task Completed
|
wf_workflowmodel.type.wf_completedAdhocTask.title=Adhoc Task Completed
|
||||||
wf_workflowmodel.type.wf_completedTask.description=Adhoc Task Completed
|
wf_workflowmodel.type.wf_completedAdhocTask.description=Adhoc Task Completed
|
||||||
|
@@ -150,7 +150,7 @@
|
|||||||
<parent>wf:baseAdhocTask</parent>
|
<parent>wf:baseAdhocTask</parent>
|
||||||
</type>
|
</type>
|
||||||
|
|
||||||
<type name="wf:completedTask">
|
<type name="wf:completedAdhocTask">
|
||||||
<title>Completed Adhoc Task</title>
|
<title>Completed Adhoc Task</title>
|
||||||
<parent>wf:baseAdhocTask</parent>
|
<parent>wf:baseAdhocTask</parent>
|
||||||
</type>
|
</type>
|
||||||
|
@@ -17,6 +17,7 @@
|
|||||||
package org.alfresco.repo.workflow.jbpm;
|
package org.alfresco.repo.workflow.jbpm;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -74,7 +75,21 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
|
|||||||
// extract action configuration
|
// extract action configuration
|
||||||
String expression = null;
|
String expression = null;
|
||||||
List<VariableAccess> variableAccesses = 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();
|
expression = script.getTextTrim();
|
||||||
}
|
}
|
||||||
|
@@ -12,8 +12,8 @@
|
|||||||
<variable name="adhocpriority" access="write" mapped-name="wf:adhocPriority"/>
|
<variable name="adhocpriority" access="write" mapped-name="wf:adhocPriority"/>
|
||||||
<variable name="adhocdescription" access="write" mapped-name="wf:adhocDescription"/>
|
<variable name="adhocdescription" access="write" mapped-name="wf:adhocDescription"/>
|
||||||
<variable name="notify" access="write" mapped-name="wf:notifyMe"/>
|
<variable name="notify" access="write" mapped-name="wf:notifyMe"/>
|
||||||
<variable name="package" access="write" mapped-name="bpm:package"/>
|
<variable name="workflowpackage" access="write" mapped-name="bpm:package"/>
|
||||||
<variable name="context" access="write" mapped-name="bpm:context"/>
|
<variable name="workflowcontext" access="write" mapped-name="bpm:context"/>
|
||||||
</controller>
|
</controller>
|
||||||
</task>
|
</task>
|
||||||
<transition name="" to="adhoc"/>
|
<transition name="" to="adhoc"/>
|
||||||
@@ -33,6 +33,8 @@
|
|||||||
<task name="wf:adhocTask" swimlane="assignee">
|
<task name="wf:adhocTask" swimlane="assignee">
|
||||||
<controller>
|
<controller>
|
||||||
<variable name="adhocdescription" access="read" mapped-name="wf:adhocDescription"/>
|
<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>
|
</controller>
|
||||||
</task>
|
</task>
|
||||||
<transition name="" to="completed">
|
<transition name="" to="completed">
|
||||||
@@ -42,10 +44,10 @@
|
|||||||
{
|
{
|
||||||
var mail = actions.create("mail");
|
var mail = actions.create("mail");
|
||||||
mail.parameters.to = initiator.properties["cm:email"];
|
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.from = assignee.properties["cm:email"];
|
||||||
mail.parameters.text = "It's done";
|
mail.parameters.text = "It's done";
|
||||||
mail.execute(package);
|
mail.execute(workflowpackage);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</action>
|
</action>
|
||||||
@@ -53,9 +55,11 @@
|
|||||||
</task-node>
|
</task-node>
|
||||||
|
|
||||||
<task-node name="completed">
|
<task-node name="completed">
|
||||||
<task name="wf:completedTask" swimlane="initiator">
|
<task name="wf:completedAdhocTask" swimlane="initiator">
|
||||||
<controller>
|
<controller>
|
||||||
<variable name="adhocdescription" access="read" mapped-name="wf:adhocDescription"/>
|
<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>
|
</controller>
|
||||||
</task>
|
</task>
|
||||||
<transition name="" to="end"/>
|
<transition name="" to="end"/>
|
||||||
|
Reference in New Issue
Block a user