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

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:

主站蜘蛛池模板: 陕西省| 苏尼特左旗| 鹤壁市| 石河子市| 龙井市| 富裕县| 葫芦岛市| 莎车县| 玉山县| 鄂托克旗| 两当县| 双桥区| 安多县| 从江县| 曲水县| 攀枝花市| 咸宁市| 天祝| 久治县| 德安县| 德庆县| 罗源县| 亳州市| 黄平县| 曲阜市| 交城县| 罗田县| 水城县| 海口市| 古丈县| 中阳县| 德清县| 德安县| 凤山县| 教育| 呼玛县| 儋州市| 信阳市| 通化市| 忻州市| 新田县|