Support > Repository > Business logic > Preparation and operation confirmation
ja | en

I will explain how to use script from Wagby.

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

Figure 1 Java version
If you are using Java 6/7, please refer to the "When using Java 6/7Please read.

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