English
bpm.remindCard.render.before
About 317 wordsAbout 1 min
2026-04-17
Description: This event is triggered before a Business Flow to-do card is rendered.
This event is used to execute extension logic before a to-do card is rendered, including but not limited to: 1. Get card task data 2. Get card button data 3. Customize card buttons
Parameters
| Parameter | Description | Type |
|---|---|---|
| getTaskData | Get card task data (Example) | Function |
| getButtons | Get card button data (Example) | Function |
| customButtons | Custom buttons (Example) | Function |
Examples
1. getTaskData
Feature Description
Gets task data for a single card on the to-do page.
Parameters
None
Return Value
| Parameter | Description | Type |
|---|---|---|
| name | Task name | String |
| taskId | Task ID | String |
| state | Task status | String |
Code Example
export default class Plugin {
apply() {
return [
{
event: 'bpm.remindCard.render.before',
functional: this.remindCardRenderBefore.bind(this),
},
];
}
remindCardRenderBefore(api) {
const taskData = api.getTaskData();
console.log(taskData);
}
}2. getButtons
Feature Description
Gets button data on the to-do card.
Parameters
None
Return Value
| Parameter | Description | Type |
|---|---|---|
| buttons | Button collection corresponding to each task card | Object |
Code Example
export default class Plugin {
apply() {
return [
{
event: 'bpm.remindCard.render.before',
functional: this.remindCardRenderBefore.bind(this),
},
];
}
remindCardRenderBefore(api) {
const buttons = api.getButtons();
console.log(buttons);
}
}3. customButtons
Feature Description
Renames, reorders, or hides to-do card buttons by task.
Parameters
| Parameter | Description | Type |
|---|---|---|
| content | custom button data | Object |
Return Value
None
Parameter Code Example
const buttons = api.getButtons();
for (const key in buttons) {
if (key === '65d7266ec26b8d323e19d2e8') {
buttons[key].forEach((item) => {
if (item.action === 'suspend') item.label = 'Do not process custom names for now';
if (item.action === 'Complete') item.label = 'Custom name for completion';
});
}
}Code Example
export default class Plugin {
apply() {
return [
{
event: 'bpm.remindCard.render.before',
functional: this.remindCardRenderBefore.bind(this),
},
];
}
remindCardRenderBefore(api) {
const buttons = api.getButtons();
for (const key in buttons) {
if (key === '65d7266ec26b8d323e19d2e8') {
buttons[key].forEach((item) => {
if (item.action === 'suspend') {
item.label = 'Do not process custom names for now';
} else if (item.action === 'Complete') {
item.label = 'Custom name for completion';
}
});
}
if (key === '65ddb0f9297cc13e01456df1') {
buttons[key] = buttons[key].filter((item) => item.action !== 'suspend');
}
}
api.customButtons(buttons);
}
}