IDEMPIERE-3477 Allow use of variables in workflow next condition / thanks to Ricardo Santana (ralexsander)

This commit is contained in:
Carlos Ruiz 2017-09-08 15:13:52 +02:00
parent 01124f8ee4
commit 14faeeec5c
1 changed files with 14 additions and 8 deletions

View File

@ -22,6 +22,7 @@ import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.PO; import org.compiere.model.PO;
import org.compiere.util.Env;
import org.compiere.model.X_AD_WF_NextCondition; import org.compiere.model.X_AD_WF_NextCondition;
/** /**
@ -130,15 +131,20 @@ public class MWFNextCondition extends X_AD_WF_NextCondition
{ {
String sRet = sValue; String sRet = sValue;
if(sValue != null && sValue.startsWith("@")) if (sValue == null)
{ ;
if(sValue.startsWith("@COL=")) else if (sValue.startsWith("@COL="))
{ {
Object o = po.get_Value(sValue.substring(5)); Object o = po.get_Value(sValue.substring(5));
//
if(o != null) if(o != null)
sRet = o.toString(); sRet = o.toString();
} }
else if (sValue.startsWith("@")
&& sValue.endsWith("@")
&& sValue.length() > 1)
{
sRet = Env.parseVariable (sValue, po, null, false);
} }
return sRet; return sRet;