Hello World Tutorial

Summary. This tutorial shows you how to make the simplest possible of all applications, just to get started.


Step 1: Install Reactive Blocks


Step 2: Create a new Project

Start by creating a new project.

alt text

  • Click the New Project Icon (highlighted above)
  • Fill in the project name field
  • Select the setup Application Project, Java SE
  • Click Finish

Step 3: Create an Application Building Block

alt text

  • Click New Block Icon… (highlighted above)
  • Fill in the block name field, for instance Hello World
  • Make sure to set the type to Application Block
  • Set the Project to the project we created above
  • Click Finish and wait until the building block is created

It should look something like this:

alt text

Reactive Block has created an initial node automatically as an application block will need at least one initial node as starting point for execution.

Analysis view will pop up and report one error, namely Initial node ‘i0’ has not outgoing flow.


Step 4: Create the Hello World Behavior

  • In the editor, right click as shown below:

alt text

alt text

  • A dialog will ask you for a method name:

alt text

  • Now your block should look something like this:

alt text

  • In the editor, right click, and select Add… > Edge
  • Create two edges: the initial node –> the operation and the operation –> the activity final
  • Select the command File / Save
  • Now your block should look something like this:

alt text

  • Double-click on the operation
  • A Java editor editor is opened and a method with the same name is revealed:

alt text

  • In this method, add some code, e.g., printing “Hello, World!” in the console.

alt text

  • Save the changes using the menu File / Save
  • Your first block is now complete.

Step 5: Build the Application

Before you can start the application, you need to generate its code.

  • Right-click on the Hello World block and select Build / Select Build Target Platform
  • Login, if you haven’t done so, and repeat the previous step.
  • In the platform dialog, select Java Standard Edition - J2SE as platform.

alt text

  • In the parameter dialog, leave the default values.

alt text

  • After the generation, the Package Explorer View will open with a new project.
  • It should look like this

alt text


Step 6: Start the Application

  • In the Package Explorer View, right-click on the .launch (e.g., HelloWorld.launch) file in the generated _exe project
  • Select Run As and then HelloWorld

alt text

  • The Console View should open and you should see the message “Hello, World!”.

alt text

  • Well done! (Maybe not the most exciting example, but hey - it’s really only a start!)

Optional: Import this Example

This example is is called (Level 1) Getting started: Hello World and you can import it from within Reactive Blocks. Importing of tutorials and examples is explained here.