3. Hello World Tutorial

3.1: Creating a new Project

In order to create a new Project, right-click in the JOpera Navigator. You should see this view in the JOpera Design perspective.

Figure 3.1: Creating a new JOpera project

and select New > JOpera Project. Choose an appropriate "Project name" ("test" in this case) and click on the "Finish" button.

3.2: Creating a new OML file

Now that you have an empty JOpera project, you can add OML files into it by right-clicking the project in the JOpera Navigator and selecting New > OML File.

Figure 3.2: Creating a new OML file

Enter an appropriate file name ("halloworld.oml" in this case) and click on the "Finish" button.

3.3: Setting up the Hallo World Program

Before we can create a composition we need to define what are the components. In JOpera, we need to create some programs that will be later connected into a process. To do create the Hallo World Program:

    Figure 3.3: Adding a new Program

  1. Click on the Add button in the Programs overview
  2. Click on the Edit button to edit the NewProgram

    Figure 3.4: Editing a Program

    Note: JOpera has found out that it cannot run this program and is reporting this in the Problems view. We will fix this in a minute.

  3. Rename the program to HalloWorld
  4. The program is going to receive an input string and produce an output message. To exchange data, JOpera programs use input and output parameters, which are edited as shown in Figure 3.5:
    1. Add an Input Box Parameter and call it in
    2. Add an Output Box Parameter named out

    Figure 3.5: Defining the Program interface

  5. To add an adapter describing how JOpera is going to run this program, click on the Add... button within the Adapter (Access Method) section and:

      Figure 3.6: Choosing a component type for the new adapter (The content of this list may change depending on what JOpera plugins you have installed)

    1. Choose the ECHO component type from the list in the dialog box and click Ok.
    2. Click on Edit.
    3. Then enter the following XML as input:
      <out>Hallo %in%</out>

      Note: See 14.6: JOpera ECHO for more information on the syntax used by the JOpera ECHO adapter to substitute parameter values into its output string

      Figure 3.7: Entering the XML snippet to be returned by the program. You can get the list of input parameters by typing 'CTRL+Space'

  6. That's it. Now you can go back to the Overview page to do a test run of the new HalloWorld program, as we are going to show you in the rest of the tutorial.

3.4: Running the Program with a test Process

Now that we have setup the HelloWorld program, we can run it by calling it from a test process.

Figure 3.8: Generate a Test Process for the Program

  1. Select the HalloWorld Program and click on the Test button.

    Note: This will create a new process which contains a single activity which references the program you just added. The process has the same input and output parameters and, if you check the data flow view, they are already connected to your program, which is now ready to test.

  2. Save the OML file

    Note: Make sure that the Project, Build Automatically option is checked in the main Eclipse menu

  3. Click on the Start button to start the process. The button is located in the Overview tab next to the list of processes, as shown in Figure 3.8. Since this is the first time, JOpera will prompt you to enter some values for its input parameters.

    Figure 3.9: Launcher for the test Process

  4. As shown in Figure 3.9, enter World for the input parameter in and click Run.

3.5: Checking the Results

If all went well, the process runs very fast and is finished by the time Eclipse has switched to the JOpera Monitor perspective.

Figure 3.10: Check the results of the process in the JOpera Monitor perspective

  1. Look in the Properties view for the values of the output parameters
  2. Use the Instance Navigator view to manage the processes that are currently running

    Note: Try to start more processes and see what happens