BN089-BS开发框架MVC4版/source20131023/Zephyr.Net/Zephyr.WorkFlow/Excute/ProcessInstance.cs

(开头部分) 14KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Collections;

namespace Zephyr.WorkFlow
{
    public class ProcessInstance
    {
      
        #region 新版
        private ProcessDefinition _processDefinition;
        private wf_processInstance _model;

        internal ProcessInstance(ProcessDefinition processDefinition,wf_processInstance model=null)
        {
            _processDefinition = processDefinition;
            _model = model;
            if (_model == null) //create new
            {
                _model = new wf_processInstance();
                //_model.ProcessDefinitionId = processDefinition.GetId();
                _model.Id = _processDefinition.getBpmContext().save(this);
            }
        }
 
        public ProcessInstance start()
        {
            _model.StartTime = DateTime.Now;
            _model.ProcessState = ProcessState.Run.ToString();

            var startTask = _processDefinition.getStartTask();
            var startTaskInstance = startTask.createTaskInstance(this);
            var rootToken = startTaskInstance.createToken();
            rootToken.signal();
            //var taskInstance = new TaskInstance
            //var startTask = _processDefinition.GetStartTask();
            //var taskInstance = new TaskInstance(this, startTask); //声明流程工作项的实例 创建流程工作项
 
            //_token = new Token(taskInstance);//声明Token的实例  创建Token
            //_token.Reactivate(true);
            //this._bpmContext.save(this);

            ////启动流程
            //_token.Signal();
            return this;
        }

        //暂停
        public ProcessInstance suspend()
        {
            _model.ProcessState = ProcessState.Pending.ToString();
            _model.EndTime = DateTime.Now;
            return this;
        }

        //恢复
        public ProcessInstance resume()
        {
            _model.ProcessState = ProcessState.Run.ToString();
            _model.EndTime = null;
后面还有 414 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。