Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
English
In Bean Shell plugin, we can call other Joget plugins programmatically to perform a specific task without the need to rewrite specific functionality that existing plugins may have already addressed.

Example 1: JSON Tool

In this Bean Shell code, we will make use of of the JSON API Tool.

Before we move on, let's inspect how the plugin is configured first.

...

We will need to obtain the attributes of the configured plugin, plugn so that we can then programmatically configure it with coding.

One quick way to learn the attributes needed is to make use of the browserProcess Builder's Developer Advanced Tools > Network JSON Definition to observe the submission made when we hit the submit buttonplugin's properties.

Image RemovedImage Added

Figure 2: JSON Tool Attributes

...

We can also check out the plugin property options source code of the plugin too at https://github.com/jogetworkflow/jw-community/blob/78.0-SNAPSHOT/wflow-core/src/main/resources/properties/app/jsonTool.json or by inspecting the DOM elements in the JSON Tool configuration screen.

...

Figure 3: Obtaining JSON Tool AttrbutesAttributes

With this infomation information on hand, we can now configure the plugin through coding. Configurations are made in the the propertiesMap variable in the sample code below.

...