virtual public ICollection <WfExpression> GetInputArgumentsExpressions(IRunState runState, WfActivity activity) { var inputArgs = activity.GetInputArguments(); // Intentionally return an ICollection to ensure the expressions are loaded and evaluated in an elevated context var result = activity.ExpressionMap .Where(ex => inputArgs.Any(arg => ex.ArgumentToPopulate != null && arg.Id == ex.ArgumentToPopulate.Id)) .ToList(); return(result); }
public static ActivityArgument GetInputArgument(this WfActivity activity, string implementationName) { return(activity.GetInputArguments().FirstOrDefault(a => a.Name == implementationName)); // note that his code assumes the first type is an activity type }