I've created a custom OrderStatus in the uCommerce_OrderStatus table, and added a new Pipeline 'ToOrderRequiresReview' to it. In the Custom.config I've then added a reference to this Pipeline and also a custom task that would simply send an email to an administrator like this:
<!-- Pipeline Instance that is called when an order is set to needing a review-->
<component id="ToOrderRequiresReview"
service="UCommerce.Pipelines.IPipeline`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
type="UCommerce.Pipelines.OrderProcessing.OrderProcessingPipeline, UCommerce.Pipelines">
<parameters>
<tasks>
<array>
<!--Send email to the admin-->
<value>${ToOrderRequiresReview.OrderRequiresReview}</value>
</array>
</tasks>
</parameters>
</component>
<component
id="ToOrderRequiresReview.OrderRequiresReview"
service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
type="Custom.Services.PipelineTasks.OrderRequiresReviewTask, Custom.Services" />
Using the uCommerce interface when changing the order status this is triggering the Pipeline correctly, however I also want to trigger this Pipeline from my code. I've tried the below code where I'm setting the order status and saving the basket but my pipeline task never executes:
var basket = TransactionLibrary.GetBasket();
basket.PurchaseOrder.OrderStatus =
OrderStatus.FirstOrDefault(
x => x.OrderStatusId == 1000003);
basket.Save();
//I've tried with and without this line of code
TransactionLibrary.ExecuteBasketPipeline();
Is there something I'm missing here to force this pipeline to trigger?
uCommerce Custom pipeline not executing
I've created a custom OrderStatus in the uCommerce_OrderStatus table, and added a new Pipeline 'ToOrderRequiresReview' to it. In the Custom.config I've then added a reference to this Pipeline and also a custom task that would simply send an email to an administrator like this:
Using the uCommerce interface when changing the order status this is triggering the Pipeline correctly, however I also want to trigger this Pipeline from my code. I've tried the below code where I'm setting the order status and saving the basket but my pipeline task never executes:
Is there something I'm missing here to force this pipeline to trigger?
Hi Chris,
ExecuteBasketPipeline will only trigger BasketPipeline and not any custom pipelines.
You should be able to trigger custom pipelines by using PipelineFactory
I have not tested the code but I'm confident it will work.
Best regards Martin
Perfect, works exactly as expected
is working on a reply...