English
bpm.taskPage.render.before
About 462 wordsAbout 2 min
2025-12-16
This event is used to perform extra actions before the business flow task landing page is rendered, including but not limited to the following functions: 1. getting current task data, 2. customizing the display of current task buttons.
Parameters
| Parameter | Description | Type |
|---|---|---|
| getTaskDetail | Get current task data (example) | Function |
| customButtons | Customize the display of current task buttons (example) | Function |
Basic Examples
1. getTaskDetail
Feature Description
Used to get the data of the current task.
Parameters
None
Return Value
| Parameter | Description | Type |
|---|---|---|
| name | Task name | String |
| taskId | Task ID | String |
| state | Task status | String |
| buttons | Exposed buttons | Object |
| moreButtons | More buttons | Array |
| errorButtons | Exposed buttons shown for abnormal tasks, only available when the task status is abnormal | Array |
Parameter Code Example
None
Code Example
// getTaskDetail()
export default class Plugins{
apply() {
return [
{
event: "bpm.taskPage.render.before",
functional: this.taskPageRenderBefore.bind(this)
}
]
}
taskPageRenderBefore(api) {
let taskDetail = api.getTaskDetail();
console.log(taskDetail);
}
}2. customButtons
Feature Description
Customize the name, order, visibility, and hiding of buttons under the current task.
Parameters
| Parameter | Description | Type |
|---|---|---|
| content | Custom button content | Object |
Return Value
None
Parameter Code Example
let customTaskPageBtns = {
taskButtons,
moreButtons,
errorButtons
};Code Example
// forceShowEditForm()
export default class Plugins{
apply() {
return [
{
event: 'bpm.taskPage.render.before',
functional: this.bpmTaskPageRenderBefore.bind(this)
}
]
}
bpmTaskPageRenderBefore(api) {
let taskDetail = api.getTaskDetail();
console.log(taskDetail, 'taskDetail');
let taskButtons = taskDetail.buttons;
let moreButtons = taskDetail.moreButtons;
let errorButtons = taskDetail.errorButtons;
// Data can be processed based on state or taskId
if(taskDetail.state === "in_progress"){
// Customize exposed buttons
for (let key in taskButtons) {
if (taskButtons[key].action === "suspend") {
taskButtons[key].label = "Defer Processing - Show Second";
taskButtons[key].order = 0;
} else if (taskButtons[key].action === "Complete") {
taskButtons[key].order = 1;
taskButtons[key].label = "Testing Custom Button - Show Complete First";
}
}
// Customize more buttons
moreButtons && moreButtons.forEach((i)=>{
if(i.code==="Discuss"){
i.label = "Forward 1111";
}else if(i.code==="ChangeBPMApprover"){
i.label = "Change Handler 4444";
}
})
}
if(taskDetail.state === "error"){
errorButtons && errorButtons.forEach((i)=>{
if(i.executeType=== 1 ){
i.executeName = "Retry 1 Show Second 1111";
}else if(i.executeType=== 0){
i.executeName = "Ignore - Show First";
}
})
}
}
}3. agreeOpinionRequired
Feature Description
Current product status:
- Approval nodes in the business flow do not currently support required-field configuration
If this PWC plugin is configured, then approval opinions become required when approving a node in the business flow.
Parameters
None
Return Value
None
Parameter Code Example
None
Code Example
// agreeOpinionRequired()
export default class Plugins{
apply() {
return [
{
event: 'bpm.taskPage.render.before',
functional: this.bpmTaskPageRenderBefore.bind(this)
}
]
}
bpmTaskPageRenderBefore(api) {
api.agreeOpinionRequired();
}
}4. rejectOpinionRequired
Feature Description
Current product status:
- Approval nodes in the business flow do not currently support required-field configuration
If this PWC plugin is configured, then approval opinions become required when rejecting a node in the business flow.
Parameters
None
Return Value
None
Parameter Code Example
None
Code Example
// rejectOpinionRequired()
export default class Plugins{
apply() {
return [
{
event: 'bpm.taskPage.render.before',
functional: this.bpmTaskPageRenderBefore.bind(this)
}
]
}
bpmTaskPageRenderBefore(api) {
api.rejectOpinionRequired();
}
}