| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /*************************************************************************
- 【文件名】 IvrFlow.h
- 【功能模块和目的】 流程基类头文件
- 【开发者及日期】 郑石诺 2015/01/24
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- class CFlowTemplate;
- class CCellBase;
- /*************************************************************************
- 【类名】 CIvrFlow
- 【功能】
- 【接口说明】 流程基类
- 【开发者及日期】 郑石诺 2015/01/24
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CIvrFlow : public CWnd
- {
- DECLARE_DYNAMIC(CIvrFlow)
- public:
- CIvrFlow(int Id);
- virtual ~CIvrFlow(void);
- int id(void) const { return m_Id; } // 获取流程Id
- IVR_FLOW_STATE state(void) const { return m_State; } // 获取流程状态
- IVR_FLOW_STATE& state(void) { return m_State; }
- bool hangUpSign(void) const { return m_IsHangUp; } // 获取挂机标识
- bool& hangUpSign(void) { return m_IsHangUp; }
- DataSet& recordSet(void) { return m_RecordSet; } // 流程附属数据库操作记录集
- CFlowTemplate* CurrentTemp(void) { return m_pFlowTemplate; }
- ULONG assoCallId(void) const { return m_AssoCallId; }
- CCellBase* currentCell(void) { return m_pCurrentCell; }
- int start(CFlowTemplate* pFlowTemp = NULL, int StartPos = 1); // 开始流程
- int next(int NextPos); // 执行流程
- int procPdu(CPduEntity* pPduEntity); // 处理Pdu命令
- void onNetLinkUpdated(bool IsConnect); // 响应网络断开或连接
-
- void addVar(const CString& VarName, const CString& VarValue); // 添加流程系统变量
- bool findVarValue(const CString& VarName, CString& VarValue); // 查找系统变量的值
- bool replaceVar(const CString& Src, CString& Dst); // 根据流程中的变量对指定字符串进行替换
- void copyVar(CIvrFlow& DestFlow); // 复制系统变量
- // 保存流程信息
- void setFlowInfo(ULONG CallId, UINT TrunkId, const CString& CallerNum, const CString& CalleeNum);
- void setFlowInfo(ULONG CallId, UINT TrunkId, int TaskId, UINT OpType, const CString& CallerNum, const CString& CalleeNum);
- void setFlowAssoData(CString AssoData);
- void onTimerTimeUp(int NextPos);
- private:
- void __release(void); // 释放资源
- void __clearFlow(void); // 清理流程
- void __deleteCurrentCell(void); // 删除当前节点
- void __onTimerTimeOut(void); // 流程节点最大执行时间超时
- void __onNextCellNull(int NullCellPos);
- protected:
- DECLARE_MESSAGE_MAP()
- afx_msg void OnTimer(UINT_PTR nIDEvent);
- private:
- typedef CMap<CString, LPCTSTR, CString, LPCTSTR> VarTable;
- int m_Id; // 流程Id
- IVR_FLOW_STATE m_State; // 流程状态
- bool m_IsHangUp; // 是否有未处理的挂机命令
- bool m_IsNetLinkUp; // 网络是否连接
- ULONG m_AssoCallId; // 关联CallId
- CFlowTemplate* m_pFlowTemplate; // 流程文件类指针
- CCellBase* m_pCurrentCell; // 保存当前执行Cell
- VarTable m_VarTable; // 流程变量表
- DataSet m_RecordSet; // 从数据库中读取记录的值列表
- };
|