From 14faeeec5c454c62dcb399199114183fbbaee5a8 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 8 Sep 2017 15:13:52 +0200 Subject: [PATCH] IDEMPIERE-3477 Allow use of variables in workflow next condition / thanks to Ricardo Santana (ralexsander) --- .../src/org/compiere/wf/MWFNextCondition.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java b/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java index 1204fc4f6b..c132f18231 100644 --- a/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java +++ b/org.adempiere.base/src/org/compiere/wf/MWFNextCondition.java @@ -22,6 +22,7 @@ import java.util.Properties; import java.util.logging.Level; import org.compiere.model.PO; +import org.compiere.util.Env; import org.compiere.model.X_AD_WF_NextCondition; /** @@ -130,15 +131,20 @@ public class MWFNextCondition extends X_AD_WF_NextCondition { String sRet = sValue; - if(sValue != null && sValue.startsWith("@")) + if (sValue == null) + ; + else if (sValue.startsWith("@COL=")) { - if(sValue.startsWith("@COL=")) - { - Object o = po.get_Value(sValue.substring(5)); - - if(o != null) - sRet = o.toString(); - } + Object o = po.get_Value(sValue.substring(5)); + // + if(o != null) + sRet = o.toString(); + } + else if (sValue.startsWith("@") + && sValue.endsWith("@") + && sValue.length() > 1) + { + sRet = Env.parseVariable (sValue, po, null, false); } return sRet;