public int GetResultSizeInt32(DataRow input, DataTable dataTable) { if (this.resultSizeInt32 == -1 && !string.IsNullOrEmpty(this.ResultSize)) { int num = -1; if (DDIHelper.IsLambdaExpression(this.ResultSize)) { num = (int)ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(this.ResultSize), typeof(int), DDIHelper.GetLambdaExpressionDataRow(dataTable), input); } else { int.TryParse(this.ResultSize, out num); } this.resultSizeInt32 = num; } return(this.resultSizeInt32); }
public override RunResult Run(DataRow input, DataTable dataTable, DataObjectStore store, Type codeBehind, Workflow.UpdateTableDelegate updateTableDelegate) { RunResult result = new RunResult(); string text = this.Value as string; if (DDIHelper.IsLambdaExpression(text)) { dataTable.Rows[0][this.Variable] = ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(text), typeof(object), DDIHelper.GetLambdaExpressionDataRow(dataTable), input); } else { dataTable.Rows[0][this.Variable] = this.Value; } return(result); }
protected override bool CalculateCondition(DataRow input, DataTable dataTable) { return((bool)ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(this.Condition), typeof(bool), DDIHelper.GetLambdaExpressionDataRow(dataTable), input)); }
internal static void SetDefaultValues(DataRow input, DataRow row, DataTable dataTable, Collection <Set> defaultValues) { if (defaultValues != null) { foreach (Set set in defaultValues) { object obj = set.Value; string text = obj as string; if (DDIHelper.IsLambdaExpression(text)) { obj = ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(text), typeof(object), DDIHelper.GetLambdaExpressionDataRow(dataTable), input); } else { VariableReference variableReference = obj as VariableReference; if (variableReference != null) { obj = DDIHelper.GetVariableValue(variableReference, input, dataTable); } } row[set.Variable] = obj; } } }
public static object ConvertToParameterValue(DataRow input, DataTable dataTable, Parameter paramInfo, DataObjectStore store) { string variableName = paramInfo.Reference ?? paramInfo.Name; object obj; if (paramInfo.Value == null) { obj = DDIHelper.GetVariableValue(store.ModifiedColumns, variableName, input, dataTable, store.IsGetListWorkflow); } else { string text = paramInfo.Value as string; if (DDIHelper.IsLambdaExpression(text)) { obj = ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(text), typeof(object), DDIHelper.GetLambdaExpressionDataRow(dataTable), input); } else { VariableReference variableReference = paramInfo.Value as VariableReference; if (variableReference != null) { obj = DDIHelper.GetVariableValue(variableReference, input, dataTable); } else { obj = paramInfo.Value; } } } if (obj == DBNull.Value) { return(null); } return(obj); }
public bool IsRunnable(DataRow input, DataTable dataTable) { DataObjectStore dataObjectStore = dataTable.ExtendedProperties["DataSourceStore"] as DataObjectStore; if (this.Type == ParameterType.RunOnModified) { if (this.Value != null) { VariableReference variableReference = this.Value as VariableReference; if (variableReference != null && !dataObjectStore.ModifiedColumns.Contains(variableReference.Variable)) { return(false); } string text = this.Value as string; if (DDIHelper.IsLambdaExpression(text)) { List <string> dependentColumns = ExpressionCalculator.BuildColumnExpression(text).DependentColumns; bool flag = false; foreach (string item in dependentColumns) { if (dataObjectStore != null && dataObjectStore.ModifiedColumns.Contains(item)) { flag = true; break; } } if (!flag) { return(false); } } } else if (!dataObjectStore.ModifiedColumns.Contains(this.Reference ?? this.Name)) { return(false); } } if (!string.IsNullOrEmpty(this.Condition)) { return((bool)ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(this.Condition), typeof(bool), DDIHelper.GetLambdaExpressionDataRow(dataTable), input)); } return(this.runnableTester == null || this.runnableTester.IsRunnable(input, dataTable)); }
protected override void Initialize(DataRow input, DataTable dataTable) { base.Initialize(input, dataTable); if (string.IsNullOrEmpty(this.MaxProgressBarEventsExpected) || !DDIHelper.IsLambdaExpression(this.MaxProgressBarEventsExpected)) { return; } MaximumCountProgressCalculator maximumCountProgressCalculator = base.ProgressCalculatorInstance as MaximumCountProgressCalculator; if (maximumCountProgressCalculator != null) { maximumCountProgressCalculator.ProgressRecord.MaxCount = (int)ExpressionCalculator.CalculateLambdaExpression(ExpressionCalculator.BuildColumnExpression(this.MaxProgressBarEventsExpected), typeof(int), DDIHelper.GetLambdaExpressionDataRow(dataTable), input); return; } string message = string.Format("BulkCustomMaximumEventExpectedWorkflow should be used only with MaximumCountProgressCalculator. Current: {0}", (base.ProgressCalculatorInstance == null) ? "<null>" : base.ProgressCalculatorInstance.GetType().Name); throw new InvalidOperationException(message); }