internal TaskInstance(ProcessInstance processInstance, Task task, wf_taskInstance model = null)
 {
     _processInstance = processInstance;
     _task = task;
     if (_model == null)
     {
         var bpmContext = processInstance.getBpmContext();
         _model = new wf_taskInstance();
         _model.ProcessInstanceId = processInstance.getProcessInstanceModel().Id;
         _model.Id = bpmContext.save(this);
     }
 }
Exemple #2
0
        public TaskInstance loadOrCreateTaskInstance(ProcessInstance processInstance)
        {
            if (this.NodeType == NodeType.Join)
            {
                wf_taskInstance dataTaskInstance = null;
                var bpmContext = processInstance.getBpmContext();
                switch (this.LogicType)
                {
                    case LogicType.AND:         //join的Token停留在Temp等待
                        dataTaskInstance = bpmContext.loadDataTaskInstanceFirstRun(processInstance.getProcessInstanceModel().Id, this.Name);
                        return this.loadTaskInstance(processInstance, dataTaskInstance);
                        break;
                    case LogicType.OR:          //join的Token不停留Temp
                        dataTaskInstance = bpmContext.loadDataTaskInstanceFirst(processInstance.getProcessInstanceModel().Id, this.Name);
                        return this.loadTaskInstance(processInstance, dataTaskInstance);
                        break;
                }

            }
            return createTaskInstance(processInstance);
        }
Exemple #3
0
 public TaskInstance loadTaskInstance(ProcessInstance processInstance, wf_taskInstance model)
 {
     return new TaskInstance(processInstance, this, model);
 }
Exemple #4
0
 public TaskInstance createTaskInstance(ProcessInstance processInstance)
 {
     return new TaskInstance(processInstance, this, null);
 }
 //保存流程实例
 public int save(ProcessInstance processInstance)
 {
     var model = processInstance.getProcessInstanceModel();
     var result = save<wf_processInstance>(model);
     return result;
 }