/// <summary> /// 创建迁移实例 /// </summary> /// <param name="p_tatvid">目标活动模板标识</param> /// <param name="p_tatviid">目标活动实例标识</param> /// <param name="p_date">创建时间</param> /// <param name="p_rollback">是否回退</param> /// <returns></returns> internal async Task <WfiTrs> CreateAtvTrs(long p_tatvid, long p_tatviid, DateTime p_date, bool p_rollback) { Dict dt = new Dict(); dt["prcid"] = PrcInst.PrcdID; dt["SrcAtvID"] = AtvInst.AtvdID; dt["TgtAtvID"] = p_tatvid; dt["IsRollback"] = p_rollback; long trsdid = await AtCm.GetScalar <long>("流程-迁移模板ID", dt); Throw.If(trsdid == 0, "未找到流程迁移模板"); return(new WfiTrs( ID: await AtCm.NewID(), TrsdID: trsdid, SrcAtviID: AtvInst.ID, TgtAtviID: p_tatviid, IsRollback: p_rollback, Ctime: p_date)); }
async Task CreateWorkItem() { AtvDef = await AtCm.First <WfdAtv>("流程-起始活动", new { prcid = _prcID }); PrcInst = new WfiPrc( ID: await AtCm.NewID(), PrcdID: _prcID, Name: PrcDef.Name); AtvInst = new WfiAtv( ID: await AtCm.NewID(), PrciID: PrcInst.ID, AtvdID: AtvDef.ID, InstCount: 1); WorkItem = new WfiItem( ID: await AtCm.NewID(), AtviID: AtvInst.ID, AssignKind: WfiItemAssignKind.起始指派, IsAccept: true, Status: WfiItemStatus.活动, UserID: Kit.UserID, Sender: Kit.UserName); }