public AnalysisEnvironment(Extent m1Extent, Extent m2Extent, Repository repo) { this.m2Extent = m2Extent; Package cmofPackage = (cmof.Package) repo.getExtent(Repository.CMOF_EXTENT_NAME).query("Package:cmof"); this.factory = (cmofFactory) repo.createFactory(m2Extent, cmofPackage); OclEnvironment oclEnvironment = m1Extent.getAdaptor(OclEnvironment.class); if (oclEnvironment == null) { repo.configureExtent(m1Extent, m2Extent); oclEnvironment = m1Extent.getAdaptor(OclEnvironment.class); } if (oclEnvironment == null) { throw new RuntimeException("assert"); } this.oclEnvironment = oclEnvironment; }
public AutomatonExample(Extent m1, SemanticsFactory semanticFactory) { System theExampleSystem = (System) m1.query("System:MySystem"); this.signalA = (Signal) m1.query("System:MySystem/Signal:a"); this.signalB = (Signal) m1.query("System:MySystem/Signal:b"); Port envInPort = (Port) m1.query("System:MySystem/Port:EnvIn"); Port envOutPort = (Port) m1.query("System:MySystem/Port:EnvOut"); InstanceFactory.initialize(semanticFactory); InstanceFactory instanceFactory = InstanceFactory.getFactory(); SystemInstance systemInstance = instanceFactory.createSystemInstance(theExampleSystem); for (PortInstance portInstance : systemInstance.getPort()) { if (portInstance.getClassifier().contains(envInPort)) { this.envInPort = portInstance; } else if (portInstance.getClassifier().contains(envOutPort)) { this.envOutPort = portInstance; } } }
public PrimitiveType getBooleanType() { return (PrimitiveType) m2Extent.query("Package:core/Package:primitivetypes/PrimitiveType:Boolean"); }
public PrimitiveType getIntegerType() { return (PrimitiveType) m2Extent.query("Package:core/Package:primitivetypes/PrimitiveType:Integer"); }
public PrimitiveType getStringType() { return (PrimitiveType) m2Extent.query("Package:core/Package:primitivetypes/PrimitiveType:String"); }
public PrimitiveType getUnlimitedNaturalType() { return (PrimitiveType) m2Extent.query("Package:core/Package:primitivetypes/PrimitiveType:UnlimitedNatural"); }