/// <summary>
 /// Main entry method of the workflow action.
 /// </summary>
 /// <param name="args">
 /// The workflow action arguments.
 /// </param>
 public void Process(WorkflowPipelineArgs args)
 {
     Assert.ArgumentNotNull(args, "args");
      var ruleContextArgs = new WorkflowRuleContext() { Arguments = args };
      var pipelineArgs = new WorkflowActionRuleContextArgs(ruleContextArgs);
      CorePipeline.Run("runWorkflowActionRules", pipelineArgs);
 }
 /// <summary>
 /// Runs pipeline processor code.
 /// </summary>
 /// <param name="context">Pipeline arguments.</param>
 public override void Process(WorkflowActionRuleContextArgs context)
 {
     Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
      if (context.Rules != null && context.Rules.Count > 0)
      {
     var ruleContext = new WorkflowRuleContext()
     {
        Item = context.DataItem,
        Arguments = context.RuleContext.Arguments
     };
     try
     {
        context.Rules.Run(ruleContext);
     }
     catch (Exception ex)
     {
        context.Failed = true;
        Log.Error("DynamicWorkflow::Rule execution failed.", ex, this);
     }
     finally
     {
        if (context.Failed)
        {
           context.ErrorMessage = Settings.ErrorMessage;
        }
     }
      }
 }
        /// <summary>
        /// Instantiates an object of WorkflowActionRuleContextArgs type.
        /// </summary>
        /// <param name="context">WorkflowRuleContext object</param>
        public WorkflowActionRuleContextArgs(WorkflowRuleContext context)
        {
            Assert.ArgumentNotNull(context, "workflowRuleContext");
             this.RuleContext = context;

             Assert.IsNotNull(context.Arguments, "context.Arguments");
             this.ActionItem = context.Arguments.ProcessorItem;
             this.DataItem = context.Arguments.DataItem;
             this.Failed = false;
        }