驰骋工作流引擎

注册

 

发新话题 回复该主题

SDK开发小结 [复制链接]

1#
从开始研究CCFLOW到现在已经快两个月了,这中间也出过不少问题,但最后基本上都圆满的解决了,目前系统已经将ccflow工作流系统、Soaoffice在线office插件、Rtx即时通讯软件完美集成,本来是想用ccim的,最后可惜目前暂不支持Oracle数据库,最后选择了rtx,目前rtx已经可以免费使用了,ccflow可以考虑以后将rtx也集成进来,给用户多一种选择,在开发时注意以下几点1、一定要熟悉ccflow的主要流程表结构,这样可以极大的方便你二次开发 2、遇到问题多问,不要死钻牛角尖,比如条件转向的问题,在ccfllw中条件转向时最好使用单一条件,不要使用复合条件,如果非得使用复合条件,那你完全可以把这部分判断移到你的业务逻辑中判断 3、不要动不动就更新程序,如果你的程序运行没有什么问题,而且更新的内容也和你的流程没有多大关系时就不要更新了,以前我也是一有新版本就更新,结果经常出来更新后程序就不能编译了,解决办法只能是删除了重来一次,太麻烦,其它很多更新是和你的SDK开发没有多大关系的 4、不要以为ccflow可以完全解决你所有的问题,有些需求你变通一下不经过ccflow完全可以解决 5、很多时候如果你刚更新了系统,发现流程运行的时候出现莫名其秒的错误,你最好执行一下ccflow提供的数据库修复工具 上几个图

    已有1评分我要评分查看所有评分

    分享 转发
    TOP
    2#

    呵呵,我们才开始和自己的系统整合,本来打算6月底出一个标准化的流程作为样例呢,看来还得多花心思!希望多交流!
    TOP
    3#

    已重奖
    获取最新动态,请关注企业服务号:chichengsoft

    学好ccflow,受益一生,多看文档,少走弯路。
    TOP
    4#

    把与rtx 集成的代码贡献出来, 也好分享一下。
    获取最新动态,请关注企业服务号:chichengsoft

    学好ccflow,受益一生,多看文档,少走弯路。
    TOP
    5#

    采用服务的方式调用rtx发送消息(关键代码)

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Data.OracleClient; using System.Diagnostics; using System.ServiceProcess; using System.Text; using System.Windows.Forms; using System.IO; using RTXSAPILib; using RTXCMODULEINTERFACELib; using RTXCAPILib; using System.Configuration; namespace EwService {     public partial class EwService : ServiceBase     {         //计时器         private System.Timers.Timer timer;         private System.Timers.Timer timerempwork;         //应用程序路径         private static readonly string CurrentPath = Application.StartupPath + "\\";         //声明两个RTX根对象,目前RTX采用的是集群方式,用户分别放在两个服务器上         RTXSAPILib.RTXSAPIRootObj RootObj;  //声明一个根对象         RTXSAPILib.RTXSAPIRootObj RootObjServerEx;  //声明一个根对象         DataTable dtdeptinfo = new DataTable();         public EwService()         {             InitializeComponent();         }         protected override void OnStart(string[] args)         {             string v_tmpfs = GetSettings("rtxServerFs");             dtdeptinfo = GetDataTableFromDB("select loginname,departmentid from base_staff where departmentid like '" + v_tmpfs + "%'");             string path = CurrentPath + "Log\\start-stop.log";             FileStream fs = new FileStream(path, FileMode.Append, FileAccess.Write);             StreamWriter sw = new StreamWriter(fs);             sw.WriteLine("The Service is Starting On " + DateTime.Now.ToString());             sw.Flush();             sw.Close();             fs.Close();             //普通日志             timer = new System.Timers.Timer(1000 * Convert.ToInt32(GetSettings("TimeSpan")));             timer.Enabled = true;             timer.Elapsed += this.SendMsg;             timer.Start();             //待办工作             timerempwork = new System.Timers.Timer(1000 * Convert.ToInt32(GetSettings("EmpWorkTimeSpan")));             timerempwork.Enabled = true;             timerempwork.Elapsed += this.SendUserEmpWorks;             timerempwork.Start();         }         protected override void OnStop()         {         }         ///         /// 获取配置信息         ///         ///         ///         string GetSettings(string key)         {             return System.Configuration.ConfigurationManager.AppSettings[key];         }         ///         /// 发消息         ///         ///         ///         private void SendMsg(object sender, EventArgs e)         {             OracleConnection odc = new OracleConnection();   //新建连接             string ds = GetSettings("OracleDataSource");             string user = GetSettings("UserID");             string pass = GetSettings("Pass");             //odc.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" + ds + ";User Id=" + user + ";Password=" + pass;             //             odc.ConnectionString = "Data Source=" + ds + ";User ID=" + user + ";Password=" + pass + ";Unicode=True";             List sqls = new List();             //查询待发送消息             string sql = "select * from v_send_msg";             OracleCommand cmd = new OracleCommand(sql, odc);             try             {                 if (GetSettings("Enabled").ToLower() == "true")                 {                     //打开                     odc.Open();                     OracleDataReader rdr = cmd.ExecuteReader();                     while (rdr.Read())                     {                         string v_msg = "您有未读的消息:\r\n";                         //接收人                         string v_acc_user = rdr["name"].ToString() + "-" + rdr["ACCEPTER"].ToString();                                                string v_msgflage = rdr["MSGFLAGE"].ToString();                         //标题                         string v_title = rdr["TITLE"].ToString();                         //发送人                         string v_send_user = rdr["SENDERT"].ToString();                         //发送时间                         string v_send_date = rdr["SDT"].ToString();                         //消息地址                         string v_server = System.Configuration.ConfigurationManager.AppSettings["server"];                         if (string.IsNullOrWhiteSpace(v_server))                         {                         }                         //消息内容                         if (v_msgflage == "0")                         {                         }                         else                         {                             v_msg = rdr["doc"].ToString();                         }                         v_msg += "发送人:" + v_send_user + "\r\n";                         v_msg += "发送时间:" + DateTime.Now.ToString("yyyy.MM.dd HH:mm");                         List luser = new List();                         luser.Add(v_acc_user);                         bool isok = true;                         string v_retmsg = RtxSendMsg(v_msg, luser, out isok);                         string filename = string.Empty;                         if (isok)                         {                             //发送成功日志                             filename = CurrentPath + "Log\\Success" + DateTime.Now.ToString("yyyyMMdd") + ".log";                             //记录发送成功日志                             string execsql = "insert into sys_send_msg_log(id,msgid,msgtype) values(SEQ_SEND_MSG_LOG_ID.nextval,'" + rdr["MSGID"].ToString() + "','1')";                             sqls.Add(execsql);                         }                         else                         {                             //发送失败日志                             filename = CurrentPath + "Log\\Failure" + DateTime.Now.ToString("yyyyMMdd") + ".log";                         }                         //记录文本日志                         WriteLog(v_retmsg, filename);                     }                                          //关闭                     rdr.Close();                 }             }             catch (Exception ex)             {                 string filename = CurrentPath + "Log\\Exception" + DateTime.Now.ToString("yyyyMMdd") + ".log";                 string errmsg = "Exception: " + ex.Message + " --" + DateTime.Now.ToString();                 WriteLog(errmsg, filename);             }             finally             {                 odc.Close();                 cmd.Dispose();                 //记录数据库日志                 Execute(sqls);             }         }         ///         /// 发送待办工作消息         ///         ///         ///         private void SendUserEmpWorks(object sender, EventArgs e)         {             OracleConnection odc = new OracleConnection();   //新建连接             string ds = GetSettings("OracleDataSource");             string user = GetSettings("UserID");             string pass = GetSettings("Pass");             //odc.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" + ds + ";User Id=" + user + ";Password=" + pass;             //             odc.ConnectionString = "Data Source=" + ds + ";User ID=" + user + ";Password=" + pass + ";Unicode=True";             List sqls = new List();             //查询待发送消息             string sql = "select * from v_wf_empworks";             OracleCommand cmd = new OracleCommand(sql, odc);             try             {                 if (GetSettings("Enabled").ToLower() == "true")                 {                     //打开                     odc.Open();                     OracleDataReader rdr = cmd.ExecuteReader();                     w
    TOP
    6#

    RTX 可以免费使用了吗?官方没看到公告啊?
    TOP
    7#

    2)您可以免费申请RTX试用License文件,包含RTX企业总机号,可使用、购买所有
       RTX的插件及增值服务,可供200客户端同时在线,长期使用,但需每 6个月更新
       一次进行续期,续期License文件时请用RTX企业 总机号访问RTX用户管理系统进行。
    TOP
    8#

    非顶不可。
    TOP
    9#

    学习了
    TOP
    10#

    谢谢,学习了
    TOP
    发新话题 回复该主题