Пример #1
0
        //工作流开始运行
        public string Start(IDictionary<string, string> record)
        {
            IEvent startE = null;
            foreach(var item in m_events)
            {
                if (item.Value.GetType().Name == "CStartEvent")
                {
                    startE = item.Value;
                    break;
                }
            }
            if (startE == null)
                return null;
            m_courrentEvent = startE.name;
            startE.EnterEvent("");
            UpdateEntity(WE_STATUS.ACTIVE);
            SubmitSignal("[]");

            //状态发生了迁移
            if (GetCurrentState() != startE.name)
            {
                if (record != null)
                {
                    WorkFlows wfs = new WorkFlows();
                    Mission ms = wfs.GetWFEntityLastMission(EntityID);

                    List<Process_Record> res = new List<Process_Record>();
                    foreach (var re in record)
                    {
                        if (GetRecordItems().ContainsKey(re.Key))
                        {
                            Process_Record pre = new Process_Record();
                            pre.Re_Name = re.Key;
                            pre.Re_Value = re.Value;
                            res.Add(pre);
                        }
                    }
                    wfs.LinkRecordInfoToMiss(ms.Miss_Id, res);
                }
            }            
            
            return m_events[m_courrentEvent].currentaction + @"/?wfe_id=" + m_entityID;
        }