Templates

Use the Templates page to add/edit new template types. Templates can either be in sequence Templates or endpoint Templates. As shown in Figure 1 and 2 , the template management section displays a list of existing templates. (Defined) templates tab shows templates saved in synapse configuration. Registry templates tab shows templates saved in registry.

Figure 1: Sequence Template management

Figure 2: Endpoint Template management

In the navigator, under Manage/Service Bus, click Templates. The Templates page appears.

Managing Sequence Templates

The above options are turned off by default because they cause a severe performance degradation. Use these options only in a situation where you have to debug a particular problem. Dynamic sequences does not support Enable Statistics and Enable Tracing.

Adding a Sequence Template

  1. On the Templates page, click Add Sequence Template. The Design Template page appears.
  2. Enter a sequence template name.
  3. Click Add Child, and select the required nodes for your sequence template.

Figure 3: Add sequence template design view

Adding parameters to a sequence template

  1. In case, you want to add parameters to sequence templates, click on Add Parameter button. Then a page appear with a parameter table. You can add and delete parameter name/s.These parameter names can be accessed within different child nodes using xpath. example shows how to use this in send mediator with xpath

  2. Figure 3.2: Adding/Accessing sequence template parameters

Click switch to source view to view the XML of the particular sequence tempalte. If you're familiar with the Synapse configuration language you can edit the XML directly and save the config using this view.

Sequence source view

Figure 4: Source view of the sequence template

Managing Endpoint Templates

Note statistics/tracing options are not available for endpoints templates .

Adding a Endpoint Template

  1. On the Templates page, click Add Endpoint Template. The Add Endpoint Templates page appears.
  2. Select an endpoint template type. currently three types are supported -->,

Figure 5.1: Add endpoint template view

Figure 5.2: Add endpoint template design view (for address type)

  • Enter the required details in the fields. As shown above fields are specific to the Address Endpoint Template.
  • Adding parameters to a endpoint template

    1. you can add parameters to endpoint templates, click on Add Parameter button , a page will appear with a parameter table. You can add and delete parameter name/s.These parameter names can be accessed within different attributes of the endpoint template you are currently editing. Parameters are accessed with $prefix. For endpoint tempaltes there are two inbuilt paramters 'name' and 'uri' which can be accessed with $name and $uri. Example shows how to access parameters 'uri' , 'p1' and 'p2' for tempalate attributes 'address' , 'suspend error codes' and 'suspend duration' respectively

    2. Figure 6.1: Adding/Accessing sequence template parameters

    Click switch to source view to view the XML of the particular endpoint template. As pointed out earlier ,If you're familiar with the Synapse configuration language you can edit the XML directly and save the config using this view.

    Endpoint Template source view

    Figure 6.2: Source view of the endpoint template

    For more information please refer to the WSO2 library