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
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?
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?
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.
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.
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;
}
}
}
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?
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?
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.
Can you please paste the content of components.config
<!--
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>
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>
Yes that was indeed the problem. My parameters tag was out my component tag. Bringing it in solved the problem.
is working on a reply...