Code Monkey home page Code Monkey logo

doc_generation's Introduction

Generation of shipping documents from common schema

This project is for generating document schemas from a common class data model in accordance to edi3.org method and tooling.

Benefits

The benefits of this model-driven approach is:

  • Consistency of structure and naming across document schemas. The same attribute or relationship is called the same, positioned under the same class and has the same type between all generated schemas (unless deviations are explicitly defined).
  • Efficiency of generating new schemas, literally by dragging in the classes needed for a particular new schemas' requirements.
  • Manageability of updates and changes, if a change is made on one schema, it is automatically reflected in all other schemas based on the same data elements (subject of course to human approval, exporting the updated schema).
  • Semantic alignment to CEFACT.

Getting Started

You need a few tools to get started:

First, download and install StarUML.

Second, install the OpenAPI extension. In StarUML, go to Tools -> Extension Manager and select "Install from Url..." and install from this url: https://github.com/gs-gs/staruml-cefact.

Now, from Tools -> OpenAPI -> Generate Specs you can export various API and web formats based on a UML model in accordance to the edi3 spec.

Please note that the OpenAPI extension is still under development and updates occurs. Please keep involved and submit relevant feedback on https://github.com/gs-gs/staruml-cefact/issues.

Model Structure

The tl-docgen-model.mdj file defines both the common class model and the individual "profiles" for each document schema. You will find the model structured accordingly around a common "Model" package and a range of schema-specific packages (Bill Of Lading, Shipping Instructions, etc). All classes, enums, attributes, etc must be defined within the common Model. The schema packages only define thw following:

  • A Class representing the document schema.
  • An interface which tells the OpenAPI extension which class to export. It must have an Interface Realization relationship to its corresponding schema class.
  • A Diagram which defines which elements from Model is to be included in the schema.

Schema Exporting

While the OpenAPI extension supports different ways of exporting, the tl-docgen-model.mdj model is entirely based on diagram exports.

Exported schemas must be placed alongside the model under /docs.

Note that "JSON" and "JSON Schema" exporting options are not the same. JSON is a swagger specification (with API endpoints, etc), just like the YML but in JSON syntax. JSON Schema is - well - a JSON Schema (with a "model" element defining the root element, etc). Thus, two versions of each document must be made:

  1. A "JSON Schema" export.
  2. A "YML" export.

CEFACT Shout Out

This project completely depends on the good work of the CEFACT ISCO a.k.a. edi3 working group - thanks!!

Note that (so far) I've only done the latter part of the edi3 method. The tl-docgen-model.mdj model is hand-built, not (yet) based on a generated model in accordance to the model interchange spec. I've spent hours and hours steering at CEFACT, though, so please use my interpretations as requirements input the that project. :)

I encourage everyone relevant to join the community and get engaged!

doc_generation's People

Contributors

nissimsan avatar nthabet avatar svanteschubert avatar

Watchers

 avatar

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.