Creating a Reusable Sequence

Follow these steps to create a new, reusable sequence that you can add to your mediation workflow or refer to from a sequence mediator, or to create a sequence mediator and its underlying sequence all at once.

Instructions

Creating New Sequence Artifact

  1. If you have already created an ESB Config project, right-click the ESB Config project on the project explorer, click Sequence .
  2. Select Create New Sequence and click Next .
  3. Specify a unique name for the sequence.

    Info

    Creating a Main Sequence: If you want to create the default main sequence that just sends messages without mediation, be sure to name it main, which automatically populates the sequence with the default In and Out sequences.

  4. Do one of the following:

    • To save the sequence in an existing ESB Config project in your workspace, click Browse and select that project.
    • To save the sequence in a new ESB Config project, click Create new Project and create the new project.
    • To save the sequence as a Dynamic Sequence in a registry resource project, click Make this as Dynamic Sequence, specify the registry space (Governance or Configuration), click Browse at the top of the dialog next to Save Sequence in and select the registry resource project, and then type the sequence name as the Registry Path.
  5. Click Finish. The sequence is created in the src/main/synapse-config/sequences folder under the ESB Config or registry resource project you specified.
  6. Add the endpoints and other sequences you want in this sequence and then click File > Save.

The sequence is now available in the Defined Sequences section of the tool palette and ready for use in other meditation workflows.

Create from a Sequence Mediator

  1. Open your proxy service, click Sequence Mediator in the tool palette and then click the location in the mediation workflow where you want to add this sequence. The sequence mediator is added to the workflow with a default name, which is highlighted and ready for you to change.
  2. Type the name you want for this sequence mediator and press Enter.
  3. Double-click the sequence mediator you just added. A sequence is created and opened in the editor using the same name you entered for the sequence mediator.
  4. Add the endpoints and other sequences you want in this sequence, and then click Save.

The mediation workflow is updated with the endpoints you added to the sequence. The sequence is also now available in the Defined Sequences section of the tool palette and ready for use in other meditation workflows.

Using a Sequence

When you create a sequence, it appears in the Defined Sequences section of the tool palette. To use this sequence in a mediation flow:

  1. Click the sequence in the tool palette.
  2. Click the spot on the canvas where you want the sequence to appear in the flow. The editor automatically adds any endpoints you used in your sequence.

To use a sequence from a different project or from the registry:

  1. Click Sequence Mediator on the tool palette, and then click the spot on the canvas where you want the sequence to appear in the mediation workflow.
  2. Press Enter to accept the default name for now.
  3. In the Properties pane at the bottom of the window, click Static Reference Key, and then click the browse [...] button on the right.
  4. In the Resource Key Editor, click Registry if the sequence is stored in the registry or Workspace if it's in another ESB Config project.
  5. If you are trying to select a sequence from the registry and no entries appear in the dialog box, click Add Registry Connection and connect to the registry where the sequence reside.
  6. Select the required sequence and click OK , and then click OK again.

The sequence mediator name and static reference key are updated to point to the sequence you selected.

Examples

Top