private void SetWfResInst(CParticipant part, Actinst actinst) { this.wfResinst.Actinst = actinst; this.wfResinst.ParticipantId = part.Id; this.wfResinst.ParticipantName = part.Name; this.wfResinst.IsAssigned = false; this.wfResinst.AssignRule = part.AssignRule; string type = part.ParticipantEntity.Type; this.wfResinst.ParticipantType = type; switch (type.ToUpper()) { case "ROLE": this.wfResinst.RoleId = part.ParticipantEntity.IdValue; this.wfResinst.RoleName = part.Name; return; case "DEPT": this.wfResinst.DeptId = part.ParticipantEntity.IdValue; this.wfResinst.DeptName = part.Name; return; case "STAFF": { this.wfResinst.StaffId = part.ParticipantEntity.IdValue; CStaff staff = OGMService.GetStaff(this.wfResinst.StaffId); if (staff != null) { this.wfResinst.StaffName = staff.Name; } return; } case "ALL": case "AUTO": return; } throw new WfException("Not supported participant type"); }
private void Init(IWfActivity wfActivity, CParticipant part) { Actinst instanceObject = wfActivity.GetInstanceObject() as Actinst; this.wfActivity = wfActivity; this.wfResinst = instanceObject.WfResinst; if (this.wfResinst == null) { this.wfResinst = new WfResinst(); this.SetWfResInst(part, instanceObject); } WfLogicalPassContextData passContextData = WfUtil.GetPassContextData(); if (passContextData != null) { this.SetWfResInst(passContextData); } }
public WfResource(IWfActivity wfActivity, CParticipant part) { this.Init(wfActivity, part); this.CreateAssignment(); this.Store(); }
public static IList<CStaff> GetStaffsOfParticipant(CParticipant part) { return OGMService.GetStaffs(part.ParticipantEntity.Type.ToUpper(), part.ParticipantEntity.IdValue); }