Routes User Interface

To see the Routes menu entry on the Portal, you need to have the permission routes=view.

Note

If you have the permission routes=*, you can have access to all the functions mentioned below.

View the routes and the deployment scripts

The main page is divided into two parts:

  • the active routes.
  • the route deployment scripts

List the routes

The route deployment scripts are the scripts which define the routes. Several routes can be created by the same script.

To read all the scripts and all the routes, you need to have the permission routes=read. Otherwise, you cannot read any data.

If your permission has values like this: routes=read('Route Script 1', 'Route Script 2'), you will only see the route deployment scripts Route Script 1 and Route Script 2.

By clicking on the eye button on the line associated with the route deployment script, you’ll see the script details.

View a route deployment script

Edit the route deployment scripts

To edit the route deployment scripts, you need to have the permission routes=edit.

Double click on the route deployment script in the data grid to access the edit form.

You can update the script’s name and description.

Warning

The script’s name and the English description are mandatory and cannot be empty.

Edit a route deployment script

A route deployment script can be enabled/disabled. If it’s disabled, it cannot be executed.

The script’s type is a tag that you can add to help you filter your scripts in the data grid. It does not have any effect on the execution’s logic.

You can select a template to reduce the quantity of boiler plate code required to define a route deployment script. A template is a Groovy script stored in:

  • ${B2BOX_DATA}/resources/templates
  • ${B2BOX_HOME}/resources/templates

Templates can be created or edited only manually on your file system in the above directories. But you are able to read them when you click on the blue eye button.

According to the template you have selected, you’ll find below the list of the variables used in the template and which need to be filled with the adequate code. If needed, the code editor of a variable can be enlarged (the blue button next to the variable’s name).

If you don’t want to use one of the available templates, select the option No Template in the template drop-down and you’ll be able to write your own script in a single code editor. But you’ll not be able to write script segments variables in it.

The option Template Missing means that the template that was used to create the deployment script is no longer on the file system. But you can still see the copy of the template content.

Run a route deployment script

To run a route deployment script, you just need to have the permission routes=read.

You can run a script from the view or the edit form.

Warning

A route deployment script disabled or an unsaved script cannot be executed. You need to enable it or save your changes in the edit form.

When the script is executed, it triggers a long-running job. Read the section Jobs Control Panel for more information about the Platform 6 jobs.

The resulting routes will appear in the section Active routes. You can stop/start them from the routes list.

The script’s status (running or not) is displayed in the data grid or in the view.

You can not start a route deployment script already running and you cannot stop a script if it’s not started.

Note

If a route A is active and you want to re-start the associated route deployment script, it will fail if the route is not destroyed before the execution.

You need to stop and delete the active route using the UI or you can add camel.destroyRoute('A') in the deployment script to ensure the route A is removed if it already exists. More information in the Routes guide.