当前位置: 首页>>代码示例>>C#>>正文


C# ActivityExecutionContext类代码示例

本文整理汇总了C#中ActivityExecutionContext的典型用法代码示例。如果您正苦于以下问题:C# ActivityExecutionContext类的具体用法?C# ActivityExecutionContext怎么用?C# ActivityExecutionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActivityExecutionContext类属于命名空间,在下文中一共展示了ActivityExecutionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Execute

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            string pageName = this.PageName;

            List<Page> userPages = DatabaseHelper.GetList<Page, Guid>(DatabaseHelper.SubsystemEnum.Page,
                this.UserGuid, LinqQueries.CompiledQuery_GetPagesByUserId);

            // Find the page that has the specified Page Name and make it as current
            // page. This is needed to make a tab as current tab when the tab name is
            // known
            if (!string.IsNullOrEmpty(pageName))
            {

                foreach (Page page in userPages)
                {
                    if (page.Title.Replace(' ', '_') == pageName)
                    {
                        this.CurrentPageId = page.ID;
                        this.CurrentPage = page;
                        break;
                    }
                }
            }

            // If there's no such page, then the first page user has will be the current
            // page. This happens when a page is deleted.
            if (this.CurrentPageId == 0)
            {
                this.CurrentPageId = userPages[0].ID;
                this.CurrentPage = userPages[0];
            }

            return ActivityExecutionStatus.Closed;
        }
开发者ID:modulexcite,项目名称:dropthings,代码行数:34,代码来源:DecideCurrentPageActivity.cs

示例2: Execute

        /// <summary>
        /// Called by the workflow runtime to execute an activity.
        /// </summary>
        /// <param name="executionContext">The <see cref="T:Mediachase.Commerce.WorkflowCompatibility.ActivityExecutionContext"/> to associate with this <see cref="T:Mediachase.Commerce.WorkflowCompatibility.Activity"/> and execution.</param>
        /// <returns>
        /// The <see cref="T:Mediachase.Commerce.WorkflowCompatibility.ActivityExecutionStatus"/> of the run task, which determines whether the activity remains in the executing state, or transitions to the closed state.
        /// </returns>
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            try
            {
                // Check for multiple warehouses. In the default, we simply reject processing an order if the application has
                //  multiple warehouses. Any corresponding fulfillment process is the responsibility of the client.
                this.CheckMultiWarehouse();

                // Validate the properties at runtime
                this.ValidateRuntime();

                var orderForms = OrderGroup.OrderForms.Where(o => !OrderForm.IsReturnOrderForm(o));

                foreach (OrderForm orderForm in orderForms)
                {
                    foreach (Shipment shipment in orderForm.Shipments)
                    {
                        foreach (var lineItem in Shipment.GetShipmentLineItems(shipment))
                        {
                            AdjustStockItemQuantity(shipment, lineItem);
                        }
                    }
                }

                // Retun the closed status indicating that this activity is complete.
                return ActivityExecutionStatus.Closed;
            }
            catch
            {
                // An unhandled exception occured.  Throw it back to the WorkflowRuntime.
                throw;
            }
        }
开发者ID:valdisiljuconoks,项目名称:Ascend15,代码行数:40,代码来源:AdjustInstoreInventoryActivity.cs

示例3: DoExecute

        /// <summary>
        /// 执行根据DeliveryNo修改所有属于该DeliveryNo的Product状态的操作
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            Product currentProduct = ((Product)CurrentSession.GetValue(Session.SessionKeys.Product));
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            IDeliveryRepository deliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
            string unpackType = ((string)CurrentSession.GetValue(Session.SessionKeys.CN));
            bool isPallet = ((bool)CurrentSession.GetValue(Session.SessionKeys.Pallet));
            productRepository.BackUpProduct(currentProduct.ProId,this.Editor);

            ShipBoxDetInfo setValue = new ShipBoxDetInfo();
            ShipBoxDetInfo condition = new ShipBoxDetInfo();
            setValue.snoId = "";
            condition.snoId = currentProduct.ProId;

            deliveryRepository.UpdateShipBoxDetInfo(setValue, condition);

            if (unpackType == "ALL")
            {
                currentProduct.PizzaID = string.Empty;
                currentProduct.CartonSN = string.Empty;
            }
            currentProduct.PalletNo = string.Empty;
            if (!isPallet)
            {
                currentProduct.DeliveryNo = string.Empty;
            }
            currentProduct.CartonWeight = 0;
            currentProduct.UnitWeight = 0;

            productRepository.Update(currentProduct, CurrentSession.UnitOfWork);

            productRepository.BackUpProductStatus(currentProduct.ProId, this.Editor);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:40,代码来源:UnPackProductByDN.cs

示例4: DoExecute

        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var logger = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            //logger.InfoFormat("GetProductActivity: Key: {0}", this.Key);
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            //var currentProduct = productRepository.Find(this.Key);
            //var currentProductCustSN = productRepository.FindOneProductWithProductIDOrCustSN(this.Key);
            var product = productRepository.GetProductByCustomSn(this.Key);

            if (product == null)
            {
                List<string> errpara = new List<string>();

                errpara.Add(this.Key);

                throw new FisException("CHK152", errpara);
            }
            //logger.InfoFormat("GetProductActivity: IProduct Hash: {0}; IProduct Key: {1}", currentProduct.GetHashCode().ToString(), currentProduct.Key);
            
            CurrentSession.AddValue(Session.SessionKeys.CustSN, this.Key);
            //add by sheng-ju for FRU 20110907
            CurrentSession.AddValue(Session.SessionKeys.ProductIDOrCustSN,product.ProId);
            CurrentSession.AddValue(Session.SessionKeys.Product, product);

            //logger.InfoFormat("GetProductActivity: CurrentSession Hash: {0}; CurrentSession Key: {1}; CurrentSession Type: {2}", CurrentSession.GetHashCode().ToString(), CurrentSession.Key, CurrentSession.Type.ToString());
            
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:28,代码来源:GetCustSN.cs

示例5: DoExecute

        /// <summary>
        /// Check RMN
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            Product curProduct = (Product)CurrentSession.GetValue(Session.SessionKeys.Product);
            if (curProduct == null)
            {
                List<string> errpara = new List<string>();
                errpara.Add(this.Key);
                throw new FisException("SFC002", errpara);
            }

            // OfflinePizzaFamily : 是否需要Pizza Id及 PizzaID Label(不需要打印)
            IPartRepository partRepository = RepositoryFactory.GetInstance().GetRepository<IPartRepository, IPart>();
            string keyOfflinePizzaFamily = "OfflinePizzaFamily";

            string isOfflinePizzaFamily = "N";
            IList<ConstValueTypeInfo> lstCnst = partRepository.GetConstValueTypeList(keyOfflinePizzaFamily);
            foreach (ConstValueTypeInfo cv in lstCnst)
            {
                if (cv.value.Equals(curProduct.Family))
                {
                    isOfflinePizzaFamily = "Y";
                    break;
                }
            }

            CurrentSession.AddValue(keyOfflinePizzaFamily, isOfflinePizzaFamily);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:CheckOfflinePizzaFamily.cs

示例6: Execute

		protected override ActivityExecutionStatus Execute (ActivityExecutionContext executionContext)
		{
			List <Activity> list = new List <Activity> ();
			Activity child = this;

			// Indicate that all children activites can be executed in paralell
			while (child != null) {
				//Console.WriteLine ("Child {0}", child);
				// TODO: if (IsBasedOnType (current, typeof (CompositeActivity))) {
				if (child.GetType ().BaseType == typeof (CompositeActivity)) {
					CompositeActivity composite = (CompositeActivity) child;
					foreach (Activity activity in composite.Activities) {
						list.Add (activity);
					}
				}

				if (list.Count == 0) {
					break;
				}

				child = list [0];
				child.ParallelParent = this;
				list.Remove (child);
			}

			foreach (Activity activity in Activities) {
				ActivitiesToExecute.Enqueue (activity);
			}

			NeedsExecution = false;
			return ActivityExecutionStatus.Closed;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:32,代码来源:ParallelActivity.cs

示例7: OnWorkflowChangesCompleted

        public virtual void OnWorkflowChangesCompleted(ActivityExecutionContext executionContext)
        {
            if (executionContext == null)
                throw new ArgumentNullException("executionContext");

            NextDynamicChangeExecutorInChain(executionContext.Activity).OnWorkflowChangesCompleted(executionContext);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ActivityExecutionFilter.cs

示例8: DoExecute

        /// <summary>
        /// lightoff
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IFlatBOM curBom = (IFlatBOM)CurrentSession.GetValue(Session.SessionKeys.SessionBom);
            string stationDescr = CurrentSession.GetValue(Session.SessionKeys.StationDescr) as string;

            IFlatBOMItem curMatchBomItem = curBom.CurrentMatchedBomItem;
            if (curMatchBomItem != null && curMatchBomItem.CheckedPart != null && curMatchBomItem.CheckedPart.Count > 0 && curMatchBomItem.Qty == curMatchBomItem.CheckedPart.Count)
            {
                IList<WipBuffer> wipbuffers = (IList<WipBuffer>)CurrentSession.GetValue(Session.SessionKeys.PizzaKitWipBuffer);

                foreach (WipBuffer wipbufobj in wipbuffers)
                {
                    if (PartMatchWipBuffer(wipbufobj.PartNo, curMatchBomItem.AlterParts))
                    {

                        IPalletRepository pltRepository = RepositoryFactory.GetInstance().GetRepository<IPalletRepository, Pallet>();
                        IList<KittingLocPLMappingStInfo> kitlocstinfos = pltRepository.GetKitLocPLMapST(Line.Substring(0, 1), stationDescr, short.Parse(wipbufobj.LightNo));
                        if (kitlocstinfos != null && kitlocstinfos.Count > 0)
                        {
                            //only one
                            pltRepository.UpdateKitLocationFVOffDefered(CurrentSession.UnitOfWork, kitlocstinfos[0].tagID, false, true);
                        }

                        break;
                    }
                }

            }
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:LightOff.cs

示例9: DoExecute

        /// <summary>
        /// Get QCStatus of Product
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        /// 

        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            var currentProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            List<string> errpara = new List<string>();
            string productID = currentProduct.ProId;

            IProductRepository productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();

            //ProductLog 
            string[] tps = new string[1];
            tps[0] = "PIA2";
            string status = "EFI";  //exemption from inspection
            IList<ProductQCStatus> QCStatusList = new List<ProductQCStatus>();
            QCStatusList = productRepository.GetQCStatusOrderByCdtDesc(productID, tps);
            if (QCStatusList != null && QCStatusList.Count > 0)
            {
                foreach (ProductQCStatus qcStatus in QCStatusList)
                {
                    if (qcStatus.Remark == "1")
                    {
                        status = "EPIA";
                        break;
                    }
                }
            }
            CurrentSession.AddValue(Session.SessionKeys.QCStatus, status);
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:GetQCStatus.cs

示例10: Execute

 protected override ActivityExecutionStatus Execute(ActivityExecutionContext context)
 {
     // Create an Outlook Application object. 
     Outlook.Application outlookApp = new Outlook.Application();
     // Create a new TaskItem.
     Outlook.NoteItem newNote = (Outlook.NoteItem)outlookApp.CreateItem(Outlook.OlItemType.olNoteItem);
     // Configure the task at hand and save it.
     if (this.Parent.Parent is ParallelActivity)
     {
         newNote.Body = (this.Parent.Parent.Parent.Activities[1] as DummyActivity).TitleProperty;
         if ((this.Parent.Parent.Parent.Activities[1] as DummyActivity).TitleProperty != "")
         {
             MessageBox.Show("Creating Outlook Note");
             newNote.Save();
         }
     }
     else if (this.Parent.Parent is SequentialWorkflowActivity)
     {
         newNote.Body = (this.Parent.Parent.Activities[1] as DummyActivity).TitleProperty;
         if ((this.Parent.Parent.Activities[1] as DummyActivity).TitleProperty != "")
         {
             MessageBox.Show("Creating Outlook Note");
             newNote.Save();
         }
     }
     return ActivityExecutionStatus.Closed;
 }
开发者ID:ssickles,项目名称:archive,代码行数:27,代码来源:OutlookNote.cs

示例11: DoExecute

        /// <summary>
        /// 检查dn是否与机器结合了
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            CurrentSession.AddValue(Session.SessionKeys.DNCombineProduct, false);
            var productRepository = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
            string inputNo = (string)CurrentSession.GetValue(Session.SessionKeys.DeliveryNo);
            IList<IProduct> lstProduct = productRepository.GetProductListByDeliveryNo(inputNo);
            if (lstProduct != null && lstProduct.Count != 0)
            {
                CurrentSession.AddValue(Session.SessionKeys.DNCombineProduct, true);
                List<string> productIDList = new List<string>();
                List<string> cartonSNList = new List<string>();
                List<string> productCustSNList = new List<string>();
                foreach (var product in lstProduct)
                {
                    productIDList.Add(product.ProId);
                    cartonSNList.Add(product.CartonSN);
                    //collect customer sn
                    productCustSNList.Add(product.CUSTSN);

                    
                }
                CurrentSession.AddValue(Session.SessionKeys.NewScanedProductIDList, productIDList);
                CurrentSession.AddValue(Session.SessionKeys.CartonSNList, cartonSNList);
                CurrentSession.AddValue(Session.SessionKeys.NewScanedProductCustSNList, productCustSNList);
               
            }
           
            
            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:35,代码来源:CheckDNCombineProduct.cs

示例12: DoExecute

 /// <summary>
 /// 执行根据DeliveryNo修改所有属于该DeliveryNo的Product状态的操作
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     IProduct defaultProduct = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
     string deliveryNo = defaultProduct.DeliveryNo;
     if (deliveryNo=="")
     {
        /* List<string> errpara = new List<string>();
         errpara.Add("no deliveryNo");
         throw new FisException("CHK107", errpara);*/
         return base.DoExecute(executionContext);
     }
     IDeliveryRepository DeliveryRepository = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
     Delivery CurrentDelivery = DeliveryRepository.Find(deliveryNo);
     if (CurrentDelivery == null)
     {
        /* List<string> errpara = new List<string>();
         errpara.Add(deliveryNo);
         throw new FisException("CHK107", errpara);*/
         return base.DoExecute(executionContext);
     }
     CurrentSession.AddValue(Session.SessionKeys.Delivery, CurrentDelivery);
     if (CurrentDelivery.Status == "98") {
         List<string> errpara = new List<string>();
         errpara.Add("已经上传SAP,不能Unpack!");
         throw new FisException("CHK290", errpara);
     }
     return base.DoExecute(executionContext);
 }
开发者ID:wra222,项目名称:testgit,代码行数:33,代码来源:UnPackCheckDnStatusBySn.cs

示例13: DoExecute

        /// <summary>
        /// 
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            string data = (string)CurrentSession.GetValue("DeliveryNo");
            IPizzaRepository repPizza = RepositoryFactory.GetInstance().GetRepository<IPizzaRepository, Pizza>();
            bool flag = false;            
            flag = repPizza.CheckExistPakDashPakComnByInternalID(data.Substring(0,10));

            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "DN");
                CurrentSession.AddValue(Session.SessionKeys.DeliveryNo, data.Substring(0, 10));
                return base.DoExecute(executionContext);                
            }
            
            flag = repPizza.CheckExistVShipmentPakComnByConsolInvoiceOrShipment(data);
            if (flag == true)
            {
                CurrentSession.AddValue(Session.SessionKeys.VCode, "Shipment");
                return base.DoExecute(executionContext);                
            }
            
            CurrentSession.AddValue(Session.SessionKeys.VCode, "Unknown");
            List<string> errpara = new List<string>();
            errpara.Add(data);
            FisException ex = new FisException("CHK277", errpara);
            //ex.stopWF = false;
            throw ex;

        }        
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:CheckInputForScaningList.cs

示例14: DoExecute

        /// <summary>
        /// 用于Repair时修改Defect信息。
        /// </summary>
        /// <param name="executionContext"></param>
        /// <returns></returns>
        protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
        {
            IRepairTarget repairTarget = GetRepairTarget();
            //IProduct product = (IProduct)CurrentSession.GetValue(Session.SessionKeys.Product);
            //if (product != null)
            //{
            //    string value = (string)CurrentSession.GetValue(Session.SessionKeys.MAC);
            //    product.MAC = value;
            //}

            RepairDefect defect = (RepairDefect)CurrentSession.GetValue(Session.SessionKeys.CurrentRepairdefect);

            //Dean 20110530 因為PartType為Disable ,在新增時就要塞入PartType,來判斷是否回F0或40
            const string repairPartType = "";
            if (CurrentSession.GetValue(ExtendSession.SessionKeys.RepairPartType) != null)
            {
                defect.PartType = CurrentSession.GetValue(ExtendSession.SessionKeys.RepairPartType).ToString().Trim();
            }
            else
            {
                defect.PartType = repairPartType.Trim();
            }
            //Dean 20110530 因為PartType為Disable ,在新增時就要塞入PartType,來判斷是否回F0或40

            repairTarget.UpdateRepairDefect(defect.RepairID, defect);
            UpdateRepairTarget(repairTarget);

            return base.DoExecute(executionContext);
        }
开发者ID:wra222,项目名称:testgit,代码行数:34,代码来源:UpdateRepairDefect.cs

示例15: DoExecute

 /// <summary>
 /// 
 /// </summary>
 /// <param name="executionContext"></param>
 /// <returns></returns>
 protected internal override ActivityExecutionStatus DoExecute(ActivityExecutionContext executionContext)
 {
     IMiscRepository miscRep = RepositoryFactory.GetInstance().GetRepository<IMiscRepository>();
     Session session = CurrentSession;
     IList<DefectComponentInfo> defectComponentInfoList = (IList<DefectComponentInfo>)session.GetValue("DefectComponentInfo");
     foreach (DefectComponentInfo item in defectComponentInfoList)
     {
         DefectComponentLogInfo saveItem = new DefectComponentLogInfo();
         saveItem.ActionName = ActionName;
         saveItem.ComponentID = item.ID;
         saveItem.RepairID = item.RepairID;
         saveItem.PartSn = item.PartSn;
         saveItem.Customer = item.Customer;
         saveItem.Model = item.Model;
         saveItem.Family = item.Family;
         saveItem.DefectCode = item.DefectCode;
         saveItem.DefectDescr = item.DefectDescr;
         saveItem.ReturnLine = item.ReturnLine;
         saveItem.Remark = "";
         saveItem.BatchID = item.BatchID;
         saveItem.Comment = item.Comment;
         saveItem.Status = item.Status;
         saveItem.Editor = this.Editor;
         saveItem.Cdt = DateTime.Now;
         miscRep.InsertDataWithIDDefered<DefectComponentLog, DefectComponentLogInfo>(session.UnitOfWork,saveItem);
     }
     return base.DoExecute(executionContext);
 }
开发者ID:wra222,项目名称:testgit,代码行数:33,代码来源:WriteDefectComponentLog.cs


注:本文中的ActivityExecutionContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。