English
flow.bpm.task.action.before
About 179 wordsLess than 1 minute
2026-04-17
flow.bpm.task.action.before
Description: This hook is used to intercept before an action is executed, supplement context, and set whether agree/reject comments are required.
1. isIntercept
Feature Description
- Intercepts before an action is executed, supplements context, and sets whether agree/reject comments are required.
Parameters
| Parameter | Description | Type |
|---|---|---|
| action | Current action information | Object |
| bpmTaskDetail | Business Flow task details | Object |
| context | Context capabilities passed through to the plugin | Object |
context Description
//change-approver comments whether comments are required changeHandlerOpinionRequired(isRequire) //agree comments whether comments are required agreeOpinionRequired(isRequire) //reject comments whether comments are required rejectOpinionRequired(isRequire)
Return Value
| Parameter | Description | Type |
|---|---|---|
| isIntercept | Whether to intercept the default action | Boolean |
Parameter Code Example
let action = options && options.action;Code Example
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
return [
{
event: "flow.bpm.task.action.before",
functional: async function (context, options) {
let action = options && options.action;
let bpmTaskDetail = options && options.bpmTaskDetail;
let pluginContext = options && options.context;
//change-approver comments whether comments are required
pluginContext.changeHandlerOpinionRequired(isRequire)
//agree comments whether comments are required
pluginContext.agreeOpinionRequired(isRequire)
//reject comments whether comments are required
pluginContext.rejectOpinionRequired(isRequire)
return Promise.resolve({
isIntercept: false
});
}
}
];
}
};
};