Altova FlowForce Server 2025 

Hello World

Home Prev Top Next

This example shows you how to create a simple job that outputs the text "Hello World!" in the browser. The broad outline is described below:

 

1.We will create a new job in the /public/Examples container.

2.After that, we will add an execution step that will compute the expression "Hello World!"

3.Then we will configure the job as a Web service. This means that we will be able to trigger the job on demand by clicking a link in the browser.

4.We will also select an existing password credential, with which the job will be run.

5.After saving the job configuration, we will run the job at the URL configured.

 

Implementation

This subsection describes step-by-step instructions on how to create a simple job that outputs the text "Hello World!" in the browser. The implementation of this scenario is also shown in the GIF file at the bottom of this topic.

 

Step 1: Create a job

To create a job, follow the instructions below:

 

1.Log on to FlowForce Server.

2.Navigate to a container where you have the permission to create new jobs. For testing purposes, we will be using the /public/Examples container. If this container does not exist yet, create it using the Create | Create Container command.

3.In the /public/Examples container, create a new job by clicking Create | Create Job.

4.Enter a job name (e.g., SampleJob), and, optionally, a job description.

 

In our example, the job is called HelloWorld and contains the following description: "Outputs the text 'Hello World!'"

 

Step 2: Add a job execution step

To add an execution step that will compute the expression "Hello World!", take the steps below:

 

1.Click new Execution step in the Execution Steps section.

2.Type the name of the built-in function /system/compute in the Execute function field.

3.In the Expression field, enter the text 'Hello World!', enclosed within single quotes.

 

Step 3: Configure the job as a Web service

To configure the job as a Web service, select the Make this job available via HTTP check box and type HelloWorldJob as the name of the service. For more information about Web services, see Jobs as Web Services.

 

Step 4: Select a credential

When you create a job in FlowForce Server, you must supply the credentials of the user account with which the job must be executed.

 

In the Credentials section, we will select a password credential that we created before starting this tutorial. This is a standalone credential object that you can use in any job. Standalone credentials are convenient, because you can change them in one place, and this change will affect all jobs that use that credential reference.

 

Alternatively, you can specify a local credential, by entering your user name and password.

 

For more information about types of credentials and instructions on how to create them, see Credentials.

 

Step 5: Save the job and run it

To save the job configuration, click Save at the bottom of the configuration page. To run the job, you can select one of the following options:

 

Go to the Home page and click Show all active triggers and services. Next, click the job's URL displayed in the Info column.

Enter the URL configured previously (Step 3) in the browser's address bar. Note that this URL works only if the FlowForce Server service listens at the default host address and port name. If you have defined other host and port settings on the Setup page, change the address accordingly.

If you set the optional Host name field of FlowForce Server on the Setup page, you can execute the web service call directly from the job configuration page, by clicking the fs_ic_call_ws button adjacent to the Make this job available via HTTP check box. The button is not displayed otherwise.

 

If you are asked for credentials when you access the Web service, supply the same credentials you use to log on to FlowForce Server.

 

Important

Supplying your FlowForce Server user credentials for HTTP authentication is only for testing purposes. For production, it is recommended to create a new FlowForce user, grant the Service - Use permission to this user on the container where the job is, and then access the Web service with the corresponding user account. To disable HTTP authentication and make the Web service public, grant the Service - Use permission to the user Anonymous. For details, see How Permissions Work.

 

Job outcome

If the job executes successfully, the browser will display the following output:

 

Hello World!

 

If the job fails, the browser will display a "Service execution failed" message. In this case, check the FlowForce Server job log to identify the error. In Advanced Edition, you will also be able to see bar charts that display job statistics.

 

Implementation shown in GIF

For a quick demo of the steps described in this tutorial, please click the GIF file below.

Click to play

 

© 2018-2024 Altova GmbH