Exemple #1
0
 /// <summary>
 /// 系统表单获取表单数据
 /// </summary>
 /// <param name="getFrmData"></param>
 /// <param name="nodeId"></param>
 /// <returns></returns>
 private string GetNodeFrmData(GetFrmData getFrmData, string nodeId = null)
 {
     try
     {
         string  _nodeId = (nodeId == null ? _runtimeModel.currentNodeId : nodeId);
         dynamic _node   = _runtimeModel.nodeDictionary[_nodeId];
         if (_node.setInfo != null)
         {
             return(getFrmData(_node.setInfo.NodeDataBase.Value, _node.setInfo.NodeTable.Value, _node.setInfo.NodePram.Value, _runtimeModel.processId));
         }
         else
         {
             return("");
         }
     }
     catch
     {
         throw;
     }
 }
Exemple #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="schemeContent">流程模板</param>
        /// <param name="currentNodeId">当前节点</param>
        /// <param name="frmData">表单数据</param>
        public WF_Runtime(WF_RuntimeInitModel wfRuntimeInitModel, GetFrmData getFrmData = null)
        {
            _runtimeModel = new WF_RuntimeModel();
            _getFrmData   = getFrmData;
            dynamic schemeContentJson = wfRuntimeInitModel.schemeContent.ToJson();  //获取工作流模板内容的json对象;

            _runtimeModel.schemeContentJson = schemeContentJson;                    //模板流程json对象
            _runtimeModel.nodeDictionary    = GetNodeDictionary(schemeContentJson); //节点集合
            _runtimeModel.lineDictionary    = GetLineDictionary(schemeContentJson); //线条集合
            _runtimeModel.currentNodeId     = (wfRuntimeInitModel.currentNodeId == "" ? _runtimeModel.startNodeId : wfRuntimeInitModel.currentNodeId);
            _runtimeModel.currentNodeType   = GetNodeStatus(_runtimeModel.currentNodeId);
            _runtimeModel.frmData           = wfRuntimeInitModel.frmData;
            if (getFrmData != null)
            {
                _runtimeModel.frmType      = 1;
                wfRuntimeInitModel.frmData = GetNodeFrmData(getFrmData);
            }
            else
            {
                _runtimeModel.frmType = 0;
            }

            if (_runtimeModel.currentNodeType == 0 || _runtimeModel.currentNodeType == 4)
            {
                _runtimeModel.nextNodeId   = "-1";//下一个节点
                _runtimeModel.nextNodeType = -1;
            }
            else
            {
                _runtimeModel.nextNodeId   = GetNextNode(wfRuntimeInitModel.frmData);//下一个节点
                _runtimeModel.nextNodeType = GetNodeStatus(_runtimeModel.nextNodeId);
            }

            _runtimeModel.previousId = wfRuntimeInitModel.previousId;

            _runtimeModel.processId = wfRuntimeInitModel.processId;
            _runtimeModel.sqlFrm    = SqlBuider(schemeContentJson, wfRuntimeInitModel.frmData, wfRuntimeInitModel.processId);
        }