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.

  • Girish Khadse 52 posts 132 karma points
    Mar 13, 2013 @ 07:56
    Girish Khadse
    0

    Error Creating custom pipeline - No component for key MyCustomPipeline was found

    Hi,

    I am new to ucommerce and umbraco, and was learning about pipelines. So I thought of creating my own custom pipeline. I created one class which is inheriting from Pipeline abstract class. Also added one class for custom task which is implementing IPipelineTask. Then I created config file under umbraco -> ucommerce-> pipelines folder for custom pipeline named "MyCustomPipeline.config". 

    But every time I try to create custom pipeline by :
     var pipeline = UCommerce.Pipelines.PipelineFactory.Create("MyCustomPipeline");

    I get an error  that "No component for key MyCustomPipeline was found".

    Following is the code for all the files:

    MyCustomPipeline.cs - custom pipeline class

     

    namespace MyLibrary

    {

        public class MyCustomPipeline:Pipeline

        {

            public MyCustomPipeline(IPipelineTask[] tasks) :base(tasks)

            {

                this.Tasks = tasks;

            }

            public PipelineExecutionResult Execute(PurchaseOrder subject)

            {

         // code to execute tasks

            }

        }

    }

     

    MyCustomTask.cs - custom task

     

    namespace MyLibrary

    {

        public class MyCustomTask : IPipelineTask

        {

            public PipelineExecutionResult Execute(PurchaseOrder subject)

            {

                // throw new NotImplementedException();

                return 0;

            }

        }

    }

     

    MyCustomPipeline.config which is in umbraco-> ucommerce-> pipelines folder
     
       
           <configuration>
      <components>
        <component id="MyCustomPipeline"
             service="UCommerce.Pipelines.IPipeline`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
             type="MyLibrary.MyCustomPipeline, MyLibrary">
            
        </component>
        <parameters>
          <tasks>
            <array>
              <value>${MyCustomPipeline.MyCustomTask}</value>
              
            </array>
            
          </tasks>
          
        </parameters>
        <component id="MyCustomPipeline.MyCustomTask"
         service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
         type="MyLibrary.MyCustomTask, MyLibrary" />
          
      </components>
      
    </configuration>
          
     
    I think I have missed or misunderstood some of the concepts of creating custom pipeline. Could someone please tell me how to get above code working?

     

  • Morten Skjoldager 440 posts 1499 karma points
    Mar 13, 2013 @ 08:24
    Morten Skjoldager
    0

    First thing that caught my attention was that you made a "MyCustomPipeline.config" Which fine. But did you register it in components.config ? (placed in \ucommerce\Configuration under the umbraco folder? 

  • Girish Khadse 52 posts 132 karma points
    Mar 13, 2013 @ 09:31
    Girish Khadse
    0

    Ahh.. I had added it. But again removed it as there were some runtime error was coming. But now I again have added it. And then cleaned the solution and tried to rebuild it. My application is not builting. And I can see that Ucommerce.dll, Castle.windsor.dll,Castle.core.dll, UCommerce.Infrastructure.dll, Iesi.collections and hibernate.dll is deleted. Have any idea why this has happened?

  • Girish Khadse 52 posts 132 karma points
    Mar 13, 2013 @ 09:41
    Girish Khadse
    0

    I again added the dlls deleted and now trying to built it but getting error "Unexpected node under 'component': Expected 'component' but found 'parameters' after adding MyCustomPipeline.config to component.config.

     

  • Morten Skjoldager 440 posts 1499 karma points
    Mar 13, 2013 @ 09:42
    Morten Skjoldager
    0

    Can you please paste the content of components.config

  • Girish Khadse 52 posts 132 karma points
    Mar 13, 2013 @ 09:48
    Girish Khadse
    0

    <!--
     Core configuration for uCommerce components.
    -->
    <configuration>
     <include uri="Shell.Umbraco4.config" />
     <include uri="Presenters.config" />
     <include uri="XmlRenderings.config" />
     <include uri="DataTypes.config" />
     <include uri="Marketing.config" />
     <include uri="Payments.config" />
     <include uri="Shipping.config" />
     <include uri="Core.config" />
     
     <!-- Pipelines -->
     <include uri="../pipelines/Basket.config" />
     <include uri="../pipelines/Checkout.config" />
     <include uri="../pipelines/Processing.config" />
     <include uri="../pipelines/ProductReview.config" />
     <include uri="../pipelines/ProductReviewComment.config" />
     <include uri="../pipelines/ProductReviewComment.config" />
     <include uri="../pipelines/SaveOrder.config" />
     <include uri="../pipelines/ToCancelled.config" />
     <include uri="../pipelines/ToCompletedOrder.config" />
     <include uri="../pipelines/SaveProduct.config" />
     <include uri="../pipelines/DeleteProduct.config" />
      <include uri="../pipelines/MyCustomPipeline.config" />
     
     <!-- Custom, put your overrides here -->
     <include uri="Custom.config"/>
     
    </configuration>

  • Morten Skjoldager 440 posts 1499 karma points
    Mar 13, 2013 @ 09:54
    Morten Skjoldager
    100

    it would appear that your parameters section are placed outside your pipeline component. Can you please review the config file again. You've configured components.config the right way.

    this: 

    <parameters>

          <tasks>
            <array>
              <value>${MyCustomPipeline.MyCustomTask}</value>
              
            </array>
            
          </tasks>
          
        </parameters>
    should be placed inside: 
     <component id="MyCustomPipeline"
             service="UCommerce.Pipelines.IPipeline`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
             type="MyLibrary.MyCustomPipeline, MyLibrary">
            
        </component>
  • Girish Khadse 52 posts 132 karma points
    Mar 13, 2013 @ 10:04
    Girish Khadse
    0

    Yes that was indeed the problem. My parameters tag was out my component tag. Bringing it in solved the problem.

     

Please Sign in or register to post replies

Write your reply to:

Draft