public WfActivity(Actinst actins) : base(actins) { this.actinst = actins; this.process = WfFactory.GetWfProcess(this.actinst.Proinst); this.executor = WfActivityAbstractImplFact.GetConcretImpl(this); }
public static IWfActivity GetWfActivity(Actinst actinst) { if (actinst == null) { throw new WfException("Actinst cannot be null"); } return new WfActivity(actinst); }
public WfActivity(Actdef actdef, IWfProcess process) : base(new Actinst(), actdef) { this.actinst = base.wfInstance as Actinst; this.process = process; this.actinst.Proinst = (Proinst) process.GetInstanceObject(); this.actinst.ActdefId = actdef.Id; this.actinst.ActdefName = actdef.Name; this.actinst.DueTime = actdef.Limit; this.actinst.Name = actdef.Name; this.actinst.Type = actdef.Type; this.actinst.FromCount = 0; this.actinst.ToCount = 0; this.executor = WfActivityAbstractImplFact.GetConcretImpl(this); }
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 RefreshFrom(Actinst from) { WfFactory.GetWfActivity(from).ChangeStatus(WfStatusType.WF_RUNNING); from.FromCount--; WfResinst wfResinst = from.WfResinst; foreach (WfAssigninst assigninst in wfResinst.Assigns) { WfFactory.GetWfAssignment(assigninst).ChangeStatus(AssignStatusType.Accepted); } }
private void DeleteToInstance(Actinst from, Actinst to, IDA0 dao) { Actinst actinst = to; do { IEnumerator<WfRouteInst> enumerator = actinst.RouteToMe.GetEnumerator(); enumerator.MoveNext(); WfRouteInst current = enumerator.Current; dao.Put(actinst, DAOType.DELETE); actinst = current.From; if ((actinst.FromCount > 1) || (actinst.ToCount > 1)) { throw new CannotCallBackException("Cannot call a 'multi branch or multi branch' instance:" + actinst.Id); } } while (actinst.Id != from.Id); }