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


C# Session.ResumeWorkFlow方法代码示例

本文整理汇总了C#中Session.ResumeWorkFlow方法的典型用法代码示例。如果您正苦于以下问题:C# Session.ResumeWorkFlow方法的具体用法?C# Session.ResumeWorkFlow怎么用?C# Session.ResumeWorkFlow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Session的用法示例。


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

示例1: SwitchToWF

        /// <summary>
        /// time out for SwitchToWF
        /// </summary>
        /// <param name="session"></param>
        /// <param name="sessionKeyValue"></param>
        /// <param name="timeout">Second unit</param>
        /// <returns></returns>
        public static Session SwitchToWF(Session session,
                                                           Dictionary<string, object> sessionKeyValue,
                                                           int timeout)
        {
            if (session == null)
            {
                throw new Exception("No Session !!");
            }

            if (sessionKeyValue != null)
            {
                foreach (KeyValuePair<string, object> item in sessionKeyValue)
                {
                    session.AddValue(item.Key, item.Value);
                }
            }
            bool hasTimeOut = false;
            session.Exception = null;
            DateTime now = DateTime.Now;
            hasTimeOut =!session.SwitchToWorkFlow(timeout*1000);
            if (hasTimeOut)
            {
                throw new Exception(string.Format("[TimeOut] SessionKey:{0} Line:{1} Editor:{2} Station:{3} TimeOut:{4} Cdt:{5} waiting wf timeout!!!",
                                                                      session.Key, session.Line??"",session.Editor??"", session.Station, timeout.ToString(), now.ToString("yyyyMMdd HH:mm:ss.fff")));
            }
            else
            {
                if (session.Exception != null)
                {
                    if (session.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        session.ResumeWorkFlow();
                    }
                    throw session.Exception;
                }
            }

            return session;
        }
开发者ID:wra222,项目名称:testgit,代码行数:46,代码来源:WorkflowUtility.cs

示例2: GetProduct

        /// <summary>
        /// 获取Product表相关信息
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="customerSN">customer SN</param>
        public S_RowData_Product GetProduct(string line, string editor, string station, string customer,string customerSN)
        {
            logger.Debug("(_CombineCOAandDN)GetProduct start.customerSN:" + customerSN);
           
            string keyStr = "";
            try
            {
                string sessionKey = customerSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineCOAandDNBlock.xoml", "", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, customerSN);
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                S_RowData_Product ret = new S_RowData_Product();
                ret.DN = "";
                ret.Model = "";
                ret.ProductID = "";
                ret.isBT = "false";
                ret.isCDSI = "";
                ret.isFactoryPo = "";
                ret.isWin8 = "";
                IProduct temp = productRepository.GetProductByCustomSn(customerSN);
                if (null != temp)
                {
                    ret.ProductID = temp.ProId;
                    ret.isBT = temp.IsBT.ToString();
                    ret.Model = temp.Model;
                    
                    IList<IMES.FisObject.Common.Model.ModelInfo> isPO = modelRep.GetModelInfoByModelAndName(temp.Model, "PO");
                    foreach (IMES.FisObject.Common.Model.ModelInfo tmpPO in isPO)
                    {
                        if (tmpPO.Value == "Y")
                        {
                            ret.isCDSI = "true";
                        }
                        else
                        {
                            IList<IMES.FisObject.Common.Model.ModelInfo> isATSNAV = modelRep.GetModelInfoByModelAndName(temp.Model, "ATSNAV");
                            foreach (IMES.FisObject.Common.Model.ModelInfo tmpATSNAV in isATSNAV)
                            {
                                if (tmpATSNAV.Value == null)
                                { 
                                }
                                else if (tmpATSNAV.Value != "")
                                {
                                    ret.isCDSI = "true";
                                }
                                break;
                            }
                        }
                        break;
                    }
                    if (ret.isCDSI == "true")
                    {
                        CdsiastInfo condition = new CdsiastInfo();
                        condition.snoId = temp.ProId;
                        condition.tp = "FactoryPO";
                        IList<CdsiastInfo> isCdsiastInfo = productRepository.GetCdsiastInfoList(condition);
                        ret.isFactoryPo = "";
                        foreach (CdsiastInfo tmpCdsiastInfo in isCdsiastInfo)
                        {
                            ret.isFactoryPo = tmpCdsiastInfo.sno;
                            break;
                        }
                        if (ret.isBT == "true" || ret.isBT == "True")
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineCOAandDN.cs

示例3: UpdateDeliveryStatusAndPrint

        /// <summary>
        /// IMES_PAK..Delivery.Status = '87'
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="DN">DN</param>
        /// <param name="custSN">custSN</param>
        /// <param name="coaSN">coaSN</param>
        /// <param name="printItems"></param> 
        public ArrayList UpdateDeliveryStatusAndPrint(string line, string editor, string station, string customer, string DN, string custSN, string coaSN, IList<PrintItem> printItems)
        {
            ArrayList retList = new ArrayList();
            string keyStr = "";
            try 
            {
                if (null == line)
                {
                    line = "";
                }
                if (null == station)
                {
                    station = "";
                }
                if (null == editor)
                {
                    editor = "";
                }
                if (null == customer)
                {
                    customer = "";
                }
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                if (null == currentProduct)
                {
                    List<string> errpara = new List<string>();

                    errpara.Add(custSN);
                    throw new FisException("SFC002", errpara);
                }
                Delivery reDelivery = currentRepository.Find(DN);
                
                S_RowData_Product productInfo = GetProductOnly(custSN);
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineCOAandDNAndPrint.xoml", "combinecoaanddnandprint.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.COASN, coaSN);
                if (currentProduct.IsBT)
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, true);
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, false);
                }
                if (productInfo.isCDSI == "true")
                {
                    currentSession.AddValue(Session.SessionKeys.Pno, productInfo.isFactoryPo);
                }
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                currentSession.AddValue(Session.SessionKeys.Delivery, reDelivery);
                currentSession.AddValue(Session.SessionKeys.ReturnStation, "1");
                currentSession.AddValue(Session.SessionKeys.IsComplete, true);
                currentSession.AddValue(Session.SessionKeys.PrintItems, printItems);
                
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    
                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                IUnitOfWork uow = new UnitOfWork();
                var repository = RepositoryFactory.GetInstance().GetRepository<IPrintLogRepository, PrintLog>();
                if (currentProduct != null)
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineCOAandDN.cs

示例4: UpdateDeliveryStatus

        /// <summary>
        /// IMES_PAK..Delivery.Status = '87'
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="DN">DN</param>
        /// <param name="custSN">custSN</param>
        /// <param name="coaSN">coaSN</param>
        public string UpdateDeliveryStatus(string line, string editor, string station, string customer, string DN, string custSN, string coaSN)
        {
            string keyStr = "";
            try
            {
                if (null == line)
                {
                    line = "";
                }
                if (null == station)
                {
                    station = "";
                }
                if (null == editor)
                {
                    editor = "";
                }
                if (null == customer)
                {
                    customer = "";
                }
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                if (null == currentProduct)
                {
                    List<string> errpara = new List<string>();

                    errpara.Add(custSN);
                    throw new FisException("SFC002", errpara);
                }
                Delivery reDelivery = currentRepository.Find(DN);

                S_RowData_Product productInfo = GetProductOnly(custSN);
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineCOAandDN.xoml", "combinecoaanddn.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.COASN, coaSN);
                if (currentProduct.IsBT)
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, true);
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, false);
                }
                if (productInfo.isCDSI == "true")
                {
                    currentSession.AddValue(Session.SessionKeys.Pno, productInfo.isFactoryPo);
                }
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                currentSession.AddValue(Session.SessionKeys.Delivery, reDelivery);
                currentSession.AddValue(Session.SessionKeys.ReturnStation, "1");
                currentSession.AddValue(Session.SessionKeys.IsComplete, true);
                string QCIs = "false";
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                string DNTemp = (string)currentSession.GetValue(Session.SessionKeys.DeliveryNo);
                logger.Debug("(_CombineCOAandDN)UpdateDeliveryStatus DNTemp:" + DNTemp);
                logger.Debug("(_CombineCOAandDN)UpdateDeliveryStatus DN:" + DN);
                if (DN != DNTemp)
                {
                    QCIs = QCIs + "#@$#" + DNTemp;
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineCOAandDN.cs

示例5: AssignAll


//.........这里部分代码省略.........
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }


                //Lock The XXX: 2012.04.21 LiuDong
                //Guid gUiD = Guid.Empty;
                //ConcurrentLocksInfo identity = null;
                //bool isFirstBranch = !(bool)currentSession.GetValue(IMES.Infrastructure.Session.SessionKeys.ifElseBranch);
                //if (isFirstBranch)
                //{
                //    identity = new ConcurrentLocksInfo();
                //    identity.clientAddr = "N/A";
                //    identity.customer = customer;
                //    identity.descr = string.Format("ThreadID: {0}", System.Threading.Thread.CurrentThread.ManagedThreadId.ToString());
                //    identity.editor = editor;
                //    identity.line = line;
                //    identity.station = station;
                //    identity.timeoutSpan4Hold = new TimeSpan(0, 0, 3).Ticks;
                //    identity.timeoutSpan4Wait = new TimeSpan(0, 0, 5).Ticks;
                //}
                //lock (_syncObj4AssignAll)
                //{
                //    try
                //    {
                //        if (isFirstBranch)
                //            gUiD = productRepository.GrabLockByTransThread("Delivery", DN, identity);

                        currentSession.WorkflowInstance.Start();
                        currentSession.SetHostWaitOne();
                //    }
                //    finally
                //    {
                //        productRepository.ReleaseLockByTransThread("Ucc", (Guid)currentSession.GetValue<Guid>(Session.SessionKeys.lockToken_Ucc));
                //        productRepository.ReleaseLockByTransThread("Box", (Guid)currentSession.GetValue<Guid>(Session.SessionKeys.lockToken_Box));
                //        productRepository.ReleaseLockByTransThread("Loc", (Guid)currentSession.GetValue<Guid>(Session.SessionKeys.lockToken_Loc));
                //        productRepository.ReleaseLockByTransThread("Pallet", (Guid)currentSession.GetValue<Guid>(Session.SessionKeys.lockToken_Pallet));
                //        if (isFirstBranch)
                //            productRepository.ReleaseLockByTransThread("Delivery", gUiD);
                //        else
                //            productRepository.ReleaseLockByTransThread("Delivery", (Guid)currentSession.GetValue<Guid>(Session.SessionKeys.lockToken_DN));
                //    }
                //}
                //Release The XXX: 2012.04.21 LiuDong
                
                
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                string temp = "";
                Delivery thisDelivery = (Delivery)currentSession.GetValue(Session.SessionKeys.Delivery);
                if (thisDelivery != null)
                {
                    temp = thisDelivery.DeliveryNo;
                }
            
                return temp;
            }
            catch (FisException e)
            {
                if (!string.IsNullOrEmpty(prodId))
                {
                    IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                    deliveryRep.RollBackAssignBoxId(prodId);
                }

                logger.Error(e.mErrmsg, e);
                throw new Exception(e.mErrmsg);
            }
            catch (Exception e)
            {
                if (!string.IsNullOrEmpty(prodId))
                {
                    IDeliveryRepository deliveryRep = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, Delivery>();
                    deliveryRep.RollBackAssignBoxId(prodId);
                }
                logger.Error(e.Message, e);
                throw new SystemException(e.Message);
            }
            finally
            {          

                Session sessionDelete = SessionManager.GetInstance.GetSession(keyStr, SessionType); ;
                if (sessionDelete != null)
                {
                    SessionManager.GetInstance.RemoveSession(sessionDelete);
                }
                logger.Debug("(_CombineDNPalletforBT)AssignAll end, custSn:" + custSN);
            }
        }
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineDNPalletforBT.cs

示例6: AssignAllNew

        public ArrayList AssignAllNew(string custSN, string line, string code, string floor,
                                                 string editor, string station, string customer, string DN)
        {
            string keyStr = "";
            string prodId = "";
            ArrayList arrRet = new ArrayList();
            try
            {
                var currentProduct = CommonImpl.GetProductByInput(custSN, CommonImpl.InputTypeEnum.CustSN);
                if (null == currentProduct)
                {
                    List<string> err = new List<string>();
                    err.Add(custSN);
                    throw new FisException("SFC002", err);
                }
                prodId = currentProduct.ProId;
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineDNPalletforBT.xoml", "CombineDNPalletforBT.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.IsComplete, false);
                currentSession.AddValue(Session.SessionKeys.Floor, floor);
                currentSession.AddValue(Session.SessionKeys.MBCode, code);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                if (DN == "")
                {
                    //auto is true
                    currentSession.AddValue(Session.SessionKeys.ifElseBranch, true);
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.ifElseBranch, false);
                }


                currentSession.SetInstance(instance);

                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }


             

                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
             

                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                string temp = "";
                Delivery thisDelivery = (Delivery)currentSession.GetValue(Session.SessionKeys.Delivery);
                if (thisDelivery != null)
                {
                    temp = thisDelivery.DeliveryNo;
                }
                //Get Pallet
                Pallet pallet = (Pallet)currentSession.GetValue(Session.SessionKeys.Pallet);
                int q1 = palletRep.GetCountOfBoundProduct(pallet.PalletNo);
                int q2 = currentRepository.GetSumDeliveryQtyOfACertainPallet(pallet.PalletNo);
                //Get Pallet

                S_RowData_DN ele = new S_RowData_DN();
                ele.DeliveryNO = thisDelivery.DeliveryNo;
                ele.Model = thisDelivery.ModelName;
                ele.CustomerPN = currentRepository.GetDeliveryInfoValue(thisDelivery.DeliveryNo, "PartNo");
                ele.PoNo = thisDelivery.PoNo;
                ele.Date = thisDelivery.ShipDate.ToString("yyyy/MM/dd ");
                ele.Qty = thisDelivery.Qty.ToString();
                IList<IProduct> productList = new List<IProduct>();
                productList = productRepository.GetProductListByDeliveryNo(thisDelivery.DeliveryNo);
                if (null != productList)
                {
                    ele.PackedQty = productList.Count.ToString();
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineDNPalletforBT.cs

示例7: GetProduct


//.........这里部分代码省略.........
                logger.Error(e.Message);
                throw e;
            }
            try
            {
                string sessionKey = customerSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineCOAandDNBlock.xoml", "", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, customerSN);
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                
				string isBSaM = currentSession.GetValue(ExtendSession.SessionKeys.IsBSamModel) as string;
                S_RowData_Product ret = new S_RowData_Product();
                ret.DN = "";
                ret.Model = "";
                ret.isBSaM = "";
                ret.ProductID = "";
                ret.isBT = "false";
                ret.isCDSI = "";
                ret.isFactoryPo = "";
                ret.isWin8 = "";
                IProduct temp = productRepository.GetProductByCustomSn(customerSN);
                if (null != temp)
                {
                    ret.ProductID = temp.ProId;
                    ret.isBT = temp.IsBT.ToString();
                    ret.Model = temp.Model;
                    
                    IList<IMES.FisObject.Common.Model.ModelInfo> isPO = modelRep.GetModelInfoByModelAndName(temp.Model, "PO");
                    foreach (IMES.FisObject.Common.Model.ModelInfo tmpPO in isPO)
                    {
                        if (tmpPO.Value == "Y")
                        {
                            ret.isCDSI = "true";
                        }
                        else
                        {
                            IList<IMES.FisObject.Common.Model.ModelInfo> isATSNAV = modelRep.GetModelInfoByModelAndName(temp.Model, "ATSNAV");
开发者ID:wra222,项目名称:testgit,代码行数:67,代码来源:CombineCOAandDN.cs

示例8: CheckProduct

        /// <summary>
        /// check product
        /// </summary>
        /// <param name="line">line</param>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="custSN">customer SN</param>
        public int CheckProduct(string line,string editor, string station, string customer,string custSN)
        {
           
            string keyStr = "";
            try
            {
                string sessionKey = custSN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CombineDNPalletforBTBlock.xoml", "", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    FisException ex;
                    List<string> erpara = new List<string>();
                    erpara.Add(sessionKey);
                    ex = new FisException("CHK020", erpara);
                    throw ex;
                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
               
                IProduct product = null;
                product = productRepository.GetProductByCustomSn(custSN);
                if (null == product)
                {
                    //no data
                    return -10;
                }
                string isCDSI = "";
                string isFactoryPo = "";
                IList<IMES.FisObject.Common.Model.ModelInfo> isPO = modelRep.GetModelInfoByModelAndName(product.Model, "PO");

                foreach (IMES.FisObject.Common.Model.ModelInfo tmpPO in isPO)
                {
                    if (tmpPO.Value == "Y")
                    {
                        isCDSI = "true";
                    }
                    else
                    {
                        IList<IMES.FisObject.Common.Model.ModelInfo> isATSNAV = modelRep.GetModelInfoByModelAndName(product.Model, "ATSNAV");
                        foreach (IMES.FisObject.Common.Model.ModelInfo tmpATSNAV in isATSNAV)
                        {
                            if (tmpATSNAV.Value == null)
                            { 
                            }
                            else if (tmpATSNAV.Value != "")
                            {
                                isCDSI = "true";
                            }
                            break;
                        }
                    }
                    break;
                }
                if (isCDSI == "true")
                {

                    CdsiastInfo condition = new CdsiastInfo();
                    condition.snoId = product.ProId;
                    condition.tp = "FactoryPO";
                    IList<CdsiastInfo> isCdsiastInfo = productRepository.GetCdsiastInfoList(condition);
                    isFactoryPo = "";
                    foreach (CdsiastInfo tmpCdsiastInfo in isCdsiastInfo)
                    {
                        isFactoryPo = tmpCdsiastInfo.sno;
                        break;
                    }
                    if (isFactoryPo == "" || isFactoryPo == null)
                    {
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:CombineDNPalletforBT.cs

示例9: UpdateDeliveryStatusAndPrint


//.........这里部分代码省略.........
                    currentSession.AddValue(Session.SessionKeys.IsBT, false);
                }
                if (productInfo.isCDSI == "true")
                {
                    currentSession.AddValue(Session.SessionKeys.Pno, productInfo.isFactoryPo);
                }
                currentSession.AddValue(Session.SessionKeys.CustSN, custSN);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                currentSession.AddValue(Session.SessionKeys.Delivery, reDelivery);
                currentSession.AddValue(Session.SessionKeys.ReturnStation, "1");
                currentSession.AddValue(Session.SessionKeys.IsComplete, true);
                currentSession.AddValue(Session.SessionKeys.PrintItems, printItems);

                BSamModel bsamModel = bsamRepository.GetBSamModel(currentProduct.Model);
                if (bsamModel != null)
                {
                    IsBSamModel = "Y";
                }
				currentSession.AddValue(ExtendSession.SessionKeys.IsBSamModel, IsBSamModel);
                
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");
                    
                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                bool jpflag = false;
                IList<PrintItem> printList = (IList<PrintItem>)currentSession.GetValue(Session.SessionKeys.PrintItems);
                string QCIs = "noqcis";
                try
                {
                    // mantis 1945: JameStown新机型; OfflinePizzaFamily 區別是否需要Pizza Id及 PizzaID Label(不需要打印)
                    bool isOfflinePizzaFamily = "Y".Equals( currentSession.GetValue("OfflinePizzaFamily") as string);
                    if (printList != null)
                    {
                        if (isOfflinePizzaFamily) // JameStown , 不印: PIZZA Label
                        {
                            IList<PrintItem> printListWithoutPizzaLabel = new List<PrintItem>();
                            foreach (PrintItem pi in printList)
                            {
                                if (pi.LabelType.IndexOf("PIZZA Label") < 0)
                                    printListWithoutPizzaLabel.Add(pi);
                            }
                            printList = printListWithoutPizzaLabel;
                        }
                        else // 一般 , 不印: L10_LABEL
                        {
                            IList<PrintItem> printListWithoutPizzaLabel = new List<PrintItem>();
                            foreach (PrintItem pi in printList)
                            {
                                if (pi.LabelType.IndexOf("L10_LABEL") < 0)
                                    printListWithoutPizzaLabel.Add(pi);
                            }
                            printList = printListWithoutPizzaLabel;
开发者ID:wra222,项目名称:testgit,代码行数:67,代码来源:CombineCOAandDN.cs

示例10: CombineDN


//.........这里部分代码省略.........
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CooLabelRun.xoml", "CooLabelRun.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, customerSn);
                currentSession.AddValue(Session.SessionKeys.ProductIDOrCustSN, prod);
                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                
                currentSession.AddValue(Session.SessionKeys.Product, currentProduct);
                string QCIs = "false";
                if (station != "96")
                {
                    if (DoPAQC(prod) == "true")
                    {
                        currentSession.AddValue("COOQCStatus", "true");
                        QCIs = "true";
                    }
                    else
                    {
                        currentSession.AddValue("COOQCStatus", "false");
                    }
                }
                else
                {
                    currentSession.AddValue("COOQCStatus", "undo");
                    IProductRepository repProduct = RepositoryFactory.GetInstance().GetRepository<IProductRepository, IProduct>();
                    string[] tps = new string[1];
                    tps[0] = "PAQC";
                    IList<ProductQCStatus> QCStatusList = new List<ProductQCStatus>();
                    QCStatusList = repProduct.GetQCStatusOrderByUdtDesc(getProductInfo.ProductID, tps);
                    foreach (ProductQCStatus tmp in QCStatusList)
                    {
                        if (tmp.Status == "8")
                        {
                            QCIs = "true";
                            break;
                        }
                        break;
                    }
                }
                if (IsChk == "true")
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, false);
					if (IsBTChk == "true")
					{
						currentSession.AddValue("isBT", "Y");
					}
                }
                else
                {
                    currentSession.AddValue(Session.SessionKeys.IsBT, true);
                }
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }

                return QCIs;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
            finally
            {
                Session sessionDelete = SessionManager.GetInstance.GetSession(keyStr, SessionType); ;
                if (sessionDelete != null)
                {
                    SessionManager.GetInstance.RemoveSession(sessionDelete);
                }
                logger.Debug("(_CooLabel)CombineDN end, customerSN:" + customerSn);
            }
        }
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:coolabel.cs

示例11: GetProduct

        /// <summary>
        /// 获取Product表相关信息
        /// </summary>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="customerSN">customer SN</param>
        /// <param name="prod">prod</param> 
        public S_CooLabel GetProduct(string editor, string station, string customer, string customerSN, string prod)
        {
            logger.Debug("(_CooLabel)GetProduct start.customerSN:" + customerSN);
            string keyStr = "";
            try
            {
                S_CooLabel getProductInfo;
                if (station == null)
                {
                    station = "";
                }
                if (customerSN == "")
                {
                    getProductInfo = GetProductByProd(prod, station);
                }
                else
                {
                    getProductInfo = GetProductBySN(customerSN, station);
                }
                customerSN = getProductInfo.CustomerSN;
                prod = getProductInfo.ProductID;
                string line = "";
                ProductStatusInfo statusIfo = productRepository.GetProductStatusInfo(prod);
                if (statusIfo.pdLine != null)
                {
                    line = statusIfo.pdLine;
                }
                string sessionKey = prod;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "CooLabelBlock.xoml", "", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);
                currentSession.AddValue(Session.SessionKeys.CustSN, customerSN);
                currentSession.AddValue(Session.SessionKeys.ProductIDOrCustSN, prod);
                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }
                bool retJapan = ISJapan("PN", getProductInfo.Model, "#ABJ");
                if (retJapan == true)
                {
                    getProductInfo.IsJapan = "japantrue";
                }
                else
                {
                    getProductInfo.IsJapan = "japanfalse";
                }
                return getProductInfo;
            }
            catch (FisException e)
            {
                logger.Error(e.mErrmsg);
                throw e;
            }
            catch (Exception e)
            {
                logger.Error(e.Message);
                throw e;
            }
            finally
            {
                Session sessionDelete = SessionManager.GetInstance.GetSession(keyStr, SessionType); ;
                if (sessionDelete != null)
                {
                    SessionManager.GetInstance.RemoveSession(sessionDelete);
                }
                logger.Debug("(_CooLabel)GetProduct end, customerSN:" + customerSN);
            }
        }
开发者ID:wra222,项目名称:testgit,代码行数:100,代码来源:coolabel.cs

示例12: RemoveSession

        public void RemoveSession(Session session, bool isTermination)
        {
            //MethodBase methodInfo = MethodBase.GetCurrentMethod();
            if (this.BeginRemoveSession != null)
                this.BeginRemoveSession(MethodRemoveSession, new object[] { session, isTermination });

            #region trash
            //    'release part-uut binding cache
            //    BindingCacheManager.GetInstance.removeBindingByValue(session.Key)

            //    'release shipping 05 cache
            //    ICZUnitCacheManager.GetInstance.removeBindingByValue(session.Key)

            //    'release shipping pallete cache
            //    If session.Type = SessionType.SESSION_SHIPPING Then
            //        Dim pallet As Object = session.GetValue(SessionKey.Pallet)
            //        If Not pallet Is Nothing AndAlso TypeOf pallet Is Pallet Then
            //            Dim palletNo As String = CType(pallet, Pallet).PalletNo
            //            ShippingPalletCacheManager.GetInstance.removeBinding(palletNo)
            //        End If
            //    End If

            //    'release  pvs ckpo preorder
            //    If session.Type = SessionType.SESSION_TYPE_PO And isTermination Then
            //        If session.GetValue(SessionKey.CKPreOrdered) = True Then
            //            Dim ckpo As Object = session.GetValue(SessionKey.CKPO)
            //            If Not ckpo Is Nothing Then
            //                CType(ckpo, CKPO).countermand("")
            //            End If
            //        End If
            //    End If
            #endregion

            Monitor.Enter(this._synObjSessions);
            try
            {
                session.SetSessionCompleted();               
                string gKey = Session.GetGlobalSessionKey(session);
                this._sessionCache.Remove(gKey);
                this._wfIDKeyMap.Remove(session.Id);

                //Vincent 2014-11-17 first step release wf & host thread
                session.ResumeHost();
                session.ResumeWorkFlow();               

            }
            catch (Exception ex) 
            {
                if (this.ErrorInRemoveSession != null)
                    this.ErrorInRemoveSession(MethodRemoveSession, new object[] { session, isTermination }, ex);
            }
            finally
            {
                Monitor.Exit(this._synObjSessions);

                if (this.EndRemoveSession != null)
                    this.EndRemoveSession(MethodRemoveSession, new object[] { session, isTermination });
            }

            //Vincent add: check Terminate flag
            //if (isTermination)
            //{
            this.TerminateWF(session);
            //}
        }
开发者ID:wra222,项目名称:testgit,代码行数:65,代码来源:SessionManager.cs

示例13: DoUnpackByDN

        /// <summary>
        /// DoUnpackByDN
        /// </summary>
        /// <param name="editor">editor</param>
        /// <param name="station">station</param>
        /// <param name="customer">customer</param>
        /// <param name="DN">DN</param> 
        public void DoUnpackByDN( string editor, string station, string customer, string DN)
        {
            logger.Debug("(_UnpackAllbyDN)DoUnpackByDN start.DN:" + DN);
            string keyStr = "";
            try
            {
                var currentDelivery = RepositoryFactory.GetInstance().GetRepository<IDeliveryRepository, IMES.FisObject.PAK.DN.Delivery>().Find(DN);
                if (station == null)
                {
                    station = "";
                }
               
                Delivery newDelivery = currentRepository.Find(DN);
                if (newDelivery == null)
                {
                    throw new FisException("CHK877", new string[] {  });//DN不存在
                }
                IList<IProduct> productList = new List<IProduct>();
                productList = productRepository.GetProductListByDeliveryNo(DN);
                if (null == productList)
                {
                    return;
                }
                if (0 == productList.Count)
                {
                    return;
                }
                string line = "";
                string sessionKey = DN;
                keyStr = sessionKey;
                Session currentSession = new Session(sessionKey, SessionType, editor, station, line, customer);
                Dictionary<string, object> wfArguments = new Dictionary<string, object>();
                wfArguments.Add("Key", sessionKey);
                wfArguments.Add("Station", station);
                wfArguments.Add("CurrentFlowSession", currentSession);
                wfArguments.Add("Editor", editor);
                wfArguments.Add("PdLine", line);
                wfArguments.Add("Customer", customer);
                wfArguments.Add("SessionType", SessionType);

                string wfName, rlName;
                RouteManagementUtils.GetWorkflow(station, "UnpackByDN.xoml", "UnpackByDN.rules", out wfName, out rlName);
                WorkflowInstance instance = WorkflowRuntimeManager.getInstance.CreateXomlFisWorkflow(wfName, rlName, wfArguments);

                currentSession.AddValue(Session.SessionKeys.DeliveryNo, DN);
                currentSession.AddValue(Session.SessionKeys.ProdNoList, productList);
                currentSession.AddValue(Session.SessionKeys.IsComplete, false);
                string isSuper = "Y";
                
                CommonImpl cmi = new CommonImpl();
                IList<ConstValueInfo> lstConst = cmi.GetConstValueListByType("SAP", "Name");
                string isExcuteDeleteSAPsn = "";
                string allowUnpackCode = "";
                foreach (ConstValueInfo constV in lstConst)
                {
                    if (constV.name == "ExcuteDeleteSNonSAP")
                    {
                        isExcuteDeleteSAPsn = constV.value;
                    }
                    if (constV.name == "AllowUnpackCode")
                    {
                        allowUnpackCode = constV.value;
                    }
                }
                string plant = System.Configuration.ConfigurationManager.AppSettings["PlantCode"];
                currentSession.AddValue("IsSuper", isSuper);
                currentSession.AddValue("ExcuteDeleteSNonSAP", isExcuteDeleteSAPsn);
                currentSession.AddValue("AllowUnpackCode", allowUnpackCode);
                currentSession.AddValue("PlantCode", plant);
                currentSession.AddValue("DNStatus", currentDelivery.Status);

                currentSession.SetInstance(instance);
                if (!SessionManager.GetInstance.AddSession(currentSession))
                {
                    currentSession.WorkflowInstance.Terminate("Session:" + sessionKey + " Exists.");

                }
                currentSession.WorkflowInstance.Start();
                currentSession.SetHostWaitOne();
                if (currentSession.Exception != null)
                {
                    if (currentSession.GetValue(Session.SessionKeys.WFTerminated) != null)
                    {
                        currentSession.ResumeWorkFlow();
                    }

                    throw currentSession.Exception;
                }

                return;
            }
            catch (FisException e)
            {
//.........这里部分代码省略.........
开发者ID:wra222,项目名称:testgit,代码行数:101,代码来源:unpackallbydn.cs


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