Package org.openengsb.core.ekb.common

Examples of org.openengsb.core.ekb.common.AdvancedModelWrapper


     */
    private List<AdvancedModelWrapper> updateReferencedModelsByEO(EngineeringObjectModelWrapper model) {
        List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
        for (Field field : model.getForeignKeyFields()) {
            try {
                AdvancedModelWrapper result = performMerge(model, loadReferencedModel(model, field));
                if (result != null) {
                    updates.add(result);
                }
            } catch (EDBException e) {
                LOGGER.debug("Skipped referenced model for field {}, since it does not exist.", field, e);
View Full Code Here


            Map<Object, AdvancedModelWrapper> updated, EKBCommit commit) throws EKBException {
        List<AdvancedModelWrapper> updates = new ArrayList<AdvancedModelWrapper>();
        List<EDBObject> references = model.getModelsReferringToThisModel(edbService);
        for (EDBObject reference : references) {
            EDBModelObject modelReference = new EDBModelObject(reference, modelRegistry, edbConverter);
            AdvancedModelWrapper ref = updateEOByUpdatedModel(modelReference, model, updated);
            if (!updated.containsKey(ref.getCompleteModelOID())) {
                updates.add(ref);
            }
        }
        return updates;
    }
View Full Code Here

     */
    private AdvancedModelWrapper updateEOByUpdatedModel(EDBModelObject reference, AdvancedModelWrapper model,
            Map<Object, AdvancedModelWrapper> updated) {
        ModelDescription source = model.getModelDescription();
        ModelDescription description = reference.getModelDescription();
        AdvancedModelWrapper wrapper = updated.get(reference.getOID());
        Object ref = null;
        if (wrapper == null) {
            ref = reference.getCorrespondingModel();
        } else {
            ref = wrapper.getUnderlyingModel();
        }
        Object transformResult = transformationEngine.performTransformation(source, description,
            model.getUnderlyingModel(), ref);
        return AdvancedModelWrapper.wrap(transformResult);
    }
View Full Code Here

    /**
     * Enhances the EKBCommit for the insertion of EngineeringObjects.
     */
    private void enhanceCommitInserts(EKBCommit commit) throws EKBException {
        for (OpenEngSBModel model : commit.getInserts()) {
            AdvancedModelWrapper simple = AdvancedModelWrapper.wrap(model);
            if (simple.isEngineeringObject()) {
                performInsertEOLogic(simple.toEngineeringObject());
            }
        }
    }
View Full Code Here

        }
        ModelDescription sourceDesc = source.getModelDescription();
        ModelDescription targetDesc = target.getModelDescription();
        Object transformResult = transformationEngine.performTransformation(sourceDesc, targetDesc,
            source.getUnderlyingModel(), target.getUnderlyingModel());
        AdvancedModelWrapper wrapper = AdvancedModelWrapper.wrap(transformResult);
        wrapper.removeOpenEngSBModelEntry(EDBConstants.MODEL_VERSION);
        return wrapper;
    }
View Full Code Here

    /**
     * Merges the given EngineeringObject with the referenced model which is defined in the given field.
     */
    private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
        AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
        if (result != null) {
            model = result.toEngineeringObject();
        }
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.ekb.common.AdvancedModelWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.