Giter Club home page Giter Club logo

cdm-object-builder's Introduction

FINOS - Incubating

CDM Object Builder

This project is a utility tool for dynamically generating Common Domain ModelTM (CDM) objects using a visual UI builder which can then be reviewed.

The tool provides functionality for navigating the CDMTM starting at a root type and traversing its nodes (attributes) to build up an object visually in the user interface.

The version of the CDMTM used is fixed at build time in the model file ./ui/src/app/modules/builder/services/builder-api.model.ts.

The Common Domain ModelTM is a registered trademark of FINOS. For more information please visit https://cdm.finos.org/

Installation

To start the web-based user interface locally, navigate to the ./ui folder and run

npm ci
npm start 

Usage example

A use case for the Object Builder is the selection of Eligible Collateral Schedules.

Development setup for updating the CDM version

Basic Method

There is an npm command that is set up to update to the latest model vesion. The command assumes that mvn and java are installed.

Steps:

  1. Run the command cd ui && npm run update-model
  2. Check the file ui/src/app/modules/builder/services/builder-api.model.ts is updated.
  3. Create a PR, Review and Merge.

Advanced setup

To update the version of the model used by this tool execute the Java utility.

Steps:

  1. Update the finos.cdm.version property in the pom.xml file to match the version of the cdm
  2. Update the rosetta.dsl.version property in the pom.xml to the DSL version used in the CDM (See pom.xml in the cdm project to get the correct version)
  3. Build the set up tool using mvn
cd setup
mvn clean install
  1. Run the executable jar file - this will update the builder-api.model.ts file to support the given cdm version.
java -jar target/object-builder-0.0.0.master.jar ../ui/src/app/modules/builder/services/builder-api.model.ts org.finos.cdm cdm-java
  1. Commit the builder-api.model.ts file in a new PR.

Example:

2023-11-22 15 34 15 (1)

Roadmap

Contributing

For any questions, bugs or feature requests please open an issue For anything else please send an email to [email protected].

To submit a contribution:

  1. Fork it (https://github.com/finos/cdm-object-builder/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Read our contribution guidelines and Community Code of Conduct
  4. Commit your changes (git commit -am 'Add some fooBar')
  5. Push to the branch (git push origin feature/fooBar)
  6. Create a new Pull Request

NOTE: Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.

Need an ICLA? Unsure if you are covered under an existing CCLA? Email [email protected]

License

Copyright 2022 ISDA [email protected]

Distributed under the Apache License, Version 2.0.

SPDX-License-Identifier: Apache-2.0

cdm-object-builder's People

Contributors

davidalk avatar dependabot[bot] avatar eacunaisda avatar hugohills-regnosys avatar maoo avatar minesh-s-patel avatar renovate[bot] avatar thejuanandonly99 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

davidalk

cdm-object-builder's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update dependency karma to v6.4.3
  • Update dependency org.apache.maven.plugins:maven-deploy-plugin to v3.1.2
  • Update dependency org.apache.maven.plugins:maven-install-plugin to v3.1.2
  • Update dependency webpack-bundle-analyzer to v4.10.2
  • Update dependency org.apache.maven.plugins:maven-compiler-plugin to v3.13.0
  • Update dependency org.apache.maven.plugins:maven-jar-plugin to v3.4.1
  • Update xtext.version to v2.34.0 (org.eclipse.xtext:org.eclipse.xtext, org.eclipse.xtext:xtext-dev-bom)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/build-maven.yml
  • actions/checkout v4
  • actions/setup-java v3
.github/workflows/build-node.yml
  • actions/checkout v4
  • nanasess/setup-chromedriver v2
  • actions/setup-node v4
.github/workflows/cve-scanning-maven.yml
  • actions/checkout v4
  • actions/setup-java v3
.github/workflows/cve-scanning-node.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/license-scanning-maven.yml
  • actions/checkout v4
  • actions/setup-java v3
  • actions/upload-artifact v3
  • actions/upload-artifact v3
.github/workflows/license-scanning-node.yml
  • actions/checkout v4
  • actions/setup-node v4
maven
setup/pom.xml
  • com.google.guava:guava 32.1.3-jre
  • junit:junit 4.13.2
  • org.finos.cdm:cdm-java [5.2.0,6.0.0)
  • com.regnosys.rosetta:com.regnosys.rosetta 9.1.3
  • org.eclipse.xtext:xtext-dev-bom 2.27.0
  • org.eclipse.xtext:org.eclipse.xtext 2.27.0
  • ch.qos.logback:logback-classic 1.4.14
  • ch.qos.logback:logback-core 1.4.14
  • org.apache.maven.plugins:maven-clean-plugin 3.3.2
  • org.apache.maven.plugins:maven-resources-plugin 3.3.1
  • org.apache.maven.plugins:maven-compiler-plugin 3.12.1
  • org.apache.maven.plugins:maven-surefire-plugin 3.2.5
  • org.apache.maven.plugins:maven-jar-plugin 3.3.0
  • org.apache.maven.plugins:maven-install-plugin 3.1.1
  • org.apache.maven.plugins:maven-deploy-plugin 3.1.1
  • org.apache.maven.plugins:maven-site-plugin 3.12.1
  • org.apache.maven.plugins:maven-project-info-reports-plugin 3.5.0
  • org.apache.maven.plugins:maven-shade-plugin 3.5.1
npm
ui/package.json
  • @angular/animations ^14.1.3
  • @angular/cdk ^14.1.3
  • @angular/common ^14.1.3
  • @angular/compiler ^14.1.3
  • @angular/core ^14.1.3
  • @angular/forms ^14.1.3
  • @angular/material ^14.1.3
  • @angular/material-date-fns-adapter ^14.1.3
  • @angular/platform-browser ^14.1.3
  • @angular/platform-browser-dynamic ^14.1.3
  • @angular/router ^14.1.3
  • @fortawesome/angular-fontawesome ^0.11.0
  • @fortawesome/fontawesome-svg-core ^6.1.1
  • @fortawesome/free-brands-svg-icons ^6.1.1
  • @fortawesome/free-regular-svg-icons ^6.1.1
  • @fortawesome/free-solid-svg-icons ^6.1.1
  • date-fns ^2.29.2
  • lodash-es ^4.17.21
  • rxjs ^7.8.1
  • tslib ^2.3.0
  • zone.js ~0.11.4
  • @angular-devkit/build-angular ^14.1.3
  • @angular/cli ~14.2.0
  • @angular/compiler-cli ^14.1.3
  • @types/jasmine ^5.0.0
  • @types/lodash-es ^4.17.6
  • jasmine-core ^5.1.0
  • jasmine-marbles ^0.9.2
  • karma ^6.4.2
  • karma-chrome-launcher ^3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ^5.1.0
  • karma-jasmine-html-reporter ^2.1.0
  • typescript ~4.7.2
  • webpack-bundle-analyzer ^4.6.1

  • Check this box to trigger a request for Renovate to run again on this repository

Make model to be loaded generic

Object Builder to become more generic in loading data model

Description of Problem:

The CDM Object Builder is currently closely tied to the loading and navigating of the Common Data Model. If made more generic, this object builder would allow for a developer forking the repository to run a build with a different data model, perhaps an extension of the CDM or one of similar structure available within the Rosetta file path structure.

Potential Solutions:

The build currently relies on parameter arguments passed into the main java class that generates the Object Builder to load the related data model as specified in dependencies. However, it has some custom code that could be made more generic to allow for the build to accommodate a different data model to be loaded.

Impacted Java class: TypescriptObjectBuilderModelGenerator
Method: loadModels is currently using the ClassPathUtils method findRosettaFilePaths which is currently tied to the Common Domain Model structure.

AS-IS

    private List<RosettaModel> loadModels() throws MalformedURLException {
        XtextResourceSet resourceSet = resourceSetProvider.get();
        List<Path> rosettaFilePaths = ClassPathUtils.findRosettaFilePaths();
        for (Path rosettaFilePath : rosettaFilePaths) {
            resourceSet.getResource(URI.createURI(rosettaFilePath.toUri().toURL()
                    .toString(), true), true);
        }

        return resourceSet.getResources().stream()
                .map(Resource::getContents)
                .flatMap(Collection::stream)
                .map(RosettaModel.class::cast)
                .collect(Collectors.toList());
    }

The model is currently hardcoded in the ClassPathUtils class findRosettaFilePaths method:

    public static List<Path> findRosettaFilePaths() {
        return findPathsFromClassPath(ImmutableList.of("model", "cdm/rosetta"), ".*\\.rosetta", Optional.empty(), ClassPathUtils.class.getClassLoader());
    }

If passing a parameter in the method with the chosen data model name (from those available in the path structure), this could be controlled during build to switch to a different model.

TO-BE
In loadModels method:
findRosettaFilePaths(modelName);

In findRosettaFilePaths - it would take the modelName as a String parameter, something like this:

 public static List<Path> findRosettaFilePaths(String modelName) {
        return ClassPathUtils.findPathsFromClassPath(ImmutableList.of("model", modelName + "/rosetta"), ".*\\.rosetta", Optional.empty(), ClassPathUtils.class.getClassLoader());
    }

Exception Handling
A modelName that cannot be found on the file paths would need to be handled.

guava-30.1-jre.jar: CVE-2023-2976(7.1)

CVE scanning failure at - https://github.com/eacunaISDA/object-builder/actions/runs/6039273502/job/16387539600#step:5:6023

CVE details can be found at https://nvd.nist.gov/vuln/detail/CVE-2023-2976. It says "Even though the security vulnerability is fixed in version 32.0.0, we recommend using version 32.0.1 as version 32.0.0 breaks some functionality under Window".

Given the above we suggest trying to use 32.0.1 version for guava.

To update the version we can check where it comes from (it seems to be a transitive dependency). (Run mvn dependency:tree to see where it comes from). Possible solutions:

  1. Could be that a new version of the root dependency (the one you can update in pom.xml) has a new version, which also uses 32.0.1 (or newer version) of guava.
  2. If 1 doesn't work, you can "exclude" guava, (see https://www.educba.com/maven-exclude-dependency/) , then add it as a root dependency with the version of your choice
  3. We can decide to ignore it (if safe to do so) by adding the CVE to an allow-list.xml file

After we address this we can make the repository public.

Enumerated lists with inheritance not supported

Bug Report

Steps to Reproduce:

  1. Open the Object Builder
  2. Select EligibleCollateralSpecification as the root type
  3. Add a criteria and an asset
  4. Select denominatedCurrency
  5. Attempt to select EUR or GBP from the dropdown.

Expected Result:

Major currencies, that is members of the CurrencyCodeEnum and ISOCurrencyCodeEnum enumerated lists, should appear as available to be selected.

Actual Result:

Only the values from the CurrencyCodeEnum list appear. CurrencyCodeEnum inherits from ISOCurrencyCodeEnum however the values from the latter enumerator list are not shown.

Environment:

CDM-JAVA5.0.1

Additional Context:

Similar behaviour may be demonstrated in other instances where inheritance is used with enumerated lists; weeklyRollConvention on an interestRatePayout being another example.

Party (0..2) objects not captured

Bug Report

Steps to Reproduce:

  1. Create an Eligibile Collateral Specification
  2. Add an Identifier
  3. Add the first Party, with a name
  4. Add the second Party, with a name

Expected Result:

In either table or JSON view, would expect to see both parties

Actual Result:

Only the last Party is shown

Environment:

(https://cdm-object-builder.finos.org/)
CDM-JAVA5.0.1

Additional Context:

{
"identifier": [
{
"assignedIdentifier": [
{
"identifier": {
"value": "A12345678"
}
}
]
},
{
"assignedIdentifier": [
{
"identifier": {
"value": "sdsadasd"
}
}
]
}
],
"party": {
"name": {
"value": "BNPP"
}
}
}

Screenshot 2023-12-05 173500

Enhance Object Builder to enforce cardinality quantity on attributes

Feature Request

Description of Problem:

When selecting an attribute with multiple cardinality, Object Builder does not enforce the maximum bound (or indeed the minimum bound either). That is (0..1) is treated the same as (0..2) and (0..*) etc.

This means that it is possible to create non-compliant objects unintentionally which will not work in the CDM.

Potential Solutions:

Validate number of occurences and raise a warning message if it exceeds the CDM specification. Probably better that this is not a breaking error as there may be occasions where an end user wants to create invalid data knowingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.