Skip to content

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

  1. 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.

  2. Create an integration project.

  3. Go to MI Project Explorer > Sequences.

    Create Sequence

  4. Hover over Sequences and click the + icon that appears to open the Sequence Form.

    Add sequence

  5. Provide a unique name for the sequence.

    Create New Sequence

  6. Specify the required values for the sequence.

    To save the sequence as a dynamic sequence in a registry resource project:

    1. Select the Save the sequence in registry check box.
    2. Type the sequence name in the Artifact Name field.
    3. Specify the registry type (Governance registry (gov) or Configuration registry (conf)) under Select registry type.
    4. Type the sequence name in the Registry Path field.

      Sample Sequence

  7. 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.

    Sample Sequence

Create from a sequence mediator

  1. Go to the graphical view of your proxy service.

  2. Click on the add (+) icon to open the Palette to access Mediators.

    Edit Proxy

  3. Select Call Sequence under Mediators > Generic.

    Call Sequence

  4. 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

  1. Once you create a sequence artifact, open its Resource View from MI Overview. Given below is the default view:

    Sequence design view

  2. Add the required integration artifacts from the Palette and design the integration flow.

    Sequence graphical editor


  • To use a sequence from a different project or from the registry, you can use the Sequence Mediator:

    1. From the Palette, add Call Sequence from Mediators > Generic to the mediation flow. This will open the Call Sequence pane.

    2. Under Referring Sequence, select the sequence from the list of available sequences.

    Call sequence pane

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.

Show Source View

You can update the sequence using this view.

Using Source View

Learn more about reusable sequences

Follow our examples on endpoint templates: