Support > Repository > Business logic > Preparation and operation confirmation

I will explain how to use script from Wagby.

It is assumed to use Java 8 in the manual.Please try "Environment> Server> Java version" as "1.8".

Figure 1 Java version

Let's create a code to display the message when Wagby newly creates a "group" model (jgroup) that is provided as standard.

First build the application and start it.(The content of design information is not concerned.)

With the application launched, from the Designer, the system model "group"Choose.It is bundled with Wagby as standard.

Figure 2 The jgroup model included in the System tab

Open "Screen> Script".Enter as follows.

stdout.println("Hello from JavaScript.");
Stdout is an implicit object available in the Java 8 environment.You can use it anywhere in the script.When stdout.println (character string) is written, a character string is displayed on the Tomcat console.
Figure 3 Sample script

Log on to the application with an account with administrator privileges.Execute "New group registration" from the management processing menu.

At the timing of registration processing, confirm that the message is displayed on the console that started the application (Tomcat).

Figure 4 Check script operation