中间件底层,websocket

IvrFlow.h 3.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*************************************************************************
  2. 【文件名】 IvrFlow.h
  3. 【功能模块和目的】 流程基类头文件
  4. 【开发者及日期】 郑石诺 2015/01/24
  5. 【版本】 V1.0.0
  6. 【版权信息】 Copyright (C)2015 河南加一信息技术有限公司
  7. 【更改记录】
  8. *************************************************************************/
  9. #pragma once
  10. class CFlowTemplate;
  11. class CCellBase;
  12. /*************************************************************************
  13. 【类名】 CIvrFlow
  14. 【功能】
  15. 【接口说明】 流程基类
  16. 【开发者及日期】 郑石诺 2015/01/24
  17. 【版本】 V1.0.0
  18. 【版权信息】 Copyright (C)2015 河南加一信息技术有限公司
  19. 【更改记录】
  20. *************************************************************************/
  21. class CIvrFlow : public CWnd
  22. {
  23. DECLARE_DYNAMIC(CIvrFlow)
  24. public:
  25. CIvrFlow(int Id);
  26. virtual ~CIvrFlow(void);
  27. int id(void) const { return m_Id; } // 获取流程Id
  28. IVR_FLOW_STATE state(void) const { return m_State; } // 获取流程状态
  29. IVR_FLOW_STATE& state(void) { return m_State; }
  30. bool hangUpSign(void) const { return m_IsHangUp; } // 获取挂机标识
  31. bool& hangUpSign(void) { return m_IsHangUp; }
  32. DataSet& recordSet(void) { return m_RecordSet; } // 流程附属数据库操作记录集
  33. CFlowTemplate* CurrentTemp(void) { return m_pFlowTemplate; }
  34. ULONG assoCallId(void) const { return m_AssoCallId; }
  35. CCellBase* currentCell(void) { return m_pCurrentCell; }
  36. int start(CFlowTemplate* pFlowTemp = NULL, int StartPos = 1); // 开始流程
  37. int next(int NextPos); // 执行流程
  38. int procPdu(CPduEntity* pPduEntity); // 处理Pdu命令
  39. void onNetLinkUpdated(bool IsConnect); // 响应网络断开或连接
  40. void addVar(const CString& VarName, const CString& VarValue); // 添加流程系统变量
  41. bool findVarValue(const CString& VarName, CString& VarValue); // 查找系统变量的值
  42. bool replaceVar(const CString& Src, CString& Dst); // 根据流程中的变量对指定字符串进行替换
  43. void copyVar(CIvrFlow& DestFlow); // 复制系统变量
  44. // 保存流程信息
  45. void setFlowInfo(ULONG CallId, UINT TrunkId, const CString& CallerNum, const CString& CalleeNum);
  46. void setFlowInfo(ULONG CallId, UINT TrunkId, const CString& CallerNum, const CString& CalleeNum,const CString& UUID);
  47. void setFlowInfo(ULONG CallId, UINT TrunkId, int TaskId, UINT OpType, const CString& CallerNum, const CString& CalleeNum);
  48. void setFlowAssoData(CString AssoData);
  49. void onTimerTimeUp(int NextPos);
  50. private:
  51. void __release(void); // 释放资源
  52. void __clearFlow(void); // 清理流程
  53. void __deleteCurrentCell(void); // 删除当前节点
  54. void __onTimerTimeOut(void); // 流程节点最大执行时间超时
  55. void __onNextCellNull(int NullCellPos);
  56. protected:
  57. DECLARE_MESSAGE_MAP()
  58. afx_msg void OnTimer(UINT_PTR nIDEvent);
  59. private:
  60. typedef CMap<CString, LPCTSTR, CString, LPCTSTR> VarTable;
  61. int m_Id; // 流程Id
  62. IVR_FLOW_STATE m_State; // 流程状态
  63. bool m_IsHangUp; // 是否有未处理的挂机命令
  64. bool m_IsNetLinkUp; // 网络是否连接
  65. ULONG m_AssoCallId; // 关联CallId
  66. CFlowTemplate* m_pFlowTemplate; // 流程文件类指针
  67. CCellBase* m_pCurrentCell; // 保存当前执行Cell
  68. VarTable m_VarTable; // 流程变量表
  69. DataSet m_RecordSet; // 从数据库中读取记录的值列表
  70. };