Basic Pipeline Component Project Templates

Check out the attached pipeline component project templates (VB.NET and C#).  I've also included a C# unit test for a pipeline component.

I'm working on packaging other aspects of our pipeline development work to share.  Let me know what you're interested in by leaving a comment!

Comments Subscribe to Post Comments Feed

Max Akbar said:
Nice job Colin.
Peter said:

Hi

I have created custom pipeline,I want calculate tax flat $15  for order, i written the code below.

I have to put dll in GAC and working the pipeline fine.But its not written $15 always written $0.

Please help me on this.

using System;

using System.Collections.Generic;

using System.Text;

using System.Runtime.InteropServices;

using Microsoft.CommerceServer.Runtime;

using Microsoft.CommerceServer.Interop;

using Microsoft.CommerceServer.Interop.Orders;

using Microsoft.CommerceServer.Runtime.Orders;

namespace TaxCalculationPipeLine

{

  [ComVisible(true)]

  [GuidAttribute("2D99EC4E-1ACF-4720-B525-D7AD25174B54")]

   public class TaxCalculation : IPipelineComponent, IPipelineComponentDescription  

  {

      // Status codes for pipeline components

      private const Int32 StatusSuccess = 1; // success

      private const Int32 StatusWarning = 2; // warning

      private const Int32 StatusError = 3; // error

      #region IPipelineComponent Members

      void IPipelineComponent.EnableDesign(int fEnable) { }

      public int Execute(object pdispOrder, object pdispContext, int lFlags)

      {

          Int32 ReturnValue = StatusSuccess;

          IDictionary orderForm = (IDictionary)pdispOrder;

          IDictionary context = (IDictionary)pdispContext;

          // Accessing an IDictionary  

          orderForm["order._cy_tax_total"] = new CurrencyWrapper(15.00M);

          return ReturnValue;

      }

      #endregion

       public object ContextValuesRead()

       {

           List<object> ReturnValue = new List<object>();

           ReturnValue.Add("orderform.cy__tax_total");

           ReturnValue.TrimExcess();

           return (object[])ReturnValue.ToArray();

       }

      public object ValuesRead()

      {

          List<object> ReturnValue = new List<object>();

          ReturnValue.Add("orderform.cy__tax_total");

          ReturnValue.TrimExcess();

          return ReturnValue.ToArray();  

      }

      public System.Object ValuesWritten()

      {

          List<object> ReturnValue = new List<object>();

          ReturnValue.Add("orderform.cy__tax_total");

          ReturnValue.TrimExcess();

          return ReturnValue.ToArray();

      }

  }

}

Thanks and Regards,

Peter Balu.

Have Your Say