鼎捷易拓 TIPTOP 客制程序新增背景作业功能

小助手读文章 00:00 / 00:00

前面有讲到鼎捷易拓 TIPTOP 自动任务计划的配置方法,针对的是标准作业,我们在自己客制时,也可以加入背景作业功能,达到自动任务计划的目的。

首先在 MAIN 定义中增加参数接收:

......
MAIN
    OPTIONS
......
    LET g_pdate = ARG_VAL(1)
    LET g_towhom = ARG_VAL(2)
    LET g_rlang = ARG_VAL(3)
    LET g_bgjob = ARG_VAL(4)
    LET g_prtway = ARG_VAL(5)
    LET g_copies = ARG_VAL(6)
    LET tm.wc = ARG_VAL(7)
    LET g_rep_user = ARG_VAL(8)
    LET g_rep_clas = ARG_VAL(9)
    LET g_template = ARG_VAL(10)
    LET g_rpt_name = ARG_VAL(11)
......
END MAIN

然后在画面档输入条件的地方,增加背景作业按钮的处理方法:

......
FUNCTION r304_tm(p_row,p_col)
......
        DISPLAY BY NAME tm.more
        INPUT BY NAME tm.more WITHOUT DEFAULTS
        BEFORE INPUT
            CALL cl_qbe_display_condition(lc_qbe_sn)
        AFTER FIELD more
            IF tm.more NOT MATCHES "[YN]" OR tm.more IS NULL THEN
                NEXT FIELD more
            END IF
            IF tm.more = "Y" THEN
                CALL cl_repcon(0,0,g_pdate,g_towhom,g_rlang,g_bgjob,g_time,g_prtway,g_copies)
                        RETURNING g_pdate,g_towhom,g_rlang,g_bgjob,g_time,g_prtway,g_copies
            END IF
        ON ACTION exit
            LET INT_FLAG = 1
            EXIT INPUT
        END INPUT
        IF INT_FLAG THEN
            LET INT_FLAG = 0 CLOSE WINDOW r304_w 
            CALL cl_used(g_prog,g_time,2) RETURNING g_time
            EXIT PROGRAM
        END IF
        IF g_bgjob = 'Y' THEN
            SELECT zz08 INTO l_cmd FROM zz_file WHERE zz01='cbmr304'
            IF SQLCA.sqlcode OR l_cmd IS NULL THEN
                CALL cl_err('cbmr304','9031',1)
            ELSE
                LET tm.wc=cl_replace_str(tm.wc, "'", '"')
                LET l_cmd = l_cmd CLIPPED,
                                        " '",g_pdate CLIPPED,"'",
                                        " '",g_towhom CLIPPED,"'", 
                                        " '",g_rlang CLIPPED,"'", 
                                        " '",g_bgjob CLIPPED,"'",
                                        " '",g_prtway CLIPPED,"'", 
                                        " '",g_copies CLIPPED,"'",
                                        " '",tm.wc CLIPPED,"'", 
                                        " '",g_rep_user CLIPPED,"'", 
                                        " '",g_rep_clas CLIPPED,"'", 
                                        " '",g_template CLIPPED,"'",
                                        " '",g_rpt_name CLIPPED,"'"  
                CALL cl_cmdat('cbmr304',g_time,l_cmd)
            END IF
            CLOSE WINDOW r304_w
            CALL cl_used(g_prog,g_time,2) RETURNING g_time
            EXIT PROGRAM
        END IF
......

画面档如下,红色框圈起来的是本次新增加的:

背景作业.png

运行后就跟标准程序一样了,可以自动跳转到 p_cron 定时任务,并发送运行结果邮件。


ArmxMod for Typecho
个性化、自适应、功能强大的响应式主题

推广

 继续浏览关于 tiptop易拓鼎捷代码客制背景作业 的文章

 本文最后更新于 2019/09/26 12:30:00,可能因经年累月而与现状有所差异

 引用转载请注明:VirCloud's Blog > 运维 > 鼎捷易拓 TIPTOP 客制程序新增背景作业功能