コード例 #1
0
        public static Workflow AddUpdateEntityExpressionToInputArgument(this Workflow wf, WfActivity activity, string argumentName, EntityRef entityRef)
        {
            var destination = activity.GetInputArgument(argumentName);

            if (destination == null)
            {
                throw new ArgumentException();
            }

            return(AddUpdateEntityExpression(wf, activity, destination, entityRef));
        }
コード例 #2
0
        public static Workflow AddUpdateExpressionToArgument(this Workflow wf, WfActivity activity, string argumentName, string expressionString, bool isTemplate = false)
        {
            var destination = activity.GetInputArgument(argumentName);

            if (destination == null)
            {
                throw new ArgumentException();
            }

            return(AddUpdateExpressionToArgument(wf, activity, destination, expressionString, isTemplate));
        }
コード例 #3
0
        public static Workflow AddExpressionToActivityArgument(this Workflow wf, WfActivity activity, string argumentName, string expressionString, bool isTemplate = false)
        {
            var destination = activity.GetInputArgument(argumentName);

            if (destination == null)
            {
                throw new ArgumentException(String.Format("No matching argument name for activity. Activity='{0}' Argument='{1}'", activity.Name ?? "<unnamed>", argumentName ?? "<unnamed>"));
            }

            return(AddExpressionToArgument(wf, activity, destination, expressionString, isTemplate));
        }
コード例 #4
0
        public static void SetActivityArgumentToResource(Workflow wf, WfActivity activity, string argumentName, Resource resource)
        {
            var arg = activity.GetInputArgument(argumentName);

            if (arg == null)
            {
                throw new ArgumentException(String.Format("No matching argument name for activity. Activity='{0}' Argument='{1}'", activity.Name ?? "<unnamed>", argumentName ?? "<unnamed>"));
            }

            var exp = new WfExpression {
                ArgumentToPopulate = arg, ExpressionInActivity = activity, ExpressionString = null
            };

            exp.WfExpressionKnownEntities.Add(new NamedReference()
            {
                Name = "E1", ReferencedEntity = resource
            });
            activity.ExpressionMap.Add(exp);  // BUG: needed to work around an issue saving relationships
        }
コード例 #5
0
        public static void AddExpressionToMapArguments(Workflow wf, WfActivity fromActivity, WfActivity toActivity, string fromArgumentName, string toArgumentName)
        {
            ActivityArgument fromArgument;

            if (fromActivity.Is <Workflow>())
            {
                fromArgument = fromActivity.GetInputArgument(fromArgumentName);
            }
            else
            {
                fromArgument = fromActivity.GetOutputArgument(fromArgumentName);
            }

            if (fromArgument == null)
            {
                throw new ArgumentException(String.Format("Unable to find argument on the from Activity: [{0}].[{1}]", fromActivity.Name, fromArgumentName));
            }

            var subString = CreateArgumentInstance(wf, fromActivity, fromArgument);

            AddExpressionToActivityArgument(wf, toActivity, toArgumentName, String.Format("[{0}]", subString), false);
        }