// ------------------------------------------ // ACCESSORS // ------------------------------------------ #region Accessors /// <summary> /// Clones this instance. /// </summary> public override object Clone(params string[] areas) { ScriptCondition condition = new ScriptCondition { Expression = Expression.Clone() as DataExpression }; return(condition); }
/// <summary> /// Evaluate this instance. /// </summary> /// <param name="condition">The condition to consider.</param> /// <param name="scriptInterpreter">Script interpreter.</param> /// <param name="scriptVariableSet">The script variable set used to evaluate.</param> /// <returns>True if the business script value is the true value.</returns> private static bool Evaluate( this ScriptCondition condition, IBdoScriptInterpreter scriptInterpreter, IScriptVariableSet scriptVariableSet) { if (condition == null) { return(false); } if (condition.Expression == null) { return(false); } var b = scriptInterpreter.Evaluate <bool?>(condition.Expression, scriptVariableSet); return(condition.TrueValue ? (b ?? false) : !(b ?? true)); }