Create 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¶
Create a sequence artifact¶
-
Launch Visual Studio Code with the Micro Integrator for VS Code extension (MI for VS Code) installed.
Info
Follow the Install Micro Integrator for VS Code documentation for a complete installation guide.
-
Create an integration project.
-
Go to MI Project Explorer > Sequences.
-
Hover over Sequences and click the + icon that appears to open the Sequence Form.
-
Provide a unique name for the sequence.
-
Specify the required values for the sequence.
To save the sequence as a dynamic sequence in a registry resource project:
-
Click Create.
-
The sequence is created in the
<PROJECT_NAME>/src/main/wso2mi/artifacts/sequences
folder. -
If you select the Save the sequence in registry option in the previous step, the sequence is created in the
<PROJECT_NAME>/src/main/wso2mi/resources/
directory according to the values you specified. -
The created sequence is also available in the Palette, under All Mediators > Generic > Call Sequence, and is ready for use in other meditation workflows.
Create from a sequence mediator¶
-
Go to the graphical view of your proxy service.
-
Click on the add (+) icon to open the Palette to access Mediators.
-
Select Call Sequence under Mediators > Generic.
-
In the Call Sequence pane, select the previously created sequence from the Referring Sequence dropdown. Then the sequence will be linked to the integration.
Design the integration¶
-
Once you create a sequence artifact, open its Resource View from MI Overview. Given below is the default view:
-
Add the required integration artifacts from the Palette and design the integration flow.
-
To use a sequence from a different project or from the registry, you can use the Sequence Mediator:
-
From the Palette, add Call Sequence from Mediators > Generic to the mediation flow. This will open the Call Sequence pane.
-
Under Referring Sequence, select the sequence from the list of available sequences.
-
You can also use the Source view to update the sequence configuration.
Use the Source View¶
Click the Show Source (</>
) icon located in the top right corner of the VS Code to view the XML-based synapse configuration (source code) of the reusable sequence.
You can update the sequence using this view.
Learn more about reusable sequences
Follow our examples on endpoint templates: