public static async Task <ushort[]> ExecuteFormatBack(IFormattedValue userValue, RuleExecutionContext ruleExecutionContext, List <IRuleNode> ruleNodes) { ruleExecutionContext.SetVariable(VariableNames.INPUT_VALUE, userValue); foreach (var ruleNode in ruleNodes) { try { await ruleNode.ExecuteNode(ruleExecutionContext); } catch (Exception e) { } } return(ruleExecutionContext.GetVariable <List <ushort> >(VariableNames.DEVICE_VALUE).ToArray()); }
public static async Task <IFormattedValue> ExecuteFormat(ushort[] deviceValue, RuleExecutionContext ruleExecutionContext, List <IRuleNode> ruleNodes) { ruleExecutionContext.SetVariable(VariableNames.DEVICE_VALUE, deviceValue.ToList()); foreach (var ruleNode in ruleNodes) { try { await ruleNode.ExecuteNode(ruleExecutionContext); } catch (Exception e) { } } return(ruleExecutionContext.GetVariable <IFormattedValue>(VariableNames.RESULT_VALUE)); }