English
Quick Start
About 766 wordsAbout 3 min
2025-09-22
This page explains the configuration method, example scenarios, and basic implementation approach for the Business Flow JS plugin.
Plugin Configuration Steps
Before using an example to get started quickly, you should first understand how the plugin is configured.
When you want to configure a business flow plugin, first go to Admin Console > Custom Development Tools, find Custom Plugins, and click New.

Configure the basic information of the plugin. Pay attention to selecting the supported terminal type and the plugin type you need. For example, if you want to use the Business Flow JS plugin, select that type. On mobile, in addition to writing the plugin through the WEB IDE, you can also configure it by uploading a ZIP package. Here, WEB IDE creation is used as the example.

After configuring the basic plugin information, you can choose Public Template, History Template, or Use Empty Template. Both Public Template and History Template are previously created templates. You can select one and make simple modifications according to your needs. If you choose Use Empty Template, you will need to write the plugin content yourself.

As shown below, write the plugin content and specify the plugin entry, for example:
plugins/testplugin.js. After configuration, click Save or Publish.

After the plugin is written, go to Advanced Configuration of the corresponding workflow, find Custom Plugin Configuration, and select the plugin you want to use.

Simple Requirement Description
- Suppose there is a requirement: 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 opened and the task is completed directly. In this case, it is not possible to perform a second confirmation on the form data when clicking "Complete". Based on this scenario, a common requirement is to forcibly open the edit-content dialog or page when clicking "Complete".
Code Example
module.exports = function (context, pluginService, pluginParam) {
return {
apply() {
let self = this;
return [{
/**
* Exposes externally injected methods to the plugin
* Whether to forcibly enter the form page when the business flow has a form
*/
event: "flow.bpm.edit.form.render.before",
functional: async function (context, options) {
return Promise.resolve({
// If the return value is true, the form page is forcibly opened
forceShowEditForm: true,
});
}
}]
}
}
}Result Display
As shown below, after configuring this plugin, the edit-content form/page will still be forcibly opened even in the following cases: 1. there are required fields in the default layout but they already have values, 2. there are no required fields in the default layout, 3. there is no source object in the workflow layout.

Plugin Structure Description

- The code is mainly implemented around
eventandfunctional. event: different requirements use different events. In the current example, the requirement is to forcibly open the edit-content dialog/page in the business flow, so the selected event isflow.bpm.edit.form.render.before.functional: this is the handler function corresponding to the current event, that is, the specific functionality to implement. In this example, since we need to forcibly open the edit-content dialog/page, thefunctionalcode needs to process and returnforceShowEditForm.
