English
bpm.process.render.before
About 677 wordsAbout 2 min
2025-12-16
This event is used to perform extra actions before a business flow task is rendered, including but not limited to the following functions: 1. get current task data, 2. forcibly open the edit-content dialog/page.
Parameters
| Parameter | Description | Type |
|---|---|---|
| getTaskData | Get task data (example) | Function |
| forceShowEditForm | Forcibly open the edit-content dialog/page (example) | Function |
| agreeOpinionRequired | Whether approval opinion is required on approval (example) | Function |
| rejectOpinionRequired | Whether approval opinion is required on rejection (example) | Function |
| customFormButtons | Customize secondary action buttons of the workflow layout/form (example) | Function |
Basic Examples
1. getTaskData
Feature Description
Used to get the data of the current task.
Parameters
None
Return Value
| Parameter | Description | Type |
|---|---|---|
| taskName | Task name | String |
| taskId | Task ID | String |
| entityId | Object apiName | String |
| objectId | Object ID | String |
| sourceWorkflowId | Original workflow ID | String |
| workflowId | Workflow definition ID | String |
| workflowInstanceId | Instance ID | String |
| action | Action | String |
Parameter Code Example
None
Code Example
// getTaskData()
export default class Plugins{
apply() {
return [
{
event: 'bpm.process.render.before',
functional: this.bpmProcessRenderBefore.bind(this)
}
]
}
bpmProcessRenderBefore(api) {
let taskData = api.getTaskData();
console.log(taskData);
}
}2. forceShowEditForm
Feature Description
Current product status:
- If the edit content is configured as a standard layout, and there are no required fields or the required fields already have values, the edit-content dialog is not displayed and the task is completed directly.
- If the edit content is configured as a workflow layout, and there are no required fields and no child objects, the edit-content dialog is not displayed and the task is completed directly.
If this PWC plugin is configured, then even in the above two cases, the edit-content dialog/page will still be opened so that fields can be edited before completing the task. Forcibly open the edit-content dialog/page.
Parameters
None
Return Value
None
Parameter Code Example
None
Code Example
// forceShowEditForm()
export default class Plugins{
apply() {
return [
{
event: 'bpm.process.render.before',
functional: this.bpmProcessRenderBefore.bind(this)
}
]
}
bpmProcessRenderBefore(api) {
api.forceShowEditForm();
}
}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.process.render.before',
functional: this.bpmProcessRenderBefore.bind(this)
}
]
}
bpmProcessRenderBefore(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.process.render.before',
functional: this.bpmProcessRenderBefore.bind(this)
}
]
}
bpmProcessRenderBefore(api) {
api.rejectOpinionRequired();
}
}5. customFormButtons
Feature Description
Customize the naming, visibility, and order of secondary action buttons in the workflow layout/form.
Parameters
| Parameter | Description | Type |
|---|---|---|
| customFn | A function. It must accept input parameters and return a value | Function |
Return Value
None
Parameter Code Example
// input example
function(btns){
return btns.map(e => {
return {
action:e.action,
label:'Hahaha'+'Didida'
}
})
}Code Example
export default class Plugin {
apply() {
return [
{
event: 'bpm.process.render.before',
functional: this.bpmProcessRenderBefore.bind(this)
}
]
}
bpmProcessRenderBefore(api){
api.customFormButtons((btns)=>{
return btns.map(e => {
return {
action:e.action,
label:'Hahaha'+'Didida'
}
})
})
}
}Usage Notes
- Button display control: only buttons included in the returned array will be displayed; buttons not included will be hidden.
- Button order: the order of buttons in the returned array determines the display order of buttons in the interface.
- Custom labels: the
labelproperty can be used to customize the display text of buttons. If not provided, the system default label will be used.
Notes
- The button array in the input parameter does not include the "Cancel" operation button.
- The returned button configuration must be customized based on the buttons from the input parameter.
- If a button does not exist in the returned array, that button will be hidden.
- The display order of buttons is entirely determined by the order of the returned array.
