[jbpm-commits] JBoss JBPM SVN: r3651 - jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/el/impl.
do-not-reply at jboss.org
do-not-reply at jboss.org
Thu Jan 15 11:26:31 EST 2009
Author: thomas.diesler at jboss.com
Date: 2009-01-15 11:26:31 -0500 (Thu, 15 Jan 2009)
New Revision: 3651
Modified:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/el/impl/JbpmVariableResolver.java
Log:
[JBPM-1153] Cannot reproduce. JbpmVariableResolver - is not looking for the variable on the current token
Modified: jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/el/impl/JbpmVariableResolver.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/el/impl/JbpmVariableResolver.java 2009-01-15 16:20:07 UTC (rev 3650)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/jpdl/el/impl/JbpmVariableResolver.java 2009-01-15 16:26:31 UTC (rev 3651)
@@ -1,5 +1,6 @@
package org.jbpm.jpdl.el.impl;
+// $Id$
import org.jbpm.JbpmConfiguration;
import org.jbpm.context.exe.ContextInstance;
@@ -10,58 +11,71 @@
import org.jbpm.taskmgmt.exe.SwimlaneInstance;
import org.jbpm.taskmgmt.exe.TaskMgmtInstance;
-public class JbpmVariableResolver implements VariableResolver {
+public class JbpmVariableResolver implements VariableResolver
+{
- public Object resolveVariable(String name) throws ELException {
+ public Object resolveVariable(String name) throws ELException
+ {
ExecutionContext executionContext = ExecutionContext.currentExecutionContext();
Object value = null;
-
- if ("taskInstance".equals(name)) {
+
+ if ("taskInstance".equals(name))
+ {
value = executionContext.getTaskInstance();
- } else if ("processInstance".equals(name)) {
+ }
+ else if ("processInstance".equals(name))
+ {
value = executionContext.getProcessInstance();
- } else if ("processDefinition".equals(name)) {
+ }
+ else if ("processDefinition".equals(name))
+ {
value = executionContext.getProcessDefinition();
- } else if ("token".equals(name)) {
+ }
+ else if ("token".equals(name))
+ {
value = executionContext.getToken();
- } else if ("taskMgmtInstance".equals(name)) {
+ }
+ else if ("taskMgmtInstance".equals(name))
+ {
value = executionContext.getTaskMgmtInstance();
-
- } else if ("contextInstance".equals(name)) {
+
+ }
+ else if ("contextInstance".equals(name))
+ {
value = executionContext.getContextInstance();
- } else if ( (executionContext.getTaskInstance()!=null)
- && (executionContext.getTaskInstance().hasVariableLocally(name))
- ) {
+ }
+ else if ((executionContext.getTaskInstance() != null) && (executionContext.getTaskInstance().hasVariableLocally(name)))
+ {
value = executionContext.getTaskInstance().getVariable(name);
- } else {
+ }
+ else
+ {
ContextInstance contextInstance = executionContext.getContextInstance();
TaskMgmtInstance taskMgmtInstance = executionContext.getTaskMgmtInstance();
Token token = executionContext.getToken();
-
- if ( (contextInstance!=null)
- && (contextInstance.hasVariable(name, token))
- ) {
+
+ if ((contextInstance != null) && (contextInstance.hasVariable(name, token)))
+ {
value = contextInstance.getVariable(name, token);
-
- } else if ( (contextInstance!=null)
- && (contextInstance.hasTransientVariable(name))
- ) {
+ }
+ else if ((contextInstance != null) && (contextInstance.hasTransientVariable(name)))
+ {
value = contextInstance.getTransientVariable(name);
-
- } else if ( (taskMgmtInstance!=null)
- && (taskMgmtInstance.getSwimlaneInstances()!=null)
- && (taskMgmtInstance.getSwimlaneInstances().containsKey(name))
- ) {
+ }
+ else if ((taskMgmtInstance != null) && (taskMgmtInstance.getSwimlaneInstances() != null) && (taskMgmtInstance.getSwimlaneInstances().containsKey(name)))
+ {
SwimlaneInstance swimlaneInstance = taskMgmtInstance.getSwimlaneInstance(name);
- value = (swimlaneInstance!=null ? swimlaneInstance.getActorId() : null);
-
- } else if (JbpmConfiguration.Configs.hasObject(name)) {
+ value = (swimlaneInstance != null ? swimlaneInstance.getActorId() : null);
+
+ }
+ else if (JbpmConfiguration.Configs.hasObject(name))
+ {
value = JbpmConfiguration.Configs.getObject(name);
}
}
More information about the jbpm-commits
mailing list