Custom Pipeline Component
Hi All,
I need some help on Pipelines for the following scenario. We are using CS2002
When the user's order is packed for shipping some times due to difference in the inventory a part of an order cannot be fulfilled. In such cases we wanted to ship only the part of an order that is available. To do that I am building an application that will accept the ordernuber. Based on the order number it will find the orderguid and user guid and uses the getPurchaseOrder method to load the order.
To determine the discounts that were valid when the order was created ,I created a custom pipeline component. I modified the default query which is used to load the discounts and modified it to use the order_create date as a filterfor the begin and the end date. I then execute this query and load the results of the query to a contentlistFactory object. I then created a contentlist object using theCreateNewContentList() method . Then I assign this contentlist object as the value for the OrderDictionary’s “ _discounts” key.
string sqlQuery = "exec GetDisountsForADatePeriod '2006/03/01'";
//Retrieve the discounts from the database
ADORs.Open(sqlQuery, connString, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);
//Load the ContentFactory object
contentFactory.ConstructFromRecordset(ADORs,null,null);
//Create a new contentlist object
contentList = contentFactory.CreateNewContentList();
Order["_discounts"] = contentList;
Then I created a custom CSF pipeline and I added mycustom pipeline component immediately after the InitCSFPipeline in the load context stage.
In the code I call this pipeline using Basket Object’s RunPipeline method. When I execute the pipeline I get a null reference exception when it hits the following line
PipelineInfo pipeInfo = NewPipelineInfo("ShipShortDiscountPipeline");
Basket.RunPipeline(pipeInfo);
My question is:
Why am I getting a null reference exception?
How should I execute the CSF Pipeline?
I am stuck with this for three days. Any help would be appreciated.
Hema

