示例#1
0
        protected override async Task <MinionRunResultsModel> Execute()
        {
            MinionRunResultsModel runResults = new MinionRunResultsModel();
            /* Pull from an appropriate list and execute an appropriate pipeline. */

            /*Gets list of Items from ReleasedOrders and executes export order to file block*/
            long listCount = await this.GetListCount(this.Policy.ListToWatch).ConfigureAwait(false);

            this.Logger.LogInformation(string.Format("{0}-Review List {1}: Count:{2}", Name, Policy.ListToWatch, listCount));
            foreach (var commerceEnty in (await this.GetListItems <XC.Order>(Policy.ListToWatch, Convert.ToInt32(listCount)).ConfigureAwait(false)))
            {
                this.Logger.LogDebug(string.Format("{0}-Reviewing Pending Order: {1}", commerceEnty.Name, commerceEnty.Id), Array.Empty <object>());

                var minionPipeline       = ExportOrderPipeline;
                var ordersMinionArgument = new ExportOrderArgument(commerceEnty.Id);
                using (var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, null))
                {
                    commerceContext.Environment = this.Environment;
                    CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
                    var order = await minionPipeline.Run(ordersMinionArgument, executionContextOptions).ConfigureAwait(false);
                }
            }

            return(runResults);
        }
        protected override async Task <MinionRunResultsModel> Execute()
        {
            MinionRunResultsModel runResults = new MinionRunResultsModel();

            /* STUDENT: Complete the body of this method. You need to pull from an appropriate list
             * and then execute an appropriate pipeline. */
            long listCount = await GetListCount(Policy.ListToWatch).ConfigureAwait(false);

            this.Logger.LogInformation(string.Format("{0}-Review List {1}: Count:{2}", (object)this.Name, (object)this.Policy.ListToWatch, (object)listCount));
            // var  entitleMentList = await this.GetListIds<XC.Order>(this.Policy.ListToWatch, Convert.ToInt32(listCount)).ConfigureAwait(false);

            foreach (var commerceEnty in (await this.GetListItems <XC.Order>(Policy.ListToWatch, Convert.ToInt32(listCount)).ConfigureAwait(false)))
            {
                this.Logger.LogDebug(string.Format("{0}-Reviewing Pending Order: {1}", commerceEnty.Name, commerceEnty.Id), Array.Empty <object>());

                var minionPipeline       = ExportOrderPipeline;
                var ordersMinionArgument = new ExportOrderArgument(commerceEnty.Id);
                using (var commerceContext = new CommerceContext(this.Logger, this.MinionContext.TelemetryClient, (IGetLocalizableMessagePipeline)null))
                {
                    commerceContext.Environment = this.Environment;
                    CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);
                    var order = await minionPipeline.Run(ordersMinionArgument, executionContextOptions).ConfigureAwait(false);
                }
            }

            return(runResults);
        }
        protected override async Task <MinionRunResultsModel> Execute()
        {
            MinionRunResultsModel runResults = new MinionRunResultsModel();
            /*Gets all the ReleasedOrders and executes export order*/
            long listCount = await GetListCount(Policy.ListToWatch).ConfigureAwait(false);

            this.Logger.LogInformation(string.Format(CultureInfo.InvariantCulture, "{0}-Review List {1}: Count:{2}", Name, Policy.ListsToWatch, listCount));
            foreach (var listItems in (await GetListItems <XC.Order>(Policy.ListToWatch, Convert.ToInt32(listCount)).ConfigureAwait(false)))
            {
                this.Logger.LogDebug(string.Format(CultureInfo.InvariantCulture, "{0}-Reviewing Pending Order: {1}", listItems.Name, listItems.Id), Array.Empty <object>());

                var minionPipeline       = ExportOrderPipeline;
                var ordersMinionArgument = new ExportOrderArgument(listItems.Id);
                using (var commerceContext = new CommerceContext(Logger, MinionContext.TelemetryClient, null))
                {
                    commerceContext.Environment = this.Environment;

                    CommercePipelineExecutionContextOptions executionContextOptions = new CommercePipelineExecutionContextOptions(commerceContext, null, null, null, null, null);

                    var order = await minionPipeline.Run(ordersMinionArgument, executionContextOptions).ConfigureAwait(false);
                }
            }

            return(runResults);
        }