码迷,mamicode.com
首页 > 其他好文 > 详细

PeopleCode JobRunStatus

时间:2016-08-02 16:59:50      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:

Function JobRunStatus(&ProcessInstance As number) Returns string;
Local string &RunStatus;
Local Record &rec;
Local SQL &sql;
Local boolean &IsCompleted;

&rec = CreateRecord(Record.PMN_PRCSLIST);
/* PMN_PRCSLIST.SEQUENCENO is the process instance number for either a process or a job */
/* PMN_PRCSLIST.PRCSINSTANCE is the proces instance number for a single process */
/* PMN_PRCSLIST.JOBINSTANCE is the proces instance number for a job */
/* When a process is scheduled PMN_PRCSLIST.SEQUENCENO = PMN_PRCSLIST.PRCSINSTANCE */
/* When a job is scheduled PMN_PRCSLIST.SEQUENCENO = PMN_PRCSLIST.JOBINSTANCE */
rem &sql = CreateSQL("%Selectall(:1) Where JOBINSTANCE = :2");
&sql = CreateSQL("%Selectall(:1) Where SEQUENCENO = :2");
&sql.Execute(&rec, &ProcessInstance);
While &sql.Fetch(&rec)
&IsCompleted = False;
&RunStatus = &rec.RUNSTATUS.Value;
Evaluate &RunStatus
When = "1"
When = "2"
When = "3"
When = "8"
When = "9"
When = "10"
When = "14"
&IsCompleted = True;
Break;
End-Evaluate;
If &IsCompleted Then
Break;
End-If;
End-While;
&sql.Close();
Return &RunStatus;
End-Function;

PeopleCode JobRunStatus

标签:

原文地址:http://www.cnblogs.com/xiangliqi/p/5729379.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!