[jbpm-commits] JBoss JBPM SVN: r6149 - in jbpm4/branches/tbaeyens/modules: bpmn/src/main/java/org/jbpm/bpmn/parser and 13 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jan 29 10:52:12 EST 2010


Author: tom.baeyens at jboss.com
Date: 2010-01-29 10:52:11 -0500 (Fri, 29 Jan 2010)
New Revision: 6149

Added:
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/ScriptExpression.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/StaticTextExpression.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelMethodExpression.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelValueExpression.java
Removed:
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluator.java
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluatorDescriptor.java
Modified:
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ActivityResource.java
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/JavaServiceTaskActivity.java
   jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
   jbpm4/branches/tbaeyens/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TaskParsingTest.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/Expression.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/JbpmElFactoryImpl.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventListenerReference.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
   jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/usercode/UserCodeReference.java
Log:
expression refactorings

Modified: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/AbstractTaskBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -3,6 +3,7 @@
 import java.util.List;
 
 import org.jbpm.bpmn.model.BpmnProcessDefinition;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.xml.Parse;
@@ -67,15 +68,13 @@
     if (rae != null) {
       String formalExpression = XmlUtil.element(rae, "formalExpression", true, parse).getTextContent().trim();
       String lang = XmlUtil.attribute(rae, "language", false, parse);
+      Expression expression = Expression.create(formalExpression, lang);
       if (PERFORMER.equals(type) || HUMAN_PERFORMER.equals(type)) {
-        taskDefinition.setAssigneeExpression(formalExpression);
-        taskDefinition.setAssigneeExpressionLanguage(lang);
+        taskDefinition.setAssigneeExpression(expression);
       } else if (POTENTIAL_OWNER.equals(type) && "user".equals(scope)) { // default is group
-        taskDefinition.setCandidateUsersExpression(formalExpression);
-        taskDefinition.setCandidateUsersExpressionLanguage(lang);
+        taskDefinition.setCandidateUsersExpression(expression);
       } else { 
-        taskDefinition.setCandidateGroupsExpression(formalExpression);
-        taskDefinition.setCandidateGroupsExpressionLanguage(lang);
+        taskDefinition.setCandidateGroupsExpression(expression);
       }
     }
 

Modified: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ActivityResource.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ActivityResource.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/ActivityResource.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -1,13 +1,11 @@
 package org.jbpm.bpmn.flownodes;
 
 import org.jbpm.bpmn.common.Resource;
-import org.jbpm.bpmn.parser.ExpressionEvaluatorDescriptor;
 
 public class ActivityResource {
   
   String id;
   Resource resourceRef;
-  ExpressionEvaluatorDescriptor resourceAssignmentExpression;
 
   public String getId() {
     return id;
@@ -24,14 +22,4 @@
   public void setResourceRef(Resource resourceRef) {
     this.resourceRef = resourceRef;
   }
-
-  
-  public ExpressionEvaluatorDescriptor getResourceAssignmentExpression() {
-    return resourceAssignmentExpression;
-  }
-  
-  public void setResourceAssignmentExpression(ExpressionEvaluatorDescriptor resourceAssignmentExpression) {
-    this.resourceAssignmentExpression = resourceAssignmentExpression;
-  }
-
 }

Modified: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/JavaServiceTaskActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/JavaServiceTaskActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/JavaServiceTaskActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -26,8 +26,8 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.model.OpenExecution;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.WireException;
@@ -43,8 +43,7 @@
 
   private static final long serialVersionUID = 1L;
   
-  protected String targetExpression;
-  protected String targetLanguage;
+  protected Expression targetExpression;
   protected Object target;
 
   protected String methodName;
@@ -61,8 +60,7 @@
       invocationTarget = target;
 
     } else if (targetExpression!=null) {
-      ScriptManager scriptManager = ScriptManager.getScriptManager();
-      invocationTarget = scriptManager.evaluateExpression(targetExpression, targetLanguage);
+      invocationTarget = targetExpression.evaluate(execution);
     
     } else {
       throw new JbpmException("no target specified");
@@ -108,10 +106,7 @@
   public void setInvokeOperation(InvokeOperation invokeOperation) {
     this.invokeOperation = invokeOperation;
   }
-  public void setTargetExpression(String expression) {
+  public void setTargetExpression(Expression expression) {
     this.targetExpression = expression;
   }
-  public void setTargetLanguage(String language) {
-    this.targetLanguage = language;
-  }
 }

Modified: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/flownodes/UserTaskActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -24,9 +24,8 @@
 import java.util.Map;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.bpmn.parser.ExpressionEvaluator;
-import org.jbpm.bpmn.parser.ExpressionEvaluatorDescriptor;
 import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.history.HistoryEvent;
 import org.jbpm.pvm.internal.history.events.TaskActivityStart;
@@ -35,7 +34,6 @@
 import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
 import org.jbpm.pvm.internal.task.TaskImpl;
-import org.jbpm.pvm.internal.wire.WireContext;
 
 /**
  * @author Tom Baeyens
@@ -60,11 +58,10 @@
     task.setProcessInstance(execution.getProcessInstance());
     task.setSignalling(true);
 
-    if (taskDefinition.getAssigneeExpression() != null) {
-      ExpressionEvaluatorDescriptor eed = new ExpressionEvaluatorDescriptor(taskDefinition.getAssigneeExpression(), taskDefinition
-              .getAssigneeExpressionLanguage());
-      ExpressionEvaluator ee = (ExpressionEvaluator) WireContext.create(eed);
-      task.setAssignee((String) ee.evaluateExpression(execution));
+    Expression assigneeExpression = taskDefinition.getAssigneeExpression();
+    if (assigneeExpression != null) {
+      Object assignee = assigneeExpression.evaluate(execution);
+      task.setAssignee((assignee!=null ? assignee.toString() : null));
     }
 
     // initialize the name
@@ -74,7 +71,12 @@
       task.setName(execution.getActivityName());
     }
 
-    task.setDescription(taskDefinition.getDescription());
+    Expression descriptionExpression = taskDefinition.getDescription();
+    if (descriptionExpression!=null) {
+      String description = (String) descriptionExpression.evaluate(task);
+      task.setDescription(description);
+    }
+
     task.setPriority(taskDefinition.getPriority());
     task.setFormResourceName(taskDefinition.getFormResourceName());
 

Deleted: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluator.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluator.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluator.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.bpmn.parser;
-
-import org.jbpm.api.model.OpenExecution;
-import org.jbpm.pvm.internal.model.Condition;
-import org.jbpm.pvm.internal.script.ScriptManager;
-
-/**
- * @author Tom Baeyens
- */
-public class ExpressionEvaluator implements Condition {
-  
-  private static final long serialVersionUID = 1L;
-
-  protected String name;
-  protected String expr;
-  protected String lang;
-  
-  public ExpressionEvaluator(String name, String expr, String lang) {
-    this.name = name;
-    this.expr = expr;
-    this.lang = lang;
-  }
-
-  public boolean evaluate(OpenExecution execution) {
-    return (Boolean) evaluateExpression(execution);
-  }
-
-  public Object evaluateExpression(OpenExecution execution) {
-    ScriptManager scriptManager = ScriptManager.getScriptManager();
-    return scriptManager.evaluateExpression(expr, lang);
-  }
-
-  public String getName() {
-    return name;
-  }
-}

Deleted: jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluatorDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluatorDescriptor.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/bpmn/src/main/java/org/jbpm/bpmn/parser/ExpressionEvaluatorDescriptor.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.bpmn.parser;
-
-import org.jbpm.pvm.internal.wire.WireContext;
-import org.jbpm.pvm.internal.wire.descriptor.AbstractDescriptor;
-
-
-/**
- * @author Tom Baeyens
- * 
- * @deprecated to be replaced by {@link UserCodeReference} see also package org.jbpm.pvm.internal.wire.usercode 
- */
-public class ExpressionEvaluatorDescriptor extends AbstractDescriptor {
-  
-  private static final long serialVersionUID = 1L;
-
-  protected String expr;
-  protected String lang;
-  
-  public ExpressionEvaluatorDescriptor() {
-  }
-
-  public ExpressionEvaluatorDescriptor(String expr, String lang) {
-    this.expr = expr;
-    this.lang = lang;
-  }
-
-  public Object construct(WireContext wireContext) {
-    return new ExpressionEvaluator(getName(), expr, lang);
-  }
-
-}

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -21,12 +21,10 @@
  */
 package org.jbpm.jpdl.internal.activity;
 
-import javax.el.MethodExpression;
-import javax.el.ValueExpression;
-
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.pvm.internal.el.Expression;
-import org.jbpm.pvm.internal.model.ExecutionImpl;
+import org.jbpm.pvm.internal.el.UelValueExpression;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
 
@@ -42,7 +40,7 @@
   protected Descriptor fromValueDescriptor;
 
   protected String toVariableName;
-  protected Expression toExpression;
+  protected UelValueExpression toExpression;
 
   void perform(OpenExecution execution) throws Exception {
     Object value = null;
@@ -51,7 +49,7 @@
       value = fromExpression.evaluate(execution);
       
     } else if (fromValueDescriptor!=null) {
-      value = WireContext.create(fromValueDescriptor);
+      value = WireContext.create(fromValueDescriptor, (ScopeInstanceImpl) execution);
     }
     
     if (toVariableName!=null) {
@@ -70,7 +68,7 @@
   public void setFromExpression(Expression fromExpression) {
     this.fromExpression = fromExpression;
   }
-  public void setToExpression(Expression toExpression) {
+  public void setToExpression(UelValueExpression toExpression) {
     this.toExpression = toExpression;
   }
 }

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/AssignBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -26,6 +26,7 @@
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
 import org.jbpm.pvm.internal.el.Expression;
+import org.jbpm.pvm.internal.el.UelValueExpression;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -50,8 +51,8 @@
     if (toVar!=null) {
       assignActivity.setToVariableName(toVar);
     } else if (toExpr!=null) {
-      Expression expression = new Expression(toExpr, Expression.TYPE_VALUE);
-      assignActivity.setToExpression(expression);
+      Expression expression = Expression.create(toExpr, Expression.LANGUAGE_UEL_VALUE);
+      assignActivity.setToExpression((UelValueExpression) expression);
     }
 
     String exprText = XmlUtil.attribute(element, "expr");
@@ -59,7 +60,7 @@
 
     // if there is an expr specified
     if (exprText!=null) {
-      Expression expression = new Expression(exprText, exprType);
+      Expression expression = Expression.create(exprText, exprType);
       assignActivity.setFromExpression(expression);
 
     } else { // there is no expr specified

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExpressionCondition;
 import org.jbpm.pvm.internal.model.TransitionImpl;
@@ -46,9 +47,10 @@
   public Object parseJpdl(Element element, Parse parse, JpdlParser parser) {
     if (element.hasAttribute("expr")) {
       DecisionExpressionActivity decisionExpressionActivity = new DecisionExpressionActivity();
-      String expr = element.getAttribute("expr");
-      decisionExpressionActivity.setExpression(expr);
-      decisionExpressionActivity.setLanguage(XmlUtil.attribute(element, "lang"));
+      String expressionText = element.getAttribute("expr");
+      String language = XmlUtil.attribute(element, "lang");
+      Expression expression = Expression.create(expressionText, language);
+      decisionExpressionActivity.setExpression(expression);
       return decisionExpressionActivity;
     }
 

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionExpressionActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -25,8 +25,8 @@
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.model.Activity;
 import org.jbpm.api.model.Transition;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
 
 /**
  * @author Tom Baeyens
@@ -35,8 +35,7 @@
 
   private static final long serialVersionUID = 1L;
 
-  protected String expression;
-  protected String language;
+  protected Expression expression;
 
   public void execute(ActivityExecution execution) {
     execute((ExecutionImpl) execution); 
@@ -46,8 +45,7 @@
     Activity activity = execution.getActivity();
     String transitionName = null;
 
-    ScriptManager scriptManager = ScriptManager.getScriptManager();
-    Object result = scriptManager.evaluateExpression(expression, language);
+    Object result = expression.evaluate(execution);
     if ( (result!=null)
          && (! (result instanceof String))
        ) {
@@ -65,10 +63,7 @@
     execution.take(transition);
   }
 
-  public void setExpression(String expr) {
-    this.expression = expr;
+  public void setExpression(Expression expression) {
+    this.expression = expression;
   }
-  public void setLanguage(String lang) {
-    this.language = lang;
-  }
 }

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -27,6 +27,7 @@
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
@@ -58,7 +59,7 @@
     if (parametersDescriptor!=null) {
       for (Descriptor valueDescriptor: parametersDescriptor.getValueDescriptors()) {
         String parameterName = valueDescriptor.getName();
-        Object value = WireContext.create(valueDescriptor);
+        Object value = WireContext.create(valueDescriptor, (ScopeInstanceImpl) execution);
         applyParameter(q, parameterName, value);
       }
     }

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -53,6 +53,8 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.api.model.OpenExecution;
 import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.el.Expression;
+import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
@@ -69,8 +71,8 @@
   private static final long serialVersionUID = 1L;
 
   protected String type = null;
-  protected String textExpression = null;
-  protected String objectExpression = null;
+  protected Expression textExpression = null;
+  protected Expression objectExpression = null;
   protected MapDescriptor mapDescriptor = null;
   protected String connectionFactoryName = null;
   protected String destinationName = null;
@@ -89,12 +91,12 @@
         if (destination instanceof Queue) {
           log.debug("destination '"+destinationName+"' is a Queue: using xa queue jms apis");
           XAQueueConnectionFactory xaQueueConnectionFactory = (XAQueueConnectionFactory) connectionFactory;
-          sendToQueueXA((Queue) destination, xaQueueConnectionFactory);
+          sendToQueueXA((Queue) destination, xaQueueConnectionFactory, (ExecutionImpl) execution);
   
         } else if (destination instanceof Topic) {
           log.debug("destination '"+destinationName+"' is a Topic: using xa topic jms apis");
           XATopicConnectionFactory xaTopicConnectionFactory = (XATopicConnectionFactory) connectionFactory;
-          sendToTopicXA((Topic) destination, xaTopicConnectionFactory);
+          sendToTopicXA((Topic) destination, xaTopicConnectionFactory, (ExecutionImpl) execution);
           
         } else {
           throw new JbpmException("invalid destination type for '"+destinationName+"': "+destination.getClass().getName());
@@ -105,12 +107,12 @@
         if (destination instanceof Queue) {
           log.debug("destination '"+destinationName+"' is a Queue: using non-xa queue jms apis");
           QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) connectionFactory;
-          sendToQueue((Queue) destination, queueConnectionFactory);
+          sendToQueue((Queue) destination, queueConnectionFactory, (ExecutionImpl) execution);
     
         } else if (destination instanceof Topic) {
           log.debug("destination '"+destinationName+"' is a Topic: using non-xa topic jms apis");
           TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) connectionFactory;
-          sendToTopic((Topic) destination, topicConnectionFactory);
+          sendToTopic((Topic) destination, topicConnectionFactory, (ExecutionImpl) execution);
           
         } else {
           throw new JbpmException("invalid destination type for '"+destinationName+"': "+destination.getClass().getName());
@@ -127,7 +129,7 @@
     }
   }
 
-  protected void sendToQueueXA(Queue queue, XAQueueConnectionFactory xaQueueConnectionFactory) throws Exception {
+  protected void sendToQueueXA(Queue queue, XAQueueConnectionFactory xaQueueConnectionFactory, ExecutionImpl execution) throws Exception {
     XAQueueConnection xaQueueConnection = null;
     XAQueueSession xaQueueSession = null;
     MessageProducer messageProducer = null;
@@ -136,7 +138,7 @@
       xaQueueConnection = xaQueueConnectionFactory.createXAQueueConnection();
       xaQueueSession = xaQueueConnection.createXAQueueSession();
       messageProducer = xaQueueSession.createProducer(queue);
-      Message message = createMessage(xaQueueSession);
+      Message message = createMessage(xaQueueSession, execution);
       messageProducer.send(message);
 
     } finally {
@@ -158,7 +160,7 @@
     }
   }
 
-  protected void sendToTopicXA(Topic topic, XATopicConnectionFactory xaTopicConnectionFactory) throws Exception {
+  protected void sendToTopicXA(Topic topic, XATopicConnectionFactory xaTopicConnectionFactory, ExecutionImpl execution) throws Exception {
     XATopicConnection xaTopicConnection = null;
     XATopicSession xaTopicSession = null;
     MessageProducer messageProducer = null;
@@ -167,7 +169,7 @@
       xaTopicConnection = xaTopicConnectionFactory.createXATopicConnection();
       xaTopicSession = xaTopicConnection.createXATopicSession();
       messageProducer = xaTopicSession.createProducer(topic);
-      Message message = createMessage(xaTopicSession);
+      Message message = createMessage(xaTopicSession, execution);
       messageProducer.send(message);
 
     } finally {
@@ -189,7 +191,7 @@
     }
   }
 
-  protected void sendToQueue(Queue queue, QueueConnectionFactory queueConnectionFactory) throws Exception {
+  protected void sendToQueue(Queue queue, QueueConnectionFactory queueConnectionFactory, ExecutionImpl execution) throws Exception {
     QueueConnection queueConnection = null;
     QueueSession queueSession = null;
     QueueSender queueSender = null;
@@ -198,7 +200,7 @@
       queueConnection = queueConnectionFactory.createQueueConnection();
       queueSession = queueConnection.createQueueSession(transacted, acknowledgeMode);
       queueSender = queueSession.createSender(queue);
-      Message message = createMessage(queueSession);
+      Message message = createMessage(queueSession, execution);
       queueSender.send(message);
       if (transacted) {
         queueSession.commit();
@@ -223,7 +225,7 @@
     }
   }
 
-  protected void sendToTopic(Topic topic, TopicConnectionFactory topicConnectionFactory) throws Exception {
+  protected void sendToTopic(Topic topic, TopicConnectionFactory topicConnectionFactory, ExecutionImpl execution) throws Exception {
     TopicConnection topicConnection = null;
     TopicSession topicSession = null;
     TopicPublisher topicPublisher = null;
@@ -232,7 +234,7 @@
       topicConnection = topicConnectionFactory.createTopicConnection();
       topicSession = topicConnection.createTopicSession(transacted, acknowledgeMode);
       topicPublisher = topicSession.createPublisher(topic);
-      Message message = createMessage(topicSession);
+      Message message = createMessage(topicSession, execution);
       topicPublisher.send(message);
       if (transacted) {
         topicSession.commit();
@@ -257,18 +259,18 @@
     }
   }
 
-  protected Message createMessage(Session session) throws Exception {
+  protected Message createMessage(Session session, ExecutionImpl execution) throws Exception {
     if ("text".equals(type)) {
-      return createTextMessage(session);
+      return createTextMessage(session, execution);
     } else if ("object".equals(type)) {
-      return createObjectMessage(session);
+      return createObjectMessage(session, execution);
     } else if ("map".equals(type)) {
-      return createMapMessage(session);
+      return createMapMessage(session, execution);
     }
     throw new JbpmException("no type configured in jms activity");
   }
 
-  private MapMessage createMapMessage(Session session) throws Exception {
+  private MapMessage createMapMessage(Session session, ExecutionImpl execution) throws Exception {
     MapMessage result = session.createMapMessage();
     if (mapDescriptor != null) {
       List<Descriptor> keyDescriptors = mapDescriptor.getKeyDescriptors();
@@ -282,16 +284,16 @@
     return result;
   }
 
-  private TextMessage createTextMessage(Session session) throws Exception {
-    Object value =  ScriptManager.getScriptManager().evaluateExpression(textExpression, null);
+  private TextMessage createTextMessage(Session session, ExecutionImpl execution) throws Exception {
+    Object value = textExpression.evaluate(execution);
     if (value!=null) {
       return session.createTextMessage(value.toString());
     }
     throw new JbpmException("null value for expression '"+textExpression+"' in jms activity"); 
   }
 
-  private ObjectMessage createObjectMessage(Session session) throws Exception {
-    Object object = ScriptManager.getScriptManager().evaluateExpression(objectExpression, null);
+  private ObjectMessage createObjectMessage(Session session, ExecutionImpl execution) throws Exception {
+    Object object = objectExpression.evaluate(execution);
     if ( (object!=null)
          && !(object instanceof Serializable)
        ) {
@@ -303,11 +305,11 @@
   public void setType(String type) {
     this.type = type;
   }
-  public void setText(String text) {
-    this.textExpression = text;
+  public void setTextExpression(Expression textExpression) {
+    this.textExpression = textExpression;
   }
-  public void setExpression(String expression) {
-    this.objectExpression = expression;
+  public void setObjectExpression(Expression objectExpression) {
+    this.objectExpression = objectExpression;
   }
   public void setMapDescriptor(MapDescriptor mapDescriptor) {
     this.mapDescriptor = mapDescriptor;

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JmsBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -24,6 +24,7 @@
 import javax.jms.Session;
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.descriptor.MapDescriptor;
@@ -78,15 +79,18 @@
 
     Element textElement = XmlUtil.element(element, "text", false, parse);
     if (textElement != null) {
-      String text = XmlUtil.getContentText(textElement);
+      String expressionText = XmlUtil.getContentText(textElement);
       jmsActivity.setType("text");
-      jmsActivity.setText(text);
+      Expression expression = Expression.create(expressionText, Expression.LANGUAGE_UEL);
+      jmsActivity.setTextExpression(expression);
     }
 
     Element objectElement = XmlUtil.element(element, "object", false, parse);
     if (objectElement != null) {
       jmsActivity.setType("object");
-      jmsActivity.setExpression(XmlUtil.attribute(objectElement, "expr"));
+      String expressionText = XmlUtil.attribute(objectElement, "expr");
+      Expression expression = Expression.create(expressionText, Expression.LANGUAGE_UEL);
+      jmsActivity.setObjectExpression(expression);
     }
 
     Element mapElement = XmlUtil.element(element, "map", false, parse);

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -24,6 +24,7 @@
 import java.util.List;
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.xml.Parse;
 import org.w3c.dom.Element;
@@ -54,8 +55,8 @@
         
         if (factExpr!=null) {
           String factLang = XmlUtil.attribute(factElement, "lang");
-          rulesFact.setExpression(factExpr);
-          rulesFact.setLanguage(factLang);
+          Expression expression = Expression.create(factExpr, factLang);
+          rulesFact.setExpression(expression);
 
         } else { 
           parse.addProblem("'fact' element inside 'rules' activity requires attribute 'var' or 'expr'", element);

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/RulesFact.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -24,7 +24,7 @@
 import java.io.Serializable;
 
 import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.pvm.internal.script.ScriptManager;
+import org.jbpm.pvm.internal.el.Expression;
 
 /**
  * @author Tom Baeyens
@@ -34,7 +34,7 @@
   private static final long serialVersionUID = 1L;
   
   protected String variableName;
-  protected String expression;
+  protected Expression expression;
   protected String language;
   
   public String getVariableName() {
@@ -45,11 +45,11 @@
     this.variableName = variableName;
   }
   
-  public String getExpression() {
+  public Expression getExpression() {
     return expression;
   }
   
-  public void setExpression(String expression) {
+  public void setExpression(Expression expression) {
     this.expression = expression;
   }
   
@@ -66,7 +66,7 @@
       return execution.getVariable(variableName);
 
     } else if (expression!=null) {
-      return ScriptManager.getScriptManager().evaluateExpression(expression, language);
+      return expression.evaluate(execution);
     }
 
     return null;

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -27,12 +27,12 @@
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.model.Activity;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.env.Context;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.env.ExecutionContext;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.script.ScriptManager;
-import org.jbpm.pvm.internal.session.DbSession;
 import org.jbpm.pvm.internal.session.RepositorySession;
 import org.jbpm.pvm.internal.task.SwimlaneImpl;
 
@@ -51,7 +51,7 @@
   protected List<SubProcessInParameterImpl> inParameters;
   protected List<SubProcessOutParameterImpl> outParameters;
   
-  protected String outcomeExpression;
+  protected Expression outcomeExpression;
   protected Map<Object, String> outcomeVariableMappings;
 
   public void execute(ActivityExecution execution) {
@@ -122,8 +122,7 @@
       String subProcessActivityName = subProcessInstance.getActivityName();
       
       if (outcomeExpression!=null) {
-        ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
-        Object value = scriptManager.evaluateExpression(outcomeExpression, null);
+        Object value = outcomeExpression.evaluate(executionImpl);
         // if the value is a String and matches the name of an outgoing transition
         if ( (value instanceof String)
              && (activity.hasOutgoingTransition(((String) value)))
@@ -169,7 +168,7 @@
   public void setSubProcessId(String subProcessId) {
     this.subProcessId = subProcessId;
   }
-  public void setOutcomeExpression(String outcomeExpression) {
+  public void setOutcomeExpression(Expression outcomeExpression) {
     this.outcomeExpression = outcomeExpression;
   }
   public List<SubProcessInParameterImpl> getInParameters() {

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -27,6 +27,7 @@
 import java.util.Map;
 
 import org.jbpm.jpdl.internal.xml.JpdlParser;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.WireContext;
@@ -102,8 +103,10 @@
 
     Map<Object, String> outcomeVariableMappings = new HashMap<Object, String>();
 
-    String outcomeExpression = XmlUtil.attribute(element, "outcome");
-    if (outcomeExpression!=null) {
+    String outcomeExpressionText = XmlUtil.attribute(element, "outcome");
+    String outcomeLanguage = XmlUtil.attribute(element, "outcome-lang");
+    if (outcomeExpressionText!=null) {
+      Expression outcomeExpression = Expression.create(outcomeExpressionText, outcomeLanguage);
       subProcessActivity.setOutcomeExpression(outcomeExpression);
       
       for (Element transitionElement: XmlUtil.elements(element, "transition")) {
@@ -133,15 +136,12 @@
     String name = XmlUtil.attribute(element, "subvar");
     parameter.setSubVariableName(name);
     
-    String expr = XmlUtil.attribute(element, "expr");
-    if (expr!=null) {
-      parameter.setExpression(expr);
+    String expressionText = XmlUtil.attribute(element, "expr");
+    String language = XmlUtil.attribute(element, "expr-lang");
+    if (expressionText!=null) {
+      Expression expression = Expression.create(expressionText, language);
+      parameter.setExpression(expression);
     }
- 
-    String language = XmlUtil.attribute(element, "lang");
-    if (language!=null) {
-      parameter.setLanguage(language);
-    }
 
     String variable = XmlUtil.attribute(element, "var");
     if (variable!=null) {

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessInParameterImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -22,7 +22,6 @@
 package org.jbpm.jpdl.internal.activity;
 
 import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
 
 
 /**
@@ -37,8 +36,7 @@
     if (variableName!=null) {
       value = superExecution.getVariable(variableName);
     } else {
-      ScriptManager scriptManager = ScriptManager.getScriptManager();
-      value = scriptManager.evaluateExpression(expression, language);
+      value = expression.evaluateInScope(superExecution);
     }
     
     subProcessInstance.setVariable(subVariableName, value);

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessOutParameterImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -23,7 +23,6 @@
 
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
 
 
 /**
@@ -39,8 +38,7 @@
     if (variableName!=null) {
       value = subProcessInstance.getVariable(subVariableName);
     } else {
-      ScriptManager scriptManager = ScriptManager.getScriptManager();
-      value = scriptManager.evaluateExpression(expression, language);
+      value = expression.evaluateInScope(subProcessInstance);
     }
 
     superExecution.setVariable(variableName, value);

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessParameterImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -23,7 +23,9 @@
 
 import java.io.Serializable;
 
+import org.jbpm.pvm.internal.el.Expression;
 
+
 /**
  * @author Tom Baeyens
  */
@@ -33,8 +35,7 @@
 
   protected String subVariableName;
   protected String variableName;
-  protected String expression;
-  protected String language;
+  protected Expression expression;
 
   public String getVariableName() {
     return variableName;
@@ -42,18 +43,12 @@
   public void setVariableName(String variable) {
     this.variableName = variable;
   }
-  public String getExpression() {
+  public Expression getExpression() {
     return expression;
   }
-  public void setExpression(String expression) {
+  public void setExpression(Expression expression) {
     this.expression = expression;
   }
-  public String getLanguage() {
-    return language;
-  }
-  public void setLanguage(String language) {
-    this.language = language;
-  }
   public String getSubVariableName() {
     return subVariableName;
   }

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -28,6 +28,7 @@
 import org.jbpm.api.activity.ActivityExecution;
 import org.jbpm.api.model.Transition;
 import org.jbpm.pvm.internal.cal.Duration;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.history.HistoryEvent;
 import org.jbpm.pvm.internal.history.events.TaskActivityStart;
@@ -71,12 +72,9 @@
       task.setName(execution.getActivityName());
     }
 
-    String description = taskDefinition.getDescription();
-    if (description != null) {
-      if (description.contains("#{")) {
-        Object result = ScriptManager.getScriptManager().evaluateExpression(description, null);
-        description = result instanceof String ? (String) result : result.toString();
-      }
+    Expression descriptionExpression = taskDefinition.getDescription();
+    if (descriptionExpression != null) {
+      String description = (String) descriptionExpression.evaluate(task);
       task.setDescription(description);
     }
     task.setPriority(taskDefinition.getPriority());

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -57,8 +57,6 @@
 import org.jbpm.pvm.internal.model.TimerDefinitionImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.model.VariableDefinitionImpl;
-import org.jbpm.pvm.internal.model.VariableOutDefinitionImpl;
-import org.jbpm.pvm.internal.model.VariableOutDefinitionSet;
 import org.jbpm.pvm.internal.repository.DeploymentImpl;
 import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
 import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
@@ -494,8 +492,9 @@
   public void parseAssignmentAttributes(Element element, AssignableDefinitionImpl assignableDefinition, Parse parse) {
     Element descriptionElement = XmlUtil.element(element, "description");
     if (descriptionElement!=null) {
-      String description = XmlUtil.getContentText(descriptionElement);
-      assignableDefinition.setDescription(description);
+      String descriptionText = XmlUtil.getContentText(descriptionElement);
+      Expression descriptionExpression = Expression.create(descriptionText, Expression.LANGUAGE_UEL);
+      assignableDefinition.setDescription(descriptionExpression);
     }
   
     Element assignmentHandlerElement = XmlUtil.element(element, "assignment-handler");
@@ -504,23 +503,26 @@
       assignableDefinition.setAssignmentHandlerReference(assignmentHandlerReference);
     }
   
-    String assigneeExpression = XmlUtil.attribute(element, "assignee");
-    assignableDefinition.setAssigneeExpression(assigneeExpression);
+    String assigneeExpressionText = XmlUtil.attribute(element, "assignee");
+    if (assigneeExpressionText!=null) {
+      String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
+      Expression assigneeExpression = Expression.create(assigneeExpressionText, assigneeExpressionLanguage);
+      assignableDefinition.setAssigneeExpression(assigneeExpression);
+    }
     
-    String assigneeExpressionLanguage = XmlUtil.attribute(element, "assignee-lang");
-    assignableDefinition.setAssigneeExpressionLanguage(assigneeExpressionLanguage);
-    
-    String candidateUsersExpression = XmlUtil.attribute(element, "candidate-users");
-    assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
-    
-    String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
-    assignableDefinition.setCandidateUsersExpressionLanguage(candidateUsersExpressionLanguage);
-    
-    String candidateGroupsExpression = XmlUtil.attribute(element, "candidate-groups");
-    assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
-    
-    String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
-    assignableDefinition.setCandidateGroupsExpressionLanguage(candidateGroupsExpressionLanguage);
+    String candidateUsersExpressionText = XmlUtil.attribute(element, "candidate-users");
+    if (candidateUsersExpressionText!=null) {
+      String candidateUsersExpressionLanguage = XmlUtil.attribute(element, "candidate-users-lang");
+      Expression candidateUsersExpression = Expression.create(candidateUsersExpressionText, candidateUsersExpressionLanguage);
+      assignableDefinition.setCandidateUsersExpression(candidateUsersExpression);
+    }
+
+    String candidateGroupsExpressionText = XmlUtil.attribute(element, "candidate-groups");
+    if (candidateGroupsExpressionText!=null) {
+      String candidateGroupsExpressionLanguage = XmlUtil.attribute(element, "candidate-groups-lang");
+      Expression candidateGroupsExpression = Expression.create(candidateGroupsExpressionText, candidateGroupsExpressionLanguage);
+      assignableDefinition.setCandidateGroupsExpression(candidateGroupsExpression);
+    }
   }
 
   public TaskDefinitionImpl parseTaskDefinition(Element element, Parse parse, ScopeElementImpl scopeElement) {
@@ -594,7 +596,7 @@
       String initExpr = XmlUtil.attribute(variableElement, "init-expr");
       String initExprType = XmlUtil.attribute(variableElement, "init-expr-type");
       if (initExpr!=null) {
-        Expression initExpression = new Expression(initExpr, initExprType);
+        Expression initExpression = Expression.create(initExpr, initExprType);
         variableDefinition.setInitExpression(initExpression);
         sources++;
       }
@@ -695,7 +697,7 @@
     ObjectDescriptor objectDescriptor = parseObjectDescriptor(element, parse);
     userCodeReference.setDescriptor(objectDescriptor);
     
-    if (objectDescriptor.getExpr()!=null) {
+    if (objectDescriptor.getExpression()!=null) {
       // expressions are not cached by default
       userCodeReference.setCached(false);
     }

Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TaskParsingTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TaskParsingTest.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/test/java/org/jbpm/jpdl/parsing/TaskParsingTest.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -4,6 +4,8 @@
 import org.jbpm.api.model.Activity;
 import org.jbpm.jpdl.internal.activity.TaskActivity;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
+import org.jbpm.pvm.internal.el.Expression;
+import org.jbpm.pvm.internal.el.StaticTextExpression;
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
 
@@ -31,7 +33,8 @@
     TaskDefinitionImpl taskDefinition = taskActivity.getTaskDefinition();
 
     // check for properties not previously parsed
-    assertEquals("first task", taskDefinition.getDescription());
+    StaticTextExpression descriptionExpression = (StaticTextExpression) taskDefinition.getDescription();
+    assertEquals("first task", descriptionExpression.getText());
     assertEquals(3, taskDefinition.getPriority());
     assertEquals("aForm", taskDefinition.getFormResourceName());
     assertEquals("1 day", taskDefinition.getDueDateDescription());

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/builder/VariableBuilder.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -55,7 +55,7 @@
   }
 
   public VariableBuilder initialExpression(String initialExpression) {
-    variableDefinition.setInitExpression(new Expression(initialExpression, null));
+    variableDefinition.setInitExpression(Expression.create(initialExpression, null));
     return this;
   }
 

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/Expression.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/Expression.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/Expression.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -35,53 +35,60 @@
 import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 
 
-/**
+/** handles all expression resolving
+ * 
  * @author Tom Baeyens
  */
-public class Expression implements Serializable {
+public abstract class Expression implements Serializable {
 
   private static final long serialVersionUID = 1L;
 
-  public static final String TYPE_METHOD = "method";
-  public static final String TYPE_VALUE = "value";
+  public static final String LANGUAGE_UEL = "uel";
+  public static final String LANGUAGE_UEL_METHOD = "uel-method";
+  public static final String LANGUAGE_UEL_VALUE = "uel-value";
 
   private static ExpressionFactory expressionFactory = null;
   private static ELContext elContext = null;
 
-  protected ValueExpression valueExpression;
-  protected MethodExpression methodExpression;
-
-  // paring ///////////////////////////////////////////////////////////////////
-  
-  public Expression(String expressionText, String exprType) {
+  public static Expression create(String expressionText, String language) {
     // if there is an expr specified
     if (expressionText==null) {
       throw new JbpmException("expressionText is null");
     }
+    
+    if (language==null || language.startsWith(LANGUAGE_UEL)) {
+      if (expressionText.indexOf('{')==-1) {
+        return new StaticTextExpression(expressionText);
+      }
+      initExpressionObjects();
 
-    initExpressionObjects();
-
-    // by default, expr is interpreted as a value expression
-    if (exprType==null || TYPE_VALUE.equals(exprType)) {
-      try {
-        valueExpression = expressionFactory.createValueExpression(elContext, expressionText, Object.class);
-        
-      // if the expr is not a valid value expr...
-      } catch (ELException e) {
-        // ... and the expr-type was not specified 
-        if (exprType==null) {
-          // then try to parse it as a method expression
-          exprType = TYPE_METHOD;
-        }
+      // by default, expr is interpreted as a value expression
+      if (language==null || LANGUAGE_UEL_VALUE.equals(language)) {
+        try {
+          ValueExpression valueExpression = expressionFactory.createValueExpression(elContext, expressionText, Object.class);
+          
+          return new UelValueExpression(valueExpression);
+          
+        // if the expr is not a valid value expr...
+        } catch (ELException e) {
+          // ... and the expr-type was not specified 
+          if (language==null) {
+            // then try to parse it as a method expression
+            language = LANGUAGE_UEL_METHOD;
+          }
+        } 
       } 
-    } 
 
-    if (TYPE_METHOD.equals(exprType)) {
-      methodExpression = expressionFactory.createMethodExpression(elContext, expressionText, null, new Class<?>[]{});
-    }
+      if (LANGUAGE_UEL_METHOD.equals(language)) {
+        MethodExpression methodExpression = expressionFactory.createMethodExpression(elContext, expressionText, null, new Class<?>[]{});
+        return new UelMethodExpression(methodExpression);
+      }
+
+    } 
+    return new ScriptExpression(expressionText, language);
   }
 
-  protected synchronized void initExpressionObjects() {
+  protected static synchronized void initExpressionObjects() {
     if (elContext==null) {
       JbpmElFactory jbpmElFactory = JbpmElFactory.getJbpmElFactory();
       expressionFactory = jbpmElFactory.createExpressionFactory();
@@ -92,49 +99,23 @@
   // runtime evaluation ///////////////////////////////////////////////////////
   
   public Object evaluate(Execution execution) {
-    return evaluate((ScopeInstanceImpl)execution);
+    return evaluateInScope((ScopeInstanceImpl)execution);
   }
 
   public Object evaluate(Task task) {
-    return evaluate((ScopeInstanceImpl)task);
+    return evaluateInScope((ScopeInstanceImpl)task);
   }
   
-  protected Object evaluate(ScopeInstanceImpl scopeInstance) {
-    ELContext elContext = getElContext(scopeInstance);
+  public abstract Object evaluateInScope(ScopeInstanceImpl scopeInstance);
 
-    Object result = null;
-    if (valueExpression!=null) {
-      result = valueExpression.getValue(elContext);
-      
-    } else if (methodExpression!=null) {
-      result = methodExpression.invoke((ELContext) elContext, null);
-    }
-
-    return result;
-  }
-
-  public void setValue(Task task, Object value) {
-    setValue((ScopeInstanceImpl)task, value);
-  }
-  
-  public void setValue(Execution execution, Object value) {
-    setValue((ScopeInstanceImpl)execution, value);
-  }
-  
-  public void setValue(ScopeInstanceImpl scopeInstance, Object value) {
-    if (valueExpression==null) {
-      throw new JbpmException("no value expression configured");
-    }
-    ELContext elContext = getElContext(scopeInstance);
-    valueExpression.setValue(elContext, value);
-  }
-
   protected ELContext getElContext(ScopeInstanceImpl scopeInstance) {
     ELContext elContext = (ELContext) (scopeInstance!=null ? scopeInstance.getElContext() : null);
     if (elContext==null) {
       JbpmElFactory contextFactory = JbpmElFactory.getJbpmElFactory();
       elContext = contextFactory.createElContext(scopeInstance);
-      scopeInstance.setElContext(elContext);
+      if (scopeInstance!=null) {
+        scopeInstance.setElContext(elContext);
+      }
     }
     return elContext;
   }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/JbpmElFactoryImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/JbpmElFactoryImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/JbpmElFactoryImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -119,10 +119,10 @@
   }
 
   protected void addBasicResolvers(CompositeELResolver compositeELResolver) {
-    compositeELResolver.add(new BeanELResolver());
     compositeELResolver.add(new MapELResolver());
     compositeELResolver.add(new ListELResolver());
     compositeELResolver.add(new ArrayELResolver());
+    compositeELResolver.add(new BeanELResolver());
   }
 
   protected FunctionMapper createFunctionMapper() {

Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/ScriptExpression.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/ScriptExpression.java	                        (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/ScriptExpression.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.el;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+import org.jbpm.pvm.internal.script.ScriptManager;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class ScriptExpression extends Expression {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected String expressionText;
+  protected String language;
+  
+  public ScriptExpression(String expressionText, String language) {
+    this.expressionText = expressionText;
+    this.language = language;
+  }
+
+  public Object evaluateInScope(ScopeInstanceImpl scopeInstance) {
+    ScriptManager scriptManager = ScriptManager.getScriptManager();
+    return scriptManager.evaluateExpression(expressionText, language);
+  }
+}


Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/ScriptExpression.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/StaticTextExpression.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/StaticTextExpression.java	                        (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/StaticTextExpression.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.el;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class StaticTextExpression extends Expression {
+
+  private static final long serialVersionUID = 1L;
+
+  String text;
+  
+  public StaticTextExpression(String text) {
+    this.text = text;
+  }
+
+  public Object evaluateInScope(ScopeInstanceImpl scopeInstance) {
+    return text;
+  }
+
+  public String getText() {
+    return text;
+  }
+}


Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/StaticTextExpression.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelMethodExpression.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelMethodExpression.java	                        (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelMethodExpression.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.el;
+
+import javax.el.ELContext;
+import javax.el.MethodExpression;
+
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UelMethodExpression extends Expression {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected MethodExpression methodExpression;
+
+  public UelMethodExpression(MethodExpression methodExpression) {
+    this.methodExpression = methodExpression;
+  }
+
+  public Object evaluateInScope(ScopeInstanceImpl scopeInstance) {
+    ELContext elContext = getElContext(scopeInstance);
+    return methodExpression.invoke((ELContext) elContext, null);
+  }
+}


Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelMethodExpression.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelValueExpression.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelValueExpression.java	                        (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelValueExpression.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.pvm.internal.el;
+
+import javax.el.ELContext;
+import javax.el.ValueExpression;
+
+import org.jbpm.api.Execution;
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.task.Task;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class UelValueExpression extends Expression {
+
+  private static final long serialVersionUID = 1L;
+  
+  protected ValueExpression valueExpression;
+
+  public UelValueExpression(ValueExpression valueExpression) {
+    this.valueExpression = valueExpression;
+    if (valueExpression==null) {
+      throw new JbpmException("no value expression configured");
+    }
+  }
+
+  public Object evaluateInScope(ScopeInstanceImpl scopeInstance) {
+    ELContext elContext = getElContext(scopeInstance);
+    return valueExpression.getValue(elContext);
+  }
+
+  public void setValue(Task task, Object value) {
+    setValue((ScopeInstanceImpl)task, value);
+  }
+  
+  public void setValue(Execution execution, Object value) {
+    setValue((ScopeInstanceImpl)execution, value);
+  }
+  
+  public void setValue(ScopeInstanceImpl scopeInstance, Object value) {
+    ELContext elContext = getElContext(scopeInstance);
+    valueExpression.setValue(elContext, value);
+  }
+
+}


Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/el/UelValueExpression.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ActivityImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -360,7 +360,7 @@
       return activityBehaviour;
     }
     if (activityBehaviourDescriptor!=null) {
-      ActivityBehaviour createdBehaviour = (ActivityBehaviour) ReflectUtil.instantiateUserCode(activityBehaviourDescriptor, processDefinition);
+      ActivityBehaviour createdBehaviour = (ActivityBehaviour) ReflectUtil.instantiateUserCode(activityBehaviourDescriptor, processDefinition, null);
       if (!isActivityBehaviourStateful) {
         activityBehaviour = createdBehaviour;
       }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventListenerReference.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventListenerReference.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/EventListenerReference.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -60,7 +60,7 @@
       return eventListener;
     }
     if (eventListenerDescriptor!=null) {
-      EventListener createdEventListener = (EventListener) ReflectUtil.instantiateUserCode(eventListenerDescriptor, processDefinition);
+      EventListener createdEventListener = (EventListener) ReflectUtil.instantiateUserCode(eventListenerDescriptor, processDefinition, null);
       if (!isEventListenerStateful) {
         eventListener = createdEventListener;
       }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -49,6 +49,7 @@
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.client.ClientProcessDefinition;
 import org.jbpm.pvm.internal.client.ClientProcessInstance;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.env.Context;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.env.ExecutionContext;
@@ -758,20 +759,18 @@
    * SwimlaneDefinitionImpl is base class for TaskDefinitionImpl.
    * Both Task and Swimlane implement Assignable. */
   public void initializeAssignments(AssignableDefinitionImpl assignableDefinition, Assignable assignable) {
-    String assigneeExpression = assignableDefinition.getAssigneeExpression();
+    Expression assigneeExpression = assignableDefinition.getAssigneeExpression();
     if (assigneeExpression!=null) {
-      String assignee = resolveAssignmentExpression(assigneeExpression, 
-                                                    assignableDefinition.getAssigneeExpressionLanguage());
+      String assignee = (String) assigneeExpression.evaluate(this);
       assignable.setAssignee(assignee);
       
       if (log.isTraceEnabled()) log.trace("task "+name+" assigned to "+assignee+" using expression "+assigneeExpression);
     }
     
-    String candidateUsersExpression = assignableDefinition.getCandidateUsersExpression();
+    Expression candidateUsersExpression = assignableDefinition.getCandidateUsersExpression();
     if (candidateUsersExpression!=null) {
-      String candidateUsers = 
-          resolveAssignmentExpression(candidateUsersExpression, 
-                                      assignableDefinition.getCandidateUsersExpressionLanguage());
+      String candidateUsers = (String) candidateUsersExpression.evaluate(this);
+
       StringTokenizer tokenizer = new StringTokenizer(candidateUsers, ",");
       while (tokenizer.hasMoreTokens()) {
         String candidateUser = tokenizer.nextToken().trim();
@@ -779,11 +778,9 @@
       }
     }
   
-    String candidateGroupsExpression = assignableDefinition.getCandidateGroupsExpression();
+    Expression candidateGroupsExpression = assignableDefinition.getCandidateGroupsExpression();
     if (candidateGroupsExpression!=null) {
-      String candidateGroups = 
-            resolveAssignmentExpression(candidateGroupsExpression, 
-                                        assignableDefinition.getCandidateGroupsExpressionLanguage());
+      String candidateGroups = (String) candidateGroupsExpression.evaluate(this);
       StringTokenizer tokenizer = new StringTokenizer(candidateGroups, ",");
       while (tokenizer.hasMoreTokens()) {
         String candidateGroup = tokenizer.nextToken();

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -49,10 +49,10 @@
 
   public Object getInitValue(ExecutionImpl execution) {
     if (initDescriptor!=null) {
-      return WireContext.create(initDescriptor);
+      return WireContext.create(initDescriptor, execution);
     }
     if (initExpression!=null) {
-      return initExpression.evaluate(execution);
+      return initExpression.evaluateInScope(execution);
     }
     return null;
   }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/ScriptManager.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -31,6 +31,7 @@
 import org.jbpm.api.JbpmException;
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.wire.WireContext;
 import org.jbpm.pvm.internal.wire.WireDefinition;
 import org.jbpm.pvm.internal.wire.xml.WireParser;
@@ -83,9 +84,6 @@
     return defaultScriptManager;
   }
 
-  /** {@link #evaluate(String, Execution, String) evaluates} the expression 
-   * with the given language or with the defaultExpressionLanguage if the 
-   * given language is null. */
   public Object evaluateExpression(String expression, String language) {
     return evaluate(expression, (language!=null ? language : defaultExpressionLanguage));
   }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/AssignableDefinitionImpl.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -21,6 +21,7 @@
  */
 package org.jbpm.pvm.internal.task;
 
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.model.ProcessElementImpl;
 import org.jbpm.pvm.internal.util.EqualsUtil;
 import org.jbpm.pvm.internal.wire.usercode.UserCodeReference;
@@ -33,14 +34,11 @@
   private static final long serialVersionUID = 1L;
 
   protected String name;
-  protected String description;
+  protected Expression description;
 
-  protected String assigneeExpression;
-  protected String assigneeExpressionLanguage;
-  protected String candidateUsersExpression;
-  protected String candidateUsersExpressionLanguage;
-  protected String candidateGroupsExpression;
-  protected String candidateGroupsExpressionLanguage;
+  protected Expression assigneeExpression;
+  protected Expression candidateUsersExpression;
+  protected Expression candidateGroupsExpression;
   protected UserCodeReference assignmentHandlerReference;
 
   // equals ///////////////////////////////////////////////////////////////////
@@ -52,7 +50,7 @@
 
   // getters and setters //////////////////////////////////////////////////////
 
-  public String getAssigneeExpression() {
+  public Expression getAssigneeExpression() {
     return assigneeExpression;
   }
   public String getName() {
@@ -61,13 +59,13 @@
   public void setName(String name) {
     this.name = name;
   }
-  public String getDescription() {
+  public Expression getDescription() {
     return description;
   }
-  public void setDescription(String description) {
+  public void setDescription(Expression description) {
     this.description = description;
   }
-  public void setAssigneeExpression(String assigneeExpression) {
+  public void setAssigneeExpression(Expression assigneeExpression) {
     this.assigneeExpression = assigneeExpression;
   }
   public UserCodeReference getAssignmentHandlerReference() {
@@ -76,35 +74,16 @@
   public void setAssignmentHandlerReference(UserCodeReference assignmentHandlerReference) {
     this.assignmentHandlerReference = assignmentHandlerReference;
   }
-  public String getAssigneeExpressionLanguage() {
-    return assigneeExpressionLanguage;
-  }
-  public void setAssigneeExpressionLanguage(String assigneeExpressionLanguage) {
-    this.assigneeExpressionLanguage = assigneeExpressionLanguage;
-  }
-  public String getCandidateUsersExpression() {
+  public Expression getCandidateUsersExpression() {
     return candidateUsersExpression;
   }
-  public void setCandidateUsersExpression(String candidateUsersExpression) {
+  public void setCandidateUsersExpression(Expression candidateUsersExpression) {
     this.candidateUsersExpression = candidateUsersExpression;
   }
-  public String getCandidateUsersExpressionLanguage() {
-    return candidateUsersExpressionLanguage;
-  }
-  public void setCandidateUsersExpressionLanguage(String candidateUsersExpressionLanguage) {
-    this.candidateUsersExpressionLanguage = candidateUsersExpressionLanguage;
-  }
-  public String getCandidateGroupsExpression() {
+  public Expression getCandidateGroupsExpression() {
     return candidateGroupsExpression;
   }
-  public void setCandidateGroupsExpression(String candidateGroupsExpression) {
+  public void setCandidateGroupsExpression(Expression candidateGroupsExpression) {
     this.candidateGroupsExpression = candidateGroupsExpression;
   }
-  public String getCandidateGroupsExpressionLanguage() {
-    return candidateGroupsExpressionLanguage;
-  }
-  public void setCandidateGroupsExpressionLanguage(String candidateGroupsExpressionLanguage) {
-    this.candidateGroupsExpressionLanguage = candidateGroupsExpressionLanguage;
-  }
-
 }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -11,6 +11,7 @@
 import org.jbpm.internal.log.Log;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.repository.DeploymentClassLoader;
 import org.jbpm.pvm.internal.repository.RepositoryCache;
 import org.jbpm.pvm.internal.wire.Descriptor;
@@ -304,10 +305,10 @@
     }
   }
   
-  public static Object instantiateUserCode(Descriptor descriptor, ProcessDefinitionImpl processDefinition) {
+  public static Object instantiateUserCode(Descriptor descriptor, ProcessDefinitionImpl processDefinition, ScopeInstanceImpl scopeInstance) {
     ClassLoader classLoader = ReflectUtil.installDeploymentClassLoader(processDefinition);
     try {
-      return WireContext.create(descriptor);
+      return WireContext.create(descriptor, scopeInstance);
     } finally {
       ReflectUtil.uninstallDeploymentClassLoader(classLoader);
     }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -34,6 +34,7 @@
 import org.jbpm.pvm.internal.env.Context;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
 import org.jbpm.pvm.internal.model.ProcessElementImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.processengine.ProcessEngineImpl;
 import org.jbpm.pvm.internal.util.Closable;
 import org.jbpm.pvm.internal.util.DefaultObservable;
@@ -218,6 +219,10 @@
   /** exceptions throw by descriptor invocations */
   Map<String, Exception> exceptions = null;
 
+  /** scopeInstance is optional (can be null) and point to an execution or a task. 
+   * In case a descriptor tries to resolve a name that is not found in this context, 
+   * the search is continued in the execution or task  */
+  ScopeInstanceImpl scopeInstance = null;
 
   public WireContext() {
   }
@@ -251,7 +256,13 @@
       create();
     }
   }
-  
+
+  public static Object create(Descriptor descriptor, ScopeInstanceImpl scopeInstance) {
+    WireContext wireContext = new WireContext();
+    wireContext.setScopeInstance(scopeInstance);
+    return wireContext.create(descriptor, false);
+  }
+
   /** convenience method that wires the object for a given descriptor. */
   public static Object create(Descriptor descriptor) {
     WireContext wireContext = new WireContext();
@@ -417,6 +428,13 @@
       return create(objectName, isDelayable);
     }
     
+    // if the objectName is found in the execution or task
+    if (scopeInstance!=null) {
+      if (scopeInstance.hasVariable(objectName)) {
+        return scopeInstance.getVariable(objectName);
+      }
+    }
+    
     // then check if we can find it in the environment (if one is available)
     EnvironmentImpl environment = EnvironmentImpl.getCurrent();
     if (environment!=null) {
@@ -717,4 +735,10 @@
   public void setWireDefinition(WireDefinition wireDefinition) {
     this.wireDefinition = wireDefinition;
   }
+  public ScopeInstanceImpl getScopeInstance() {
+    return scopeInstance;
+  }
+  public void setScopeInstance(ScopeInstanceImpl scopeInstance) {
+    this.scopeInstance = scopeInstance;
+  }
 }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/ObjectBinding.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -26,6 +26,7 @@
 import java.util.List;
 import java.util.Set;
 
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.util.XmlUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
@@ -107,9 +108,8 @@
       descriptor.setFactoryDescriptor(factoryDescriptor);
 
     } else if (expr!=null) {
-      descriptor.setExpr(expr);
-      String lang = XmlUtil.attribute(element, "lang");
-      descriptor.setLang(lang);
+      String exprType = XmlUtil.attribute(element, "expr-type");
+      descriptor.setExpression(Expression.create(expr, exprType));
       
     } else {
       parse.addProblem("element 'object' must have one of {attribute 'class', attribute 'expr', attribute 'factory' or element 'factory'}: "+XmlUtil.toString(element), element);

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -10,8 +10,8 @@
 
 import org.jbpm.api.JbpmException;
 import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.el.Expression;
 import org.jbpm.pvm.internal.env.EnvironmentImpl;
-import org.jbpm.pvm.internal.script.ScriptManager;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
 import org.jbpm.pvm.internal.wire.JbpmClassNotFoundException;
@@ -96,10 +96,8 @@
    * */
   String factoryObjectName = null;
 
-  protected String expr;
+  protected Expression expression;
   
-  protected String lang;
-  
   /** specifies the object on which to invoke the method.
    * Either className, objectName or a descriptor has to be specified. */
   protected Descriptor factoryDescriptor = null;
@@ -175,9 +173,8 @@
       if (object==null) {
         throw new WireException("created factory object is null, can't invoke method '"+methodName+"' on it");
       }
-    } else if (expr!=null) {
-      ScriptManager scriptManager = ScriptManager.getScriptManager();
-      object = scriptManager.evaluateExpression(expr, lang);
+    } else if (expression!=null) {
+      object = expression.evaluateInScope(wireContext.getScopeInstance());
     }
 
     if (methodName!=null) {
@@ -447,16 +444,10 @@
   public void setAutoWireEnabled(boolean isAutoWireEnabled) {
     this.isAutoWireEnabled = isAutoWireEnabled;
   }
-  public String getExpr() {
-    return expr;
+  public Expression getExpression() {
+    return expression;
   }
-  public void setExpr(String expr) {
-    this.expr = expr;
+  public void setExpression(Expression expr) {
+    this.expression = expr;
   }
-  public String getLang() {
-    return lang;
-  }
-  public void setLang(String lang) {
-    this.lang = lang;
-  }
 }

Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/usercode/UserCodeReference.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/usercode/UserCodeReference.java	2010-01-29 12:00:59 UTC (rev 6148)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/usercode/UserCodeReference.java	2010-01-29 15:52:11 UTC (rev 6149)
@@ -27,6 +27,7 @@
 import org.jbpm.pvm.internal.model.ActivityImpl;
 import org.jbpm.pvm.internal.model.ExecutionImpl;
 import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
+import org.jbpm.pvm.internal.model.ScopeInstanceImpl;
 import org.jbpm.pvm.internal.model.TransitionImpl;
 import org.jbpm.pvm.internal.util.ReflectUtil;
 import org.jbpm.pvm.internal.wire.Descriptor;
@@ -60,7 +61,7 @@
         processDefinition = getProcessDefinition(execution);
       }
 
-      Object usedObject = ReflectUtil.instantiateUserCode(descriptor, processDefinition);
+      Object usedObject = ReflectUtil.instantiateUserCode(descriptor, processDefinition, (ScopeInstanceImpl) execution);
       if (isCached) {
         cachedObject = usedObject;
       }



More information about the jbpm-commits mailing list