RM2PT Tutorial

RM2PT NLP Project

Create RM2PT NLP Project in RM2PT

In RM2PT, File -> New Project

image-20211007155604601

Type project name e.g., NL2OCL

image-20211007160154353

Click “Next >”

image-20211007160216653

Click “Finish “

All the startup projects will be generated in project explorer as follows:

image-20211007163038561

Configuration Maven Library Step 1: add all required maven dependency

image-20211007161213598

Configuration Maven Library Step 2: download all required jars into folder lib by using maven goal initialize

image-20211007161325311

Refresh the project all the required jars are located in lib folder

image-20211007161451680

Configuration Maven Library Step 3: configure project dependency in RM2PT: Right Click Project -> Build Path -> Configure Build Path -> Add JARS under Classpath or add NLP jars as User Library

image-20211007161607690

image-20211007162736721

Configuration Maven Library Step 4: configure project dependency in NL2OCL Plugin: Project / META-INF / MANIFEST.MF

image-20211007165501903

Then click Runtime Tab, Click Add

image-20211007165520239

Add All required jars

image-20211007165619238

The runtime loading code template is located in src-> package (ArtifactID) -> CoreNLP.xtend

Note that code template is coded by Xtend language.

image-20211007162908869

The translation code template is located in src-> package (ArtifactID) -> TranslateNL2OCL.xtend

image-20211007163000684

Test your generator project

image-20210119174458881

Double Click Eclipse Application

image-20210119174536376

Click Run to open a new Eclipse IDE and then import the requirements model, and right click .remodel and choose RM2PT-Dev / Loading StandNLP Runtime

image-20211007163441150

Then choose RM2PT-Dev / Translate Nature Language to OCL

image-20211007163540624

Package Code Generator Project through Maven

image-20210119182537487

set maven goal as: clean package

The Console will show the result as follows:

image-20210119183048412

The finally code generator p2 updatesite is located in xxx.updatesite/target

you can distribute .zip to others to install your code generator

Upload your source code to github with CI/CD support

Create a project on Github

image-20210119172748935

The default code generator project includes CI/CD script under .github/workflow/CICD.yml, you should add your PUSH_Token to secerts to make CI/CD work.

To your github ‘setting / Developer settings / Personal access tokens’, click generate new token. Note that you should select scope of repo and workflow

image-20210119185556506

Then go back to your project, click settings / Secrets, and then paste the tokens with name PUSH_TOKEN

image-20210119185735329

Push your source code to Github Repo

image-20210119185832926image-20210119185859499

Click Create Repository

image-20210119185933235

image-20210119190043832

Click Commit and Push

Note that you should configure your ssh key propertly if your use ssh way.

image-20210119190201887

image-20210119190220132

Check CI/CD result

image-20210119191246374

image-20210119191304081

Push to RM2PT Plugins Repo

send your application email to yilongyang@buaa.edu.cn, then RM2PT will create a repo for your, then you can push your source code to RM2PT repo.