Skip to content

EclipseIDE Regpot Generator

RBirdwatcher edited this page Mar 13, 2024 · 1 revision

EclipseIDE Regpot

The Eclipse Free BIRD Tool project contains one example RegPot called the EclipseIDE RegPot.

When we combine the information of a RegSeed with the EclipseIDE RegPot we produce a desktop application that makes use of the extendable Eclipse IDE, and the Eclipse modelling framework, making particular use of its Ecore Standard, and the XCore text representation of Ecore which incudes an expression language (XBase) which translates itself to Java that runs in a Java Virtual Machine within the Eclipse IDE.

This allows us to create and persist data such as bonds and loans with a data-aware UI, store and reload that data as XML files in the XMI standard, amend transformations using XBase and run and debug them using a Java virtual machine…so all mature, free, open , well tested technologies which have a large base of expert developers.

EclipseIDE RegPot Generator

Example

We don’t store detailed examples of RegDNA in the Eclipse Free BIRD tools projects, but there is examples relating to a Regulatory report called Finrep F05.01 stored in the open source BIRDSeed repository

Also the open source Finrepherencerepository stores the results of the generation process from this RegDNA input, alongside some example data. Together these can be used to execute the transformation to calculate the contents of a report cell, and all its lineage, from input data (it needs a simple user guide to run this, which is under construction)

Using the EclipseIDE RegPot Generator

You can use the EclipseIDE RegPot generator by installing Eclipse Free BIRD Tools as an Eclipse Plugin https://github.com/eclipse/efbt/wiki/Install-the-application-as-an-Eclipse-plugin.

To use it you don’t need to do much. In the editor that you use to edit RegDNA text just change a RegDNA file and the generated Xcore files will be produced in the src-gen folder. If you are using the Eclipse IDE make sure you choose ‘build automatically’ from the projects menu of the main toolbar.

EclipseIDE Generator Code

EclipseIDE Regpot Generator code is available at here . We do plan to move its location in future to be beside the other components used in the EclipseIDE RegPlatform.

EclipseIDE RegPot Generator Steps

The Xcore code generated by the EclipseIDE RegPot is generated in 3 steps

Datamodel -> Xcore

The grammar of the RegDNA language for describing datamodels is 99 percent the same as the grammar of Eclipse XCore. RegDNA does not include the XBase expression language used in XCore, because we want users to be free to use a general purpose langue of their choice to describe detailed logic of regulatory calculations. When it comes to describing transformations then we will make use of XBase expressions in the generated EclipseIDE RegPlatform, in a different RegPlatform we might make use of another language for detailed executable logic such as Python.

Here is the generator code for translating the RegDNA datamodel to Xcore.

xtedn_example

How this code works is described in the general Regpot Generator documentation

Note that currently in the generated content we might find we need to do some small tweaks because of idiosyncrasies of XCore, we will automate these in future.

Generation_Transformations -> XCore

When we translate generation transformations to XCore, we are basically trying to go from a slightly simplified description of calculation into a more detailed one that is based on the computational model described in the RegDNA specification here

For each Input Slice we are creating an Xcore class. That class refers to some existing Xcore classes that were created in the previous step (Datamodels -> XCore). Specifically the class refers to the Xcore class for the Main Entity , and also to the Xcore class for each Linked Entity
For each per-attribute transformation described in a slice we are creating an operation. The content of this operation to be generated is normally very clear since per-attribute-transformations are restricted to very simple things (selecting an existing attribute, derived attribute, or a literal from and enum) .

Once we have created an Xcore class for each slice, we create another XCore class which just unions them together. To facilitated this the Xcore classes for each slice have a common supertype.

Reports -> XCore

Similar to the above we generate Xcore artefacts from reports and their filters

EclipseIDE RegPlatform components

The Orchestrator

The Orchestrator is a component of the EclipseIDE RegPlatform. It is responsible for running the transformations that are described in XCore. The code for the Orchestrator is stored here:

The Orchestrator makes use of the CSVConverter component, to make sure the results, and a version of its inputs is stored in CSV also. The code for the CSVConverter is stored here: