流程脚本
脚本列表
请求地址:
Request URL: http://demo.jeesite.com/js/a/bpm/bpmScript/listData
Request Method: POST
入参:
Form data:
scriptName:
scriptLang:
scriptType:
remarks:
status:
pageNo:
pageSize:
orderBy:
出参:
{
"count": 3,
"list": [{
"id": "1200047678865907712",
"isNewRecord": false,
"status": "0",
"createDate": "2020-01-02 08:49",
"updateDate": "2020-01-02 08:49",
"updateBy": "system",
"remarks": "",
"createBy": "system",
"scriptLang": "groovy",
"scriptType": "bpm",
"scriptName": "业务表状态更新脚本(审核、退回、完成、终止)",
"scriptText": "import com.jeesite.common.entity.DataEntity; import com.jeesite.modules.bpm.utils.BpmUtils; // 任务创建后(流程已退回、审核中) if (BpmUtils.isCurrentCmd(execution, 'back')){ BpmUtils.updateStatus(execution, 'oaLeaveService', DataEntity.STATUS_AUDIT_BACK); }else{ BpmUtils.updateStatus(execution, 'oaLeaveService', DataEntity.STATUS_AUDIT); } // 流程结束后(流程已完成) BpmUtils.updateStatus(execution, 'oaLeaveService', DataEntity.STATUS_NORMAL); // 流程取消后(流程已终止) BpmUtils.updateStatus(execution, 'oaLeaveService', DataEntity.STATUS_DELETE);"
},
{
"id": "1200051215373017088",
"isNewRecord": false,
"status": "0",
"createDate": "2020-01-02 08:49",
"updateDate": "2020-01-02 08:49",
"updateBy": "system",
"remarks": "",
"createBy": "system",
"scriptLang": "groovy",
"scriptType": "sys",
"scriptName": "UserUtils 用户工具类相关脚本",
"scriptText": "import com.jeesite.modules.sys.utils.UserUtils; return UserUtils.getUser().getUserCode();"
},
{
"id": "1200387716797861888",
"isNewRecord": false,
"status": "0",
"createDate": "2020-01-02 08:49",
"updateDate": "2020-01-02 08:49",
"updateBy": "system",
"remarks": "",
"createBy": "system",
"scriptLang": "beetl",
"scriptType": "bpm",
"scriptName": "流程标题生成脚本",
"scriptText": "${form.currentUser.userName} 在 ${date(),'yyyy-MM-dd'} 发起了 ${form.formName}"
}
],
"pageSize": 20,
"pageNo": 1
}
脚本新增or编辑
请求地址:
Request URL: http://demo.jeesite.com/js/a/bpm/bpmScript/save
Request Method: POST
Status Code: 500
入参:
Form data:
id:
scriptLang: groovy
scriptType: sys
scriptName: 测试
scriptText: VW5zdXBwb3J0ZWRPcGVyYXRpb25FeGNlcHRpb24=
remarks: 测试
脚本停用
请求地址:
Request URL: http://demo.jeesite.com/js/a/bpm/bpmScript/disable?id=1200387716797861888
Request Method: POST
入参:
id: 1200387716797861888
脚本删除
请求地址:
Request URL: http://demo.jeesite.com/js/a/bpm/bpmScript/delete?id=1200047678865907712
Request Method: POST
入参:
id: 1200387716797861888
脚本测试
请求地址:
Request URL: http://demo.jeesite.com/js/a/bpm/bpmScript/test
Request Method: POST
入参:
scriptLang: groovy
scriptText: aW1wb3J0IGNvbS5qZWVzaXRlLm1vZHVsZXMuc3lzLnV0aWxzLlVzZXJVdGlsczsKCnJldHVybiBVc2VyVXRpbHMuZ2V0VXNlcigpLmdldFVzZXJDb2RlKCk7