Exemplo n.º 1
0
 /// <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>
 /// 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;
        }
     }
      }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Runs pipeline processor code.
 /// </summary>
 /// <param name="context">Pipeline arguments.</param>
 public override void Process(WorkflowActionRuleContextArgs context)
 {
     Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
     if (context.Failed)
     {
         SheerResponse.Alert(context.ErrorMessage, new string[0]);
     }
 }
 /// <summary>
 /// Runs pipeline processor code.
 /// </summary>
 /// <param name="context">Pipeline arguments.</param>
 public override void Process(WorkflowActionRuleContextArgs context)
 {
     Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
      if (context.Failed)
      {
     SheerResponse.Alert(context.ErrorMessage, new string[0]);
      }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Runs pipeline processor code.
        /// </summary>
        /// <param name="context"></param>
        public override void Process(WorkflowActionRuleContextArgs context)
        {
            Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
            Assert.IsNotNull(context.RuleContext, "workflowRuleContext");
            if (context.DataItem == null || context.ActionItem == null)
            {
                Log.SingleWarn("DynamicWorkflow::Pipeline was aborted. The dataItem={0}, processorItem={1}".FormatWith(new object[]
                {
                    context.DataItem == null ? "NULL" : context.DataItem.Uri.ToString(), context.ProcessorItem == null ? "NULL" : context.ProcessorItem.InnerItem.Uri.ToString()
                }), this);

                context.Failed       = true;
                context.ErrorMessage = Settings.ErrorMessage;
                context.AbortPipeline();
            }
        }
        /// <summary>
        /// Runs pipeline processor code.
        /// </summary>
        /// <param name="context"></param>
        public override void Process(WorkflowActionRuleContextArgs context)
        {
            Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
             Assert.IsNotNull(context.RuleContext, "workflowRuleContext");
             if (context.DataItem == null || context.ActionItem == null)
             {
            Log.SingleWarn("DynamicWorkflow::Pipeline was aborted. The dataItem={0}, processorItem={1}".FormatWith(new object[]
            {
               context.DataItem == null ? "NULL" : context.DataItem.Uri.ToString(), context.ProcessorItem == null ? "NULL" : context.ProcessorItem.InnerItem.Uri.ToString()
            }), this);

            context.Failed = true;
            context.ErrorMessage = Settings.ErrorMessage;
            context.AbortPipeline();
             }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Runs pipeline processor code.
 /// </summary>
 /// <param name="context">Pipeline arguments.</param>
 public override void Process(WorkflowActionRuleContextArgs context)
 {
     Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
     Assert.IsNotNull(context.RuleContext, "workflowRuleContext");
     context.Rules = this.BuildRuleList(context.RuleContext.Arguments.ProcessorItem);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Runs pipeline processor code.
 /// </summary>
 /// <param name="context">Pipeline arguments.</param>
 public override void Process(WorkflowActionRuleContextArgs context)
 {
     Assert.ArgumentNotNull(context, "workflowActionRuleContextArgs");
      Assert.IsNotNull(context.RuleContext, "workflowRuleContext");
      context.Rules = this.BuildRuleList(context.RuleContext.Arguments.ProcessorItem);
 }