示例#1
0
 public static IWfActivity GetWfActivity(Actdef actdef, IWfProcess process)
 {
     if (actdef == null)
     {
         throw new WfException("Actdef cannot be null");
     }
     if (process == null)
     {
         throw new WfException("WfProcess cannot be null");
     }
     return new WfActivity(actdef, process);
 }
 public WfExecutionOjbect(WfInstanceElement wfinstance, Actdef actdef)
 {
     if (LoggingService.IsInfoEnabled)
     {
         LoggingService.Info("Init the WfActivity");
     }
     this.wfInstance = wfinstance;
     this.wfInstance.Name = actdef.Name;
     Prodef prodef = actdef.Prodef;
     this.InitInstByProdef(prodef);
     this.InitElse();
 }
示例#3
0
 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);
 }
示例#4
0
 public void AddActdef(string actdefID, string actdefName, ActdefType actdefType, bool actdefEnabled, int xPos, int yPos)
 {
     Actdef actdef = new Actdef();
     actdef.Id = actdefID;
     actdef.Name = actdefName;
     actdef.Type = actdefType;
     actdef.Status = actdefEnabled;
     actdef.Description = string.Empty;
     actdef.Prodef = this.Prodef;
     actdef.IsDefaultInit = actdefType == ActdefType.INITIAL;
     actdef.IsSubflowSync = false;
     actdef.PassNeedInteraction = actdefType == ActdefType.INTERACTION;
     actdef.MNMergeNum = 0;
     actdef.XPos = xPos;
     actdef.YPos = yPos;
     actdef.Froms = new List<Transition>();
     actdef.Tos = new List<Transition>();
     this.CurrentUnitOfWork.RegisterNew(actdef);
     this.Prodef.Actdefs.Add(actdefID, actdef);
 }
示例#5
0
 private void StartActivity(Actdef actdef)
 {
     if (LoggingService.IsInfoEnabled)
     {
         LoggingService.Info("Attemp to start actins:" + actdef.Name);
     }
     WfFactory.GetWfActivity(actdef, this).Start();
 }
 private static IList<Transition> GetInteractionTrans(Actdef actdef)
 {
     IList<Transition> froms = new List<Transition>();
     foreach (Transition transition in actdef.Froms)
     {
         ActdefType type = transition.To.Type;
         if (type != ActdefType.INTERACTION)
         {
             if (type == ActdefType.OR_BRANCH)
             {
                 goto Label_0040;
             }
             goto Label_004E;
         }
         froms = actdef.Froms;
         goto Label_005C;
     Label_0040:
         froms = transition.To.Froms;
         goto Label_005C;
     Label_004E:
         froms = GetInteractionTrans(transition.To);
     Label_005C:
         if (froms.Count > 0)
         {
             return froms;
         }
     }
     return froms;
 }
 public WfActdefFormPermission(SkyMap.Net.Workflow.XPDL.Actdef actdef)
 {
     this.actdef = actdef;
 }
 protected void CreateNextActivity(Actdef nextactdef)
 {
     IWfActivity mergeActivity = this.GetMergeActivity(nextactdef);
     if (mergeActivity == null)
     {
         mergeActivity = WfFactory.GetWfActivity(nextactdef, this.wfActivity.Container);
     }
     if ((mergeActivity.WfState == WfStateType.Open) && (mergeActivity.WhileOpen == WhileOpenType.NotRunning))
     {
         mergeActivity.Start();
     }
     this.CreateRouteInstance(mergeActivity);
     if ((mergeActivity.WfState == WfStateType.Open) && (mergeActivity.WhileOpen == WhileOpenType.Running))
     {
         mergeActivity.Complete();
     }
     this.CreateWfResource(mergeActivity);
 }
 protected IWfActivity GetMergeActivity(Actdef nextactdef)
 {
     if (((nextactdef.Type == ActdefType.AND_MERGE) || (nextactdef.Type == ActdefType.OR_MERGE)) || (nextactdef.Type == ActdefType.MN_MERGE))
     {
         IList<Actinst> list = DaoUtil.GetDaoInstance("SkyMap.Net.Workflow").Query<Actinst>("GetActinstByProinstAndActdef", new object[] { this.wfActivity.Key, nextactdef.Id });
         if (list.Count == 0)
         {
             return null;
         }
         Actinst branchActinst = this.GetBranchActinst(this.wfActivity.Key);
         if ((branchActinst == null) || (branchActinst.FromCount == 1))
         {
             return null;
         }
         foreach (Actinst actinst2 in list)
         {
             if (this.GetBranchActinst(actinst2.Id).Id == branchActinst.Id)
             {
                 return WfFactory.GetWfActivity(actinst2);
             }
         }
     }
     return null;
 }
示例#10
0
 private string GetUnitName(Actdef actdef)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(actdef.Name);
     foreach (Actinst actinst in this.mProinst.Actinsts)
     {
         if (actinst.ActdefId == actdef.Id)
         {
             foreach (WfAssigninst assigninst in actinst.Assigns)
             {
                 builder.AppendFormat("\r\n经办人:{0};状态:{1}", string.IsNullOrEmpty(assigninst.StaffName) ? "没有指定经办人" : assigninst.StaffName, WfUtil.GetSMNAssignStatus(assigninst));
             }
             if (actdef.Limit > 0.0)
             {
                 double num = WfUtil.GetCostTime(actinst) - actinst.DueTime;
                 if (num > 0.0)
                 {
                     builder.AppendFormat("\r\n超期{0}天", num);
                 }
             }
             break;
         }
     }
     return builder.ToString();
 }
示例#11
0
 private IList<Transition> GetTransFrom(Actdef fromActdef)
 {
     IList<Transition> froms;
     try
     {
         froms = fromActdef.Froms;
     }
     catch (ApplicationException exception)
     {
         throw new WfException(exception.Message, exception);
     }
     return froms;
 }