Пример #1
0
        /// <summary>
        /// 初始化流程FLActivity
        /// </summary>
        /// <param name="activity"></param>
        /// <param name="tempActivity"></param>
        private void InitFLActivities2(IFLActivity activity, object tempActivity)
        {
            //if (tempActivity is IEventWaiting)
            //{
            //    IEventWaiting m = (IEventWaiting)activity;
            //    IEventWaiting n = (IEventWaiting)tempActivity;
            //    m.AllowSendBack = n.AllowSendBack;
            //}

            if (tempActivity is IFLRootActivity)
            {
                IFLRootActivity m = (IFLRootActivity)activity;
                IFLRootActivity n = (IFLRootActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.EEPAlias = n.EEPAlias;
                m.TableName = n.TableName;
                m.Keys = n.Keys;
                m.PresentFields = n.PresentFields;
                m.OrgKind = n.OrgKind;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.ExpTime = n.ExpTime;
                m.ExpTimeField = n.ExpTimeField;
                m.UrgentTime = n.UrgentTime;
                m.TimeUnit = n.TimeUnit;
                m.SkipForSameUser = n.SkipForSameUser;
                m.RejectProcedure = n.RejectProcedure;
                m.BodyField = n.BodyField;
            }
            else if (tempActivity is IFLDetailsActivity)
            {
                IFLDetailsActivity m = (IFLDetailsActivity)activity;
                IFLDetailsActivity n = (IFLDetailsActivity)tempActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.DetailsTableName = n.DetailsTableName;
                m.ParallelField = n.ParallelField;
                m.SendToMasterField = n.SendToMasterField;
                m.ParallelMode = n.ParallelMode;
                m.ParallelRate = n.ParallelRate;
                m.RelationKeys = n.RelationKeys;
                m.SendToField = n.SendToField;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FLNavigatorField = n.FLNavigatorField;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;

                m.ExtApproveID = n.ExtApproveID;
                m.ExtGroupField = n.ExtGroupField;
                m.ExtValueField = n.ExtValueField;

                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;

                m.AllowSendBack = n.AllowSendBack;

                m.PlusApprove = n.PlusApprove;
                m.PlusApproveReturn = n.PlusApproveReturn;
            }
            else if (tempActivity is IFLSubFlowActivity)
            {
                IFLSubFlowActivity m = (IFLSubFlowActivity)activity;
                IFLSubFlowActivity n = (IFLSubFlowActivity)tempActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.XomlName = n.XomlName;
            }
            else if (tempActivity is IEventWaiting)
            {
                IEventWaiting m = (IEventWaiting)activity;
                IEventWaiting n = (IEventWaiting)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;

                m.AllowSendBack = n.AllowSendBack;

                if (tempActivity is IFLStandActivity)
                {
                    ((IFLStandActivity)m).PlusApprove = ((IFLStandActivity)n).PlusApprove;
                    ((IFLStandActivity)m).PlusApproveReturn = ((IFLStandActivity)n).PlusApproveReturn;
                    ((IFLStandActivity)m).DelayAutoApprove = ((IFLStandActivity)n).DelayAutoApprove;
                }
                else if (tempActivity is IFLApproveActivity)
                {
                    IFLApproveActivity p = (IFLApproveActivity)activity;
                    IFLApproveActivity q = (IFLApproveActivity)tempActivity;
                    ((IFLApproveActivity)q).PlusApprove = ((IFLApproveActivity)p).PlusApprove;
                    ((IFLApproveActivity)q).PlusApproveReturn = ((IFLApproveActivity)p).PlusApproveReturn;
                    ((IFLApproveActivity)q).DelayAutoApprove = ((IFLApproveActivity)p).DelayAutoApprove;

                    p.Description = q.Description;
                }
                else if (tempActivity is FLApproveBranchActivity)
                {
                    IFLApproveBranchActivity p = (IFLApproveBranchActivity)activity;
                    IFLApproveBranchActivity q = (IFLApproveBranchActivity)tempActivity;

                    p.Expression = q.Expression;
                    p.Grade = q.Grade;
                }
            }
            else if (tempActivity is IFLIfElseActivity)
            {
                IFLIfElseActivity m = (IFLIfElseActivity)activity;
                IFLIfElseActivity n = (IFLIfElseActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (tempActivity is IFLIfElseBranchActivity)
            {
                IFLIfElseBranchActivity m = (IFLIfElseBranchActivity)activity;
                IFLIfElseBranchActivity n = (IFLIfElseBranchActivity)tempActivity;

                m.Enabled = n.Enabled;
                m.Condition = n.Description == null ? string.Empty : n.Description.ToString();
            }
            else if (tempActivity is IFLParallelActivity)
            {
                IFLParallelActivity m = (IFLParallelActivity)activity;
                IFLParallelActivity n = (IFLParallelActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (tempActivity is IFLSequenceActivity)
            {
                IFLSequenceActivity m = (IFLSequenceActivity)activity;
                IFLSequenceActivity n = (IFLSequenceActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (tempActivity is IFLNotifyActivity)
            {
                IFLNotifyActivity m = (IFLNotifyActivity)activity;
                IFLNotifyActivity n = (IFLNotifyActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;
            }
            else if (tempActivity is IFLProcedureActivity)
            {
                IFLProcedureActivity m = (IFLProcedureActivity)activity;
                IFLProcedureActivity n = (IFLProcedureActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ErrorLog = n.ErrorLog;
                m.ErrorToRole = n.ErrorToRole;
                m.MethodName = n.MethodName;
                m.ModuleName = n.ModuleName;
            }
            else if (tempActivity is IFLValidateActivity)
            {
                IFLValidateActivity m = (IFLValidateActivity)activity;
                IFLValidateActivity n = (IFLValidateActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Expression = n.Expression;
                m.Message = n.Message;
            }
            else if (tempActivity is IFLHyperLinkActivity)
            {
                IFLHyperLinkActivity m = (IFLHyperLinkActivity)activity;
                IFLHyperLinkActivity n = (IFLHyperLinkActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Parameters = n.Parameters;
            }
            else if (tempActivity is IFLQueryActivity)
            {
                IFLQueryActivity m = (IFLQueryActivity)activity;
                IFLQueryActivity n = (IFLQueryActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Parameters = n.Parameters;
            }
            else if (tempActivity is IFLRejectActivity)
            {
                IFLRejectActivity m = (IFLRejectActivity)activity;
                IFLRejectActivity n = (IFLRejectActivity)tempActivity;

                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
            }
            else if (tempActivity is IFLGotoActivity)
            {
                IFLGotoActivity m = (IFLGotoActivity)activity;
                IFLGotoActivity n = (IFLGotoActivity)tempActivity;
                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;
                m.ActivityName = n.ActivityName;
            }
            else
            {
                String message = string.Format(SysMsg.GetSystemMessage((SYS_LANGUAGE)(((object[])(_clientInfo[0]))[0]), "FLRuntime", "FLInstance", "NotSupportActivityType"), tempActivity.GetType().Name);
                throw new FLException(message);
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化流程FLActivity
        /// </summary>
        /// <param name="activity"></param>
        /// <param name="wfActivity"></param>
        private void InitFLActivities(IFLActivity activity, object wfActivity)
        {
            //if (wfActivity is IEventWaiting)
            //{
            //    IEventWaiting m = (IEventWaiting)activity;
            //    IEventWaiting n = (IEventWaiting)wfActivity;
            //    m.AllowSendBack = n.AllowSendBack;
            //}

            if (wfActivity is IFLRootActivity)
            {
                IFLRootActivity m = (IFLRootActivity)activity;
                IFLRootActivity n = (IFLRootActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.EEPAlias = n.EEPAlias;
                m.TableName = n.TableName;
                m.Keys = n.Keys;
                m.PresentFields = n.PresentFields;
                m.OrgKind = (_orgKind == null || _orgKind == string.Empty) ? n.OrgKind : _orgKind;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.ExpTime = n.ExpTime;
                m.ExpTimeField = n.ExpTimeField;
                m.UrgentTime = n.UrgentTime;
                m.TimeUnit = n.TimeUnit;
                m.NotifySendMail = n.NotifySendMail;
                m.SkipForSameUser = n.SkipForSameUser;
                m.RejectProcedure = n.RejectProcedure;
                m.BodyField = n.BodyField;
            }
            else if (wfActivity is IFLDetailsActivity)
            {
                IFLDetailsActivity m = (IFLDetailsActivity)activity;
                IFLDetailsActivity n = (IFLDetailsActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.DetailsTableName = n.DetailsTableName;
                m.ParallelField = n.ParallelField;
                m.SendToMasterField = n.SendToMasterField;
                m.ParallelMode = n.ParallelMode;
                m.ParallelRate = n.ParallelRate;
                m.RelationKeys = n.RelationKeys;
                m.SendToField = n.SendToField;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FLNavigatorField = n.FLNavigatorField;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;

                m.ExtApproveID = n.ExtApproveID;
                m.ExtGroupField = n.ExtGroupField;
                m.ExtValueField = n.ExtValueField;

                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;

                m.AllowSendBack = n.AllowSendBack;

                m.PlusApprove = n.PlusApprove;
                m.PlusApproveReturn = n.PlusApproveReturn;

                #region  --- 修改为动态---

                //if (_hostDataSet == null)
                //{
                //    _hostDataSet = HostTable.GetHostDataSet(this, _keyValues, _clientInfo);
                //}

                //Activity temp = FLInstance.GetActivityByXoml(_flDefinitionFile, string.Empty);
                //IFLRootActivity rootActivity = (IFLRootActivity)temp;

                //DataSet detailsDataSet = HostTable.GetDetailsDataSet(_hostDataSet, rootActivity.Keys, n.DetailsTableName, n.RelationKeys, _clientInfo);
                //string parallelField = n.ParallelField;
                //string sendToField = n.SendToField;

                //if (detailsDataSet != null && detailsDataSet.Tables.Count != 0 && detailsDataSet.Tables[0].Rows.Count != 0)
                //{
                //    int i0 = 1;
                //    int i1 = 1;
                //    int i2 = 1;

                //    FLParallelActivity parallelActivity = null;
                //    foreach (DataRow row in detailsDataSet.Tables[0].Rows)
                //    {
                //        FLStandActivity stand = new FLStandActivity();

                //        //stand.Name = n.Name + "_s" + i0.ToString();
                //        stand.Name = n.Name + "_" + i0.ToString();
                //        i0++;

                //        stand.Description = ((FLDetails)n).Description;
                //        stand.Enabled = ((FLDetails)n).Enabled;

                //        stand.ExpTime = ((FLDetails)n).ExpTime;
                //        stand.FLNavigatorMode = ((FLDetails)n).FLNavigatorMode;
                //        stand.FormName = ((FLDetails)n).FormName;
                //        stand.WebFormName = ((FLDetails)n).WebFormName;
                //        stand.NavigatorMode = ((FLDetails)n).NavigatorMode;
                //        stand.Parameters = ((FLDetails)n).Parameters;
                //        stand.SendToField = ((FLDetails)n).SendToField;
                //        stand.SendToKind = ((FLDetails)n).SendToKind;
                //        stand.SendToRole = ((FLDetails)n).SendToRole;
                //        stand.TimeUnit = ((FLDetails)n).TimeUnit;
                //        stand.UrgentTime = ((FLDetails)n).UrgentTime;
                //        stand.SendEmail = ((FLDetails)n).SendEmail;
                //        stand.PlusApprove = false;

                //        object sendToId2 = row[sendToField];
                //        if (sendToId2 == null || sendToId2 == DBNull.Value || sendToId2.ToString() == string.Empty)
                //        {
                //            continue;
                //            //String message = string.Format(SysMsg.GetSystemMessage((SYS_LANGUAGE)(((object[])(_clientInfo[0]))[0]), "FLRuntime", "FLInstance", "SendToFieldValueIsNull"), n.DetailsTableName);
                //            //throw new FLException(message);
                //        }
                //        ((ISupportFLDetailsActivity)stand).SendToId2 = sendToId2.ToString();

                //        if (!string.IsNullOrEmpty(parallelField))
                //        {
                //            object isParallel = row[parallelField];
                //            if ((isParallel != null && isParallel != DBNull.Value) &&
                //                (isParallel.ToString().Trim().ToLower() == "y" || isParallel.ToString().Trim().ToLower() == "and"))
                //            {
                //                if (parallelActivity == null)
                //                {
                //                    parallelActivity = new FLParallelActivity();
                //                    parallelActivity.Description = n.ParallelRate > 0 ? string.Format("rate:{0}", n.ParallelRate) : "and";
                //                    parallelActivity.Name = n.Name + "_p" + i2.ToString();
                //                    i2++;

                //                    ((FLActivity)m).ChildFLActivities.Add(parallelActivity);
                //                }

                //                FLSequenceActivity sequenceActivity = new FLSequenceActivity();
                //                sequenceActivity.Name = n.Name + "_se" + i1.ToString();
                //                i1++;
                //                ((FLActivity)parallelActivity).ChildFLActivities.Add(sequenceActivity);

                //                ((FLActivity)sequenceActivity).ChildFLActivities.Add(stand);
                //            }
                //            else
                //            {
                //                parallelActivity = null;
                //                ((FLActivity)m).ChildFLActivities.Add(stand);
                //            }
                //        }
                //        else
                //        {
                //            parallelActivity = null;
                //            ((FLActivity)m).ChildFLActivities.Add(stand);
                //        }
                //    }
                //}

                #endregion
            }
            else if (wfActivity is IFLSubFlowActivity)
            {
                IFLSubFlowActivity m = (IFLSubFlowActivity)activity;
                IFLSubFlowActivity n = (IFLSubFlowActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.IncludeFirstActivity = n.IncludeFirstActivity;
                m.XomlName = n.XomlName;
                m.XomlField = n.XomlField;
                //    m.Name = n.Name;
                //    m.Description = n.Description;
                //    m.Enabled = n.Enabled;

                //    string xomlName = n.XomlName;

                //    IFLActivity temp1 = new FLRootActivity();

                //    FileInfo fileInfo = new FileInfo(_flDefinitionFile);
                //    string file = fileInfo.Directory + @"\" + xomlName;
                //    Activity temp2 = GetActivityByXoml(file, string.Empty);

                //    InitFLActivities(temp1, temp2);

                //    List<string> temp3 = new List<string>();
                //    foreach (FLActivity a in ((FLActivity)temp1).ChildFLActivities)
                //    {
                //        temp3.Add(a.Name);
                //    }

                //    bool isFirst = true;
                //    foreach (string k in temp3)
                //    {
                //        if (isFirst && !n.IncludeFirstActivity)
                //        {
                //            isFirst = false; continue;
                //        }

                //        FLActivity temp4 = ((FLActivity)temp1).GetFLActivityByName(k);
                //        temp4.Enabled = n.Enabled;

                //        ((FLActivity)temp1).ChildFLActivities.Remove(temp4);
                //        ((FLActivity)m).ChildFLActivities.Add(temp4);
                //    }
            }
            else if (wfActivity is IEventWaiting)
            {
                IEventWaiting m = (IEventWaiting)activity;
                IEventWaiting n = (IEventWaiting)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;

                m.AllowSendBack = n.AllowSendBack;

                if (wfActivity is IFLStandActivity)
                {
                    ((IFLStandActivity)m).PlusApprove = ((IFLStandActivity)n).PlusApprove;
                    ((IFLStandActivity)m).PlusApproveReturn = ((IFLStandActivity)n).PlusApproveReturn;
                    ((IFLStandActivity)m).DelayAutoApprove = ((IFLStandActivity)n).DelayAutoApprove;
                }
                else if (wfActivity is IFLApproveActivity)
                {
                    IFLApproveActivity q = (IFLApproveActivity)activity;
                    IFLApproveActivity p = (IFLApproveActivity)wfActivity;

                    ((IFLApproveActivity)q).PlusApprove = ((IFLApproveActivity)p).PlusApprove;
                    ((IFLApproveActivity)q).PlusApproveReturn = ((IFLApproveActivity)p).PlusApproveReturn;
                    ((IFLApproveActivity)q).DelayAutoApprove = ((IFLApproveActivity)p).DelayAutoApprove;

                    List<IFLApproveBranchActivity> list = p.GetApproveRights();
                    foreach (IFLApproveBranchActivity a in list)
                    {
                        FLApproveBranchActivity approveBranch = new FLApproveBranchActivity();
                        approveBranch.Grade = a.Grade;
                        approveBranch.Expression = a.Expression;
                        approveBranch.Name = activity.Name + "-" + a.Name;

                        approveBranch.Description = m.Description;
                        approveBranch.ExpTime = m.ExpTime;
                        approveBranch.FLNavigatorMode = m.FLNavigatorMode;
                        approveBranch.FormName = m.FormName;
                        approveBranch.WebFormName = m.WebFormName;
                        approveBranch.NavigatorMode = m.NavigatorMode;
                        approveBranch.Parameters = m.Parameters;
                        approveBranch.SendToField = m.SendToField;
                        approveBranch.SendToKind = m.SendToKind;
                        approveBranch.SendToRole = m.SendToRole;
                        approveBranch.SendToUser = m.SendToUser;
                        approveBranch.TimeUnit = m.TimeUnit;
                        approveBranch.UrgentTime = m.UrgentTime;
                        approveBranch.SendEmail = m.SendEmail;
                        approveBranch.AllowSendBack = m.AllowSendBack;

                        approveBranch.ParentActivity = activity.Name;
                        activity.AddFLActivity(approveBranch);
                    }
                }
            }
            else if (wfActivity is IfElseActivity)
            {
                IFLIfElseActivity m = (IFLIfElseActivity)activity;
                IfElseActivity n = (IfElseActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (wfActivity is IfElseBranchActivity)
            {
                IFLIfElseBranchActivity m = (IFLIfElseBranchActivity)activity;
                IfElseBranchActivity n = (IfElseBranchActivity)wfActivity;

                m.Name = n.Name;
                m.Condition = n.Description == null ? string.Empty : n.Description.ToString();
                m.Description = n.Description;
                m.Enabled = n.Enabled;
                //m.Condition = n.Condition == null ? string.Empty : n.Condition.ToString();
            }
            else if (wfActivity is ParallelActivity)
            {
                IFLParallelActivity m = (IFLParallelActivity)activity;
                ParallelActivity n = (ParallelActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (wfActivity is SequenceActivity)
            {
                IFLSequenceActivity m = (IFLSequenceActivity)activity;
                SequenceActivity n = (SequenceActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;
            }
            else if (wfActivity is IFLNotifyActivity)
            {
                IFLNotifyActivity m = (IFLNotifyActivity)activity;
                IFLNotifyActivity n = (IFLNotifyActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;
            }
            else if (wfActivity is IFLProcedureActivity)
            {
                IFLProcedureActivity m = (IFLProcedureActivity)activity;
                IFLProcedureActivity n = (IFLProcedureActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ErrorLog = n.ErrorLog;
                m.ErrorToRole = n.ErrorToRole;
                m.MethodName = n.MethodName;
                m.ModuleName = n.ModuleName;
            }
            else if (wfActivity is IFLValidateActivity)
            {
                IFLValidateActivity m = (IFLValidateActivity)activity;
                IFLValidateActivity n = (IFLValidateActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Expression = n.Expression;
                m.Message = n.Message;
            }
            else if (wfActivity is IFLHyperLinkActivity)
            {
                IFLHyperLinkActivity m = (IFLHyperLinkActivity)activity;
                IFLHyperLinkActivity n = (IFLHyperLinkActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Parameters = n.Parameters;
            }
            else if (wfActivity is IFLQueryActivity)
            {
                IFLQueryActivity m = (IFLQueryActivity)activity;
                IFLQueryActivity n = (IFLQueryActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.Parameters = n.Parameters;
            }
            else if (wfActivity is IFLRejectActivity)
            {
                IFLRejectActivity m = (IFLRejectActivity)activity;
                IFLRejectActivity n = (IFLRejectActivity)wfActivity;

                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;

                m.ExpTime = n.ExpTime;
                m.FLNavigatorMode = n.FLNavigatorMode;
                m.FormName = n.FormName;
                m.WebFormName = n.WebFormName;
                m.NavigatorMode = n.NavigatorMode;
                m.Parameters = n.Parameters;
                m.SendToField = n.SendToField;
                m.SendToKind = n.SendToKind;
                m.SendToRole = n.SendToRole;
                m.SendToUser = n.SendToUser;
                m.TimeUnit = n.TimeUnit;
                m.UrgentTime = n.UrgentTime;
                m.SendEmail = n.SendEmail;
            }
            else if (wfActivity is IFLGotoActivity)
            {
                IFLGotoActivity m = (IFLGotoActivity)activity;
                IFLGotoActivity n = (IFLGotoActivity)wfActivity;
                m.Name = n.Name;
                m.Description = n.Description;
                m.Enabled = n.Enabled;
                m.ActivityName = n.ActivityName;
            }
            else
            {
                String message = string.Format(SysMsg.GetSystemMessage((SYS_LANGUAGE)(((object[])(_clientInfo[0]))[0]), "FLRuntime", "FLInstance", "NotSupportActivityType"), wfActivity.GetType().Name);
                throw new FLException(message);
            }

            if (wfActivity is CompositeActivity)
            {
                CompositeActivity compositeActivity = (CompositeActivity)wfActivity;
                foreach (Activity child in compositeActivity.Activities)
                {
                    IFLActivity a = null;
                    if (child is IFLSubFlowActivity)
                    {
                        //a = new FLSequenceActivity();
                        a = new FLSubFlowActivity();
                    }
                    else if (child is IFLDetailsActivity)
                    {
                        //a = new FLSequenceActivity();
                        a = new FLDetailsActivity();
                    }
                    else if (child is IFLStandActivity)
                    {
                        a = new FLStandActivity();
                    }
                    else if (child is IFLApproveActivity)
                    {
                        a = new FLApproveActivity();
                    }
                    else if (child is IfElseActivity)
                    {
                        a = new FLIfElseActivity();
                    }
                    else if (child is IfElseBranchActivity)
                    {
                        a = new FLIfElseBranchActivity();
                    }
                    else if (child is ParallelActivity)
                    {
                        a = new FLParallelActivity();
                    }
                    else if (child is SequenceActivity)
                    {
                        a = new FLSequenceActivity();
                    }
                    else if (child is IFLNotifyActivity)
                    {
                        a = new FLNotifyActivity();
                    }
                    else if (child is IFLProcedureActivity)
                    {
                        a = new FLProcedureActivity();
                    }
                    else if (child is IFLValidateActivity)
                    {
                        a = new FLValidateActivity();
                    }
                    else if (child is IFLHyperLinkActivity)
                    {
                        a = new FLHyperLinkActivity();
                    }
                    else if (child is IFLQueryActivity)
                    {
                        a = new FLQueryActivity();
                    }
                    else if (child is IFLRejectActivity)
                    {
                        a = new FLRejectActivity();
                    }
                    else if (child is IFLGotoActivity)
                    {
                        a = new FLGotoActivity();
                    }
                    else
                    {
                        String message = string.Format(SysMsg.GetSystemMessage((SYS_LANGUAGE)(((object[])(_clientInfo[0]))[0]), "FLRuntime", "FLInstance", "NotSupportActivityType"), wfActivity.GetType().Name);
                        throw new FLException(message);
                    }

                    activity.AddFLActivity(a);
                    InitFLActivities(a, child);
                }
            }
        }