コード例 #1
0
        /// <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);
        }