Developing the GMF model to add a new mediator in WSO2 Integration Studio -Part 5

Praveen Nadarajah
5 min readJun 29, 2019

esb.gmfmap

Let’s move on to esb.gmfmap modeling.

  1. Go to the plugin “org.wso2.developerstudio.eclipse.gmf.esb” in the project explorer. Double click on it. Select model → esb.gmfmap.

2. Double click on “esb.gmfmap. Select platform → Mapping → Top Node Reference<server:EsbServer/EsbServer> → Node Mapping<EsbServer/EsbServer> → Child Reference<children:ProxyService/ProxyService> → Node Mapping<ProxyService/ProxyService> → Child Reference<container:ProxyServiceContainer/ProxyServiceContainer> → Node Mapping<ProxyServiceContainer/ProxyServiceContainer> → Child Reference<sequenceAndEndpointContainer:ProxyServiceSequenceAndEndpointContainer/ProxyServiceSequenceAndEndpointContainer> → Node Mapping<ProxyServiceSequenceAndEndpointContainer/ProxyServiceSequenceAndEndpointContainer> → Child Reference<mediatorFlow:MediatorFlow/MediatorFlow> → Node Mapping<MediatorFlow/MediatorFlow>

3. Open Node Mapping<MediatorFlow/MediatorFlow>. Right click on Node Mapping<MediatorFlow/MediatorFlow> and select New Child → Child Reference.

4. Right click on the newly created “Child reference<children>” and click on “Show Properties View”. Set the properties as shown below

Compartment — Compartment Mapping<MediatorFlowCompartment>

Compartment Feature — MediatorFlow.children:EsbElement

5. Right click on the newly created “Child reference<children>” and select New Child -> Node Mapping

6. Right click on the newly created “Node Mapping” and click on “Show Properties View”. Set the properties as shown below

Element — Calculatormediator → Mediator

Diagram Node — Node CalculatorMediator (CalculatorMediatorFigure)

Tool — Creation Tool CalculatorMediator

7. Let’s add Feature Label to the Node Mapping<CalculatorMediator/CalculatorMediator>. Right click on newly created Node Mapping<CalculatorMediator/CalculatorMediator> and select New Child → Feature Label Mapping

8. Right click on the newly created “Feature Label” and click on “Show Properties View”. Set the properties as shown below

Feature to display — EsbElement.description:EString

Diagram label — Diagram Label CalculatorMediatorDescription

9. let’s add child reference to the input connector. Right click on the newly created Node Mapping<CalculatorMediator/CalculatorMediator> and select New Child → Child Reference

10. Right click on the newly created “Child Reference” and click on “Show Properties View”. Set the properties as shown below

Containment Feature — CalculatorMediator.inputConnector:CalculatorMediatorInputConnector

11. Right click on the newly created Child Reference <inputConnector> and select New Child → Node Mapping

12. Right click on the newly created “Node Mapping</>” and click on “Show Properties View”. Set the properties as shown below

Element — CalculatorMediatorInputConnector → InputConnector

Diagram Node — Node CalculatorMediatorInputconnector (EastPointerFigure)

13. let’s add child reference to the output connector. Right click on the “Node Mapping <CalculatorMediator/CalculatorMediaor>” and select New Child → Child Reference

14. Right click on the newly created “Child Reference<>” and click on “Show Properties View”. Set the properties as shown below

Containment Feature — CalculatorMediator.outputConnector:CalculatorMediatorOutputconnector

15. Right click on the newly created Child Reference <outputConnector> and select New Child → Node Mapping

16. Right click on the newly created “Node Mapping</>” and click on “Show Properties View”. Set the properties as shown below

Element — CalculatorMediatorOutputConnector → OutputConnector

Diagram Node — Node CalculatorMediatorOutputConnector (EastPointerFigure)

17. After all mapping, we should get the following tree structure.

18. Save all changes. Go to the plugin “org.wso2.developerstudio.eclipse.gmf.esb” in the project explorer. Double click on it. Select model → esb.gmfmap. Right click on it and select “Create generator model…”

19. You will get the below window. Make sure the fields are as follows

Enter or select parent folder — org.wso2.developerstudio.eclipse.gmf.esb/model

File name — esb.gmfgen

Click on “Next >”

20. You will get the following window. Select the fields as follows

Model URI: platform:/resource/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.gmfmap

After selecting the proper Model URI click on the “Load” button which is beside the Model URI field

After clicking the “Load” button click “Next >”.

21. You will get the following window. Make the Model URI as follows

Model URI — platform:/resource/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.genmodel

Click the “Load” button which is beside the Model URI field. Then click “Finish”.

22. You will get the following window. Tick the following checkboxes

*Use IMapMode

*Utilize enhanced feature of GMF runtime

Click “Finish”.

This ends the modeling of esb.gmfmap.

References

--

--