WSO2 EI – Sequence Templates

 Introduction:

        A large number of configuration files in the form of sequences, endpoints, proxy services , and transformations can be required to satisfy all the mediation requirements of your system. To keep your configurations manageable, it's important to avoid scattering configuration files across different locations and to avoid duplicating redundant configurations.

    Templates help minimize this redundancy by creating prototypes that users can use and reuse when needed

    Templates comes in two different forms.

1.    Endpoint Template

2.    Sequence Template

Now we are going to see the usage of sequence template.

·       A Sequence Template is a parametrized sequence, Parameters of a template are defined in the form of XPath statement/s. Callers can invoke the template by populating the parameters with static values/XPath expressions using the Call Template Mediator.

Advantage :

·           why would you use a Template sequence? Couldn’t you just as simply define variables in the messageContext and read them from the sequence itself?

Yes you could do that. But with the call template mediator you can simply pass the parameter to the template sequence.


Use case:


MS-Outlook email move movement in WSO2 EI 6.6.0



  • As per above diagram, clients will send email to MS-Outlook, WSO2 EI will will fetch email details from inbox and doing message mediation , finally ticket details will be pushed to Target System(ServiceNow)

  • Once ticket is created successfully in ServiceNow, triggered Email will be moved to success folder, otherwise failed folder, we achieve this folder movement by using sequence template in WSO2 EI 6.6.0


Sequence template - Code Snippet :





Calling Sequence Template - Code Snippet:





Comments

  1. Dear Justin Brother

    Please make a article about registry and local entry with real-time examples

    ReplyDelete
    Replies
    1. Hi bro,
      Thanks for your request,
      Yes sure. Will publish content on the same.

      Small info: Registry in WSO2 ESB has three flavours.

      Local registry
      Configuration registry
      Governance registry

      Local Registry: It can be used to store configurations and metadata that is specific to the ESB node. This cannot be shared across all ESB nodes in the cluster or peer ESB nodes

      Delete

Post a Comment