Scripting Integration Overlay

This chapter will explain the use of the Scripting Integration Overlay in the Stardust Browser Modeler.

Scripting languages such as JavaScript or Python give the process designer the ability to manipulate, transform and convert data very easily without the need to compile code. With scripting languages, the modeler can write scripts for string manipulation, formula calculation, etc. Also scripting languages could be tested on the fly at design time.

Script invocation

To build a new script, select Create Script Invocation menu item from the Applications pop-up menu accessible from the Process Model tree:

Then, you have to add the input/output parameters, those parameters can be primitive or structured data

that objects can be accessed by ID from within the script editor

In the Configuration tab, select the scripting code language and write the script code:

Note : Objects can be accessed by ID from within the script editor.

The script code can be tested at design time from the Test tab by following the steps below:


JavaScript example

This process shows how to concatenate two strings using JavaScript code.

The input entered manually by the user is a structured data that contains two string variables (Text1 and Text2). The output is a primitive data.

In this case, the JavaScript code concatenates the two texts and set the result to the output variable.

This is an example of test at design time to verify the behavior of the JavaScript code.

After deploying the model, the process is started. The following screens show the result:

Python example

This example shows how to use Python script to perform numeric calculation. It has the same logic as the previous one with JavaScript. The difference is shown in configuration tab, where you have to select Python instead of JavaScript and implement the logic in Python.

This an example of python script.

The test of this script shows the expected result.