5. Hello World Tutorial

5.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 5.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.

5.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 5.2: Creating a new OML file

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

5.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 5.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 5.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. Add an Input Box Parameter and call it in
  5. Add an Output Box Parameter named out


    Figure 5.5: Defining the Program interface

  6. To add an Access Method describing how JOpera is going to run this program, click on the Add button and:


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

    1. Choose the 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>


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

  7. That's it. Now you can go back to the Overview page to do a test run of the new HalloWorld program

5.4: Running the Program with a test Process


Figure 5.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

  3. Click on the Start button to start the process. Since this is the first time, JOpera will prompt you to enter some values for its input parameters.


    Figure 5.9: Launcher for the test Process

  4. Enter World for the input parameter in and click Run.

5.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 5.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

5.6: Publishing the Process as a Web service

Actually, you do not have to do anything to publish a process as a Web service: its WSDL interface description is generated by JOpera automatically.

  1. To test this, you can point your browser to http://localhost:8080/wsdl


    Figure 5.11: The WSDL of the process is generated automatically by JOpera

  2. As an exercise, you can use the WSDL to call the process from your own client and see what happens

Note: To control whether a process is published as a Web service, use the Published checkbox in the main page of the process editor


Figure 5.12: Check this box to publish process as Web services