private void startValidation(EA.ObjectType ot, Object eaObject, SQLRepository repository, Boolean singleRulecheck, Boolean validateAll)
        {
            this.fullValidation  = validateAll;
            this.singleRuleCheck = singleRulecheck;



            switch (ot)
            {
            //do rules for elements and their attributes/methods
            case EA.ObjectType.otElement:
                validateEAElement(eaObject, repository, singleRulecheck);
                break;

            //do rules for connectors
            case EA.ObjectType.otConnector:
                SQLConnector connector = eaObject as SQLConnector;
                RuleControl.deleteRuleResults(EA.ObjectType.otConnector, connector.ConnectorID);
                RuleControl.doRules(connector, repository);
                break;

            //do rules for attributes
            case EA.ObjectType.otAttribute:
                SQLAttribute attribute = eaObject as SQLAttribute;
                RuleControl.deleteRuleResults(EA.ObjectType.otAttribute, attribute.AttributeID);
                RuleControl.doRules(attribute, repository);
                break;

            //do rules for methods
            case EA.ObjectType.otMethod:
                SQLMethod method = eaObject as SQLMethod;
                RuleControl.deleteRuleResults(EA.ObjectType.otMethod, method.MethodID);
                RuleControl.doRules(method, repository);
                break;

            //do rules for packages
            case EA.ObjectType.otPackage:
                validatePackage(eaObject, repository, singleRulecheck, validateAll);
                break;

            case EA.ObjectType.otDiagram:
                SQLDiagram diagram = eaObject as SQLDiagram;
                RuleControl.deleteRuleResults(EA.ObjectType.otDiagram, diagram.DiagramID);
                RuleControl.doRules(diagram, repository);
                break;
            }


            if (DoGlobalRules)
            {
                RuleControl.doGlobalRules(repository);
            }

            endValidation(repository);
        }