TypeScript OCL (Object Constraint Language) model generated from an Ecore metamodel. Provides type definitions and implementations for OCL 2.4/2.5 AST (Abstract Syntax Tree) nodes.
The metamodel follows the OMG Object Constraint Language specification (v2.4, formal/2014-02-03).
Part of the Eclipse Fennec project.
npm install @emfts/ocl.modelimport { OclFactory, OclPackage } from '@emfts/ocl.model';
// Build AST nodes via the factory
const expr = OclFactory.eINSTANCE.createOperationCallExp();The package also exposes OclSwitch, a visitor base class over the full OCL
metamodel (with super-type fallback dispatch). Evaluators such as
@emfts/ocl.engine extend it:
import { OclSwitch } from '@emfts/ocl.model/OclSwitch';npm install
npm run buildnpm run generateThis regenerates all TypeScript classes in src/generated/ from the Ecore metamodel in model/ocl.ecore. Generated files are marked with @generated and should not be edited manually.
| Registry | npmjs.com |
| Package | @emfts/ocl.model (public) |
| Entry points | . (model + factory) and ./OclSwitch (visitor base) |
| Build output | dist/ (ESM, tsc) — only dist is published (see files in package.json) |
| Source | https://github.com/eclipse-fennec/ocl.model (default branch main) |
| Project | Eclipse Fennec |
Releases are published to the npm registry under the @emfts scope.