Esempio n. 1
0
        public PipelineExecutionResult RunPipeline(OrderGroup og, bool transacted, bool loggingEnabled, String pipelineName, String pipelinePath)
        {
            PipelineBase            pipeline;
            PipelineExecutionResult res;
            PipelineInfo            pipeInfo = CreatePipelineInfo(pipelineName);

            // we attribute the pipeline's run with a log name and it needs to be the absolute path
            // also, it will overwrite the log if that file exists, so we add the orderform's name to provide some
            // sort of scheme that won't overwrite every log
            string pipelineLog = string.Format("{0}\\log\\{1}_{2}.log",
                                               pipelinePath.Substring(0, pipelinePath.LastIndexOf("\\")),
                                               og.OrderForms[0].ParentOrderGroup.Name,
                                               pipelineName);

            pipeline =
                new CommerceServer.Core.Runtime.Pipelines.OrderPipeline(name: pipelineName,
                                                                        pipelineConfigPath: pipelinePath,
                                                                        loggingEnabled: loggingEnabled,
                                                                        logPath: pipelineLog,
                                                                        transactional: transacted);
            res = og.RunPipeline(pipeInfo, pipeline);

            CheckPipelineResultAndPrintWarnings(og, res);

            //Calling dispose on PipelineInfo to release any unmanaged resources
            pipeInfo.Dispose();

            return(res);
        }
Esempio n. 2
0
        private void AddDataToPipelineInfo(ref PipelineInfo pipeInfo)
        {
            CacheManager   cacheManager = null;
            MessageManager msgManager   = null;

            //Need to add Payment Processor Pipeline collection
            PipelineBase creditCardPipelineProcessor = new CommerceServer.Core.Runtime.Pipelines.OrderPipeline("CreditCardProcessor", Constants.creditCardPaymentProcessortPcfFilePath, false, Constants.LogFilePath + "\\CreditCard.log", true);

            PipelineCollection pipeCollection = new PipelineCollection();

            pipeCollection.Add("CreditCardProcessor", creditCardPipelineProcessor);

            pipeInfo["pipelines"] = pipeCollection;

            try
            {
                //Create the Cachemanager object
                cacheManager = new CacheManager();

                //Create the Messagemanager object
                msgManager = new MessageManager();

                AddMessagesToMessageManager(msgManager, CultureInfo.CurrentUICulture.ToString(), 1033);
                AddMessagesToMessageManager(msgManager, "en-US", 1033);

                //Set the components in the dictionary
                ConfigureMarketingSystem(pipeInfo, cacheManager);
                ConfigureOrderSystem(pipeInfo, cacheManager);
                ConfigureCatalogSystem(pipeInfo);

                pipeInfo["MessageManager"]    = msgManager;
                pipeInfo["CommerceResources"] = resources;

                pipeInfo["cachemanager"] = cacheManager;

                //Need to explicitly specify the Discount cache name when running in non-ASP.Net environment
                pipeInfo.DiscountsCacheName = "Discounts";
            }
            finally
            {
                if (cacheManager != null)
                {
                    Marshal.ReleaseComObject(cacheManager);
                }
                if (msgManager != null)
                {
                    Marshal.ReleaseComObject(msgManager);
                }
            }
        }