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

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:

主站蜘蛛池模板: 阿拉善右旗| 安福县| 灵宝市| 娄底市| 临汾市| 古浪县| 临邑县| 永登县| 莲花县| 尼木县| 农安县| 龙州县| 中方县| 曲麻莱县| 云浮市| 嘉义市| 满洲里市| 宝兴县| 鹿泉市| 石家庄市| 文山县| 合作市| 彰武县| 夏邑县| 嘉荫县| 北宁市| 阜平县| 丁青县| 金沙县| 金阳县| 上思县| 南安市| 光泽县| 鄂伦春自治旗| 吕梁市| 尚义县| 昌都县| 响水县| 滨海县| 彭阳县| 永川市|