English
flow.approval.reject.task.list.render.before
About 199 wordsLess than 1 minute
2025-11-24
This hook is used before the list of rejectable tasks is rendered during approval rejection. It can be used to hide or add reject nodes.
Note: This hook is used before the list of rejectable tasks is rendered during approval rejection, for operations such as hiding or adding reject nodes.
spliceTaskList
This method can be used to customize adding or hiding reject nodes during approval rejection.
Parameters
| Parameter | Description | Type |
|---|---|---|
| pageData | Parameters passed through by the button | Object |
| taskList | List of tasks that can be rejected to | Array |
Note: The passed-through id must not be changed, otherwise it will be invalid.
Parameter Code Example
taskList.splice(0, 1); // Hide the first reject nodeCode Example
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
let self = this;
return [
{
/**
* Rejectable task list
*/
event: "flow.approval.reject.task.list.render.before",
functional: async function (context, options) {
let taskList = options && options.taskList;
taskList.push({
id: "haha",
label: "Plugin-added rejectable task"
});
taskList.splice(0, 1); // Hide the first reject node
return Promise.resolve(taskList);
}
}
];
}
};
};
