/// <summary>
        /// 创建流程实例(不保存入库)
        /// </summary>
        /// <param name="id">编号</param>
        /// <param name="category">分类</param>
        /// <param name="uid">创建人</param>
        /// <param name="depLevel1">中心及职能部门</param>
        /// <param name="depLevel2">中心下属部门</param>
        /// <returns>流程实例</returns>
        public static FlowEngine Build(ProjectEntity projectEntity, FlowKinkEntity flowKinkEntity, int userId)
        {
            //获取当前模板
            FlowAttachment flowAttachment = new FlowAttachment() { Owner = projectEntity.Id, Kind = flowKinkEntity.id };
            flowAttachment.Creater = userId;

            FlowManager flowMgr = FlowManager.Instance();
            FlowEngine flowEngine = flowMgr.TemplateLoad(flowKinkEntity.C_Template);
            flowEngine.Attachment = flowAttachment;

            FlowHelper.Concat(flowAttachment.Owner, flowEngine);

            return flowEngine;
        }
 /// <summary>
 /// 提交流程
 /// </summary>
 /// <param name="id">编号</param>        
 /// <param name="category">分类</param>
 /// <param name="uid">创建人</param>
 /// <param name="depLevel1">中心及职能部门</param>
 /// <param name="depLevel2">中心下属部门</param>
 /// <param name="IsSubmit">1说明是提交流程,需要执行DeleteWorkFlow删除流程数据</param>
 /// <returns></returns>
 public static void Commit(ProjectEntity projectEntity, FlowKinkEntity flowKinkEntity, int userId, bool isSubmit)
 {
     FlowEngine flowEngine = FlowHelper.Build(projectEntity, flowKinkEntity, userId);
     if (isSubmit) FlowManager.Instance().Delete(projectEntity.Id);
     FlowManager.Instance().FlowSave(flowEngine);
 }