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¶
- If you have already created an ESB Config project, right-click the ESB Config project on the project explorer, click Sequence .
- Select Create New Sequence and click Next .
-
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. -
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.
- Click Finish. The sequence is created in the
src/main/synapse-config/sequences
folder under the ESB Config or registry resource project you specified. - 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¶
- 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.
- Type the name you want for this sequence mediator and press Enter.
- 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.
- 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:
- Click the sequence in the tool palette.
- 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:
- 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.
- Press Enter to accept the default name for now.
- In the Properties pane at the bottom of the window, click Static Reference Key, and then click the browse [...] button on the right.
- 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.
- 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.
- 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.