mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fix fallout from javascript/freemarker node conversion refactoring.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5963 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -97,9 +97,9 @@ public class AlfrescoAssignment extends JBPMSpringAssignmentHandler
|
|||||||
{
|
{
|
||||||
actor = (String)eval;
|
actor = (String)eval;
|
||||||
}
|
}
|
||||||
else if (eval instanceof ScriptNode)
|
else if (eval instanceof JBPMNode)
|
||||||
{
|
{
|
||||||
actor = mapAuthorityToName((ScriptNode)eval, false);
|
actor = mapAuthorityToName((JBPMNode)eval, false);
|
||||||
}
|
}
|
||||||
if (actor == null)
|
if (actor == null)
|
||||||
{
|
{
|
||||||
|
@@ -125,10 +125,6 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
|
|||||||
|
|
||||||
// execute
|
// execute
|
||||||
Object result = executeScript(executionContext, services, expression, variableAccesses);
|
Object result = executeScript(executionContext, services, expression, variableAccesses);
|
||||||
if (result instanceof ScriptNode)
|
|
||||||
{
|
|
||||||
result = new JBPMNode(((ScriptNode)result).getNodeRef(), services);
|
|
||||||
}
|
|
||||||
|
|
||||||
// map script return variable to process context
|
// map script return variable to process context
|
||||||
VariableAccess returnVariable = getWritableVariable(variableAccesses);
|
VariableAccess returnVariable = getWritableVariable(variableAccesses);
|
||||||
@@ -155,6 +151,10 @@ public class AlfrescoJavaScript extends JBPMSpringActionHandler
|
|||||||
Map<String, Object> inputMap = createInputMap(context, services, variableAccesses);
|
Map<String, Object> inputMap = createInputMap(context, services, variableAccesses);
|
||||||
ScriptService scriptService = services.getScriptService();
|
ScriptService scriptService = services.getScriptService();
|
||||||
Object result = scriptService.executeScriptString(expression, inputMap);
|
Object result = scriptService.executeScriptString(expression, inputMap);
|
||||||
|
if (result instanceof NodeRef)
|
||||||
|
{
|
||||||
|
result = new JBPMNode((NodeRef)result, services);
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,11 +24,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.workflow.jbpm;
|
package org.alfresco.repo.workflow.jbpm;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.alfresco.service.ServiceRegistry;
|
import org.alfresco.service.ServiceRegistry;
|
||||||
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.workflow.WorkflowException;
|
import org.alfresco.service.cmr.workflow.WorkflowException;
|
||||||
import org.dom4j.Element;
|
import org.dom4j.Element;
|
||||||
import org.jbpm.graph.def.Node;
|
import org.jbpm.graph.def.Node;
|
||||||
@@ -105,13 +107,16 @@ public class ForEachFork extends JBPMSpringActionHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
// expression evaluates to Node array
|
// expression evaluates to Node array
|
||||||
else if (eval instanceof org.alfresco.repo.jscript.ScriptNode[])
|
else if (eval instanceof Serializable[])
|
||||||
{
|
{
|
||||||
org.alfresco.repo.jscript.ScriptNode[] nodes = (org.alfresco.repo.jscript.ScriptNode[])eval;
|
Serializable[] nodes = (Serializable[])eval;
|
||||||
forEachColl = new ArrayList(nodes.length);
|
forEachColl = new ArrayList(nodes.length);
|
||||||
for (org.alfresco.repo.jscript.ScriptNode node : nodes)
|
for (Serializable node : nodes)
|
||||||
{
|
{
|
||||||
forEachColl.add(new JBPMNode(node.getNodeRef(), services));
|
if (node instanceof NodeRef)
|
||||||
|
{
|
||||||
|
forEachColl.add(new JBPMNode((NodeRef)node, services));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user