Developing the GMF model to add a new mediator in WSO2 Integration Studio -Part 2
esb.genmodel
Let’s move to “Model code generation” and “Edit code generation”. For Model and Edit code generation we need to use esb.genmodel.
- Go to the plugin “org.wso2.developerstudio.eclipse.gmf.esb” in the project explorer. Double click on it. Select model → esb.genmodel
2. Right click on esb.genmodel and click Reload…
3. Select the “Ecore model” from the list and Click Next.
4. We need to load the correct .ecore file. In our case it is esb.ecore. As shown in the below screenshot, set Model URIs: and click the “Load” button.
Model URIs: platform:/resource/org.wso2.developerstudio.eclipse.gmf.esb/model/esb.ecore
After loading the approprite Model URIs click “Next”
4. Then Click Finish
5. esb.genmodel file will get opened in the editor.
6. Right click on the root element of the esb.genmodel(Esb) and click “Generate Model Code”
It will take some time to generate the model code.
7. You can see model classes(Interfaces and Implementations) have been created for “CalculatorMediator”, “CalculatorMediatorInputConnector” and “CalculatorMediatorOutputConnector”.
https://drive.google.com/file/d/10UdCT9q6jdjgVcbEqDNLnW4zCF2eEouA/view?usp=sharing
8. Right click on the root element of the esb.genmodel(Esb) and click “Generate Edit Code”
It will take some time to generate edit code
This will generate ItemProvider classes for “CalculatorMediator”, “CalculatorMediatorInputConnector” and “CalculatorMediatorOutputConnector”
https://drive.google.com/file/d/1swkQ8LemkUssms28mnCSNNduF9otHiGR/view?usp=sharing
We have generated the model and edit code.
This ends the modeling of esb.genmodel.