Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Baz 9 posts 50 karma points
    Apr 22, 2013 @ 13:38
    Baz
    0

    Trouble creating new Pipeline Task

    Hi,

     

    I have created a new Basket Pipeline Task called CalculateOrderLineTotalsByWeeks

     

    ${Basket.CalculateOrderLinesTotals}       

     

     

               service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"

               type="MyProject.Services.CalculateOrderLineTotalsByWeeks, MyProject.Services" />

     

     

     

    My CalculateOrderLineTotalsByWeeks looks like this so far:

     

    using System;

    using UCommerce;

    using UCommerce.Catalog;

    using UCommerce.EntitiesV2;

    namespace MyProject.Services

    {

        public class CalculateOrderLineTotalsByWeeks : IPipelineTask

        {

            public PipelineExecutionResult Execute(PurchaseOrder order)

            {

     

                foreach(Orderline line in order.OrderLines)

                {

     

                }

                return PipelineExecutionResult.Success;

            }

        }

    }

     

     

    At the moment it is saying nothing is happening at all.  'IPipelineTask' is not highlighted in Visual Studio and the parameters for Execute aren't highlighted either.

     

    Can anyone shed some light on this please?

     

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Apr 22, 2013 @ 13:44
    Nickolaj Lundgreen
    0

    You are missing:

    using UCommerce.Pipelines;

    If you do this correctly - you can use the implement interface function in visual studio, and it will create the method.

     

    Im not sure if its a copy paste error, but:

               <service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"

               type="MyProject.Services.CalculateOrderLineTotalsByWeeks, MyProject.Services" />

     

  • Baz 9 posts 50 karma points
    Apr 22, 2013 @ 13:56
    Baz
    0

    Hi,

     

    Thanks for replying.

     

    After posting I added using UCommerce.Pipelines; but still nothing.

     

    I then ran the project and it's now saying "Could not convert from 'MyProject.Services.CalculateOrderLineTotalsByWeeks, MyProject.Services' to System.Type - Maybe type could not be found"

    Also found this StackTrace

     at Castle.MicroKernel.SubSystems.Conversion.TypeNameConverter.PerformConversion(String value, Type targetType)

       at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion(String value, Type targetType)

       at Castle.MicroKernel.SubSystems.Conversion.DefaultConversionManager.PerformConversion[TTarget](String value)

       at Castle.Windsor.Installer.DefaultComponentInstaller.SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)

       at Castle.Windsor.Installer.DefaultComponentInstaller.SetUp(IWindsorContainer container, IConfigurationStore store)

       at Castle.Windsor.WindsorContainer.RunInstaller()

       at UCommerce.Infrastructure.ExtendedWindsorContainer..ctor(String xmlFilePath)

       at UCommerce.Infrastructure.ObjectFactory.GetContainer()

       at UCommerce.Infrastructure.ObjectFactory.get_Container()

       at UCommerce.Infrastructure.ObjectFactory.Resolve[T]()

       at UCommerce.Runtime.SiteContext.get_Current()

       at ASP._Page_macroScripts_uCommerce_Catalog_cshtml.Execute() in c:\Websites\MyProject\MyProject\macroScripts\uCommerce\Catalog.cshtml:line 6

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()

       at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)

       at System.Web.WebPages.WebPage.ExecutePageHierarchy()

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)

       at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer)

       at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)

       at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)

     

    For claritys sake that wasn't a typo.  Here is the full line again:

       

               service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"

               type="MyProject.Services.CalculateOrderLineTotalsByWeeks, MyProject" />

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Apr 22, 2013 @ 14:05
    Nickolaj Lundgreen
    0

    Have you added  UCommerce.dll as a reference in the project?

    I spotted another error:

    You need to implement:  IPipelineTask<PurchaseOrder>

  • Baz 9 posts 50 karma points
    Apr 22, 2013 @ 14:16
    Baz
    0

    Hi,

     

    Yeah, that's what I was implementing.  Not sure why it didn't copy <PurchaseOrder> but I did try go back in and edit it.

     

    uCommerce.dll was in the /bin directory but wasn't added as a Referece.  I have now added uCommerce.dll as a Reference but still have the same problem.

     

    Thanks for your help on this.

     

     

  • Nickolaj Lundgreen 233 posts 1132 karma points
    Apr 22, 2013 @ 14:21
    Nickolaj Lundgreen
    0

    I have no idear how i missed this, but:

     <component id="Basket.CalculateOrderLinesTotals"
    service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
    type="MyProject.Services.CalculateOrderLineTotalsByWeeks, MyProject.Services" />

    I think you are missing the component keyword plus the id :)

     Where in the flow of task did you put your custom task?

    But i think im running out of idears for the visual studio issue :-/

  • Baz 9 posts 50 karma points
    Apr 22, 2013 @ 14:36
    Baz
    0

    Hi,

     

    I have the component keyword and the ID.  I'm not sure why it's skipping some bits out that I have pasted.

     

    I have Basket.CalculateOrderLineTotalsByWeeks running just after Basket.CalculateOrderLinesTotals

     

    <value>${Basket.CalculateOrderLinesTotals}</value>

     <!-- Calculate order totals based on weeks -->

    <value>$(Basket.CalculateOrderLineTotalsByWeeks</value>

     

    Strange that I don't have intellisense for this class.  Even when I extend the class I don't intellisense that lets me choose IPipelineTask<>

     

    Should there not be a MyProject.Services.dll being compiled and put in the bin directory?

    At the moment that is not happening so perhaps I have something wrong with my type attribute?

  • Baz 9 posts 50 karma points
    Apr 22, 2013 @ 16:40
    Baz
    0

    Hi again,

     

    I have moved the location of the type and it looks like it may be working now apart from a different error:

     

    Whenever it trys to do TransactionLibrary.AddToBasket(....)

     

    Any idea what this could mean?  If I take out the lines out of my Basket.config for CalculatingOrderLineTotalsByWeeks then I don't recieve this error, so I must be close!

    No converter registered to handle the type UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce, Version=3.0.5.13045, Culture=neutral, PublicKeyToken=null]]

Please Sign in or register to post replies

Write your reply to:

Draft