官术网_书友最值得收藏!

Creating a sequence

In this section, we will create the sequences that implement the logic for our service. Sequences are the building blocks of our service. We can create them from the Developer Studio dashboard by following these steps:

  1. Click on Sequence.
  2. Select Create New Sequence and click on Next.
  1. In this window, we enter this data:
    • Sequence Name: The name of the sequence
    • Save Sequence in: Project where we create the sequence

There are some advanced configurations that are not mandatory:

  • On Error Sequence: Here, we can specify which sequence will be triggered when an error occurs during the sequence flow. This behavior is similar to that described for fault sequences in proxies. If no sequence is specified, the fault sequence of the proxy that executes this sequence is thrown.
  • Available Endpoints: Here, we can select a default endpoint to send the message.
  • Make the sequence as Dynamic Sequence: This option means that the sequence will be stored in the WSO2EI registry, which allows you to share the sequence and can be stored in the two kinds of locations: Configuration and Governance. We are not using this feature due to the scope of this book, but to give a brief idea of its application, we can say that the configuration registry artifacts are shared by all the WSO2EI nodes in a cluster, while the governance registry artifacts are shared by all the WSO2 products of our environment.
  1. Click on Finish and the sequence will finally be created:
  1. We can begin implementing our sequence logic by double-clicking on the file My1stSEQ.xml in the project explorer, which will open the sequence editor:

As you may note, this editor is quite similar to the proxy editor. On the left-hand side, we have the Palette, where we can find the artifact we use to compose our logic. We just need to drag and drop components from the palette to the design section.

In most of the common scenarios, logic is implemented using mediators that allow us to modify the content of the message. We will discuss more on mediators in the subsequent chapters.

As is the case with proxies, we also have a source tab where we can see the XML code behind the design display. Consider this design:

We have the following source code for the preceding design:

主站蜘蛛池模板: 都安| 清新县| 鸡东县| 乌鲁木齐县| 文成县| 武义县| 颍上县| 荃湾区| 通许县| 麦盖提县| 河池市| 怀来县| 普安县| 睢宁县| 汶川县| 霍林郭勒市| 日土县| 浙江省| 丰顺县| 精河县| 富顺县| 扶余县| 茶陵县| 海原县| 平陆县| 社旗县| 岳阳县| 六安市| 嵊泗县| 砚山县| 武宣县| 金塔县| 六枝特区| 马尔康县| 阳谷县| 余干县| 长丰县| 辽宁省| 如皋市| 卓尼县| 黄平县|