Package org.drools.workbench.models.datamodel.oracle

Examples of org.drools.workbench.models.datamodel.oracle.ProjectDataModelOracle


            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);

            // TODO for the ProjectDataModelOracle, in fact, the getModelFields() method should only return the declared
            // TODO fields per fact type, i.e. similar to getClass().getDeclaredFields(), which may including @this
            Map<String, ModelField[]> modelFields = projectDataModelOracle.getModelFields();
            if (modelFields != null) {
                String inheritorFullName = extendingPackage + "." + extendingName;
                ModelField[] fields = modelFields.get(inheritorFullName);

                assertNotNull(fields);
View Full Code Here


            Path projectPath = ioService.get(projectUri);
            assertNotNull(projectPath);

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, paths.convert(projectPath)));

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(paths.convert(projectPath));

            String annotationTest = "org.kie.test.AnnotationsBean";
            String annotationTestSerializable = "org.kie.test.AnnotationsBeanSerializable";

            boolean isTestLoaded = false;
View Full Code Here

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);
            String types[] = ProjectDataModelOracleUtils.getFactTypes(projectDataModelOracle);
            if (types != null) {
                for (String type : types) {
                    if ((objectPackage + "." + objectName).equals(type)) {
                        // Check type annotations
                        Set<Annotation> annotations = ProjectDataModelOracleUtils.getTypeAnnotations(projectDataModelOracle, type);
                        assertNotNull(annotations);
                        assertEquals("Type " + type + " should hold 3 annotations: ", 3, annotations.size());
                        checkAnnotation(annotations, AnnotationDefinitionTO.LABEL_ANNOTATION, objectLabelValue);
                        checkAnnotation(annotations, AnnotationDefinitionTO.DESCRIPTION_ANNOTATION, objectDescriptionValue);
                        checkAnnotation(annotations, AnnotationDefinitionTO.ROLE_ANNOTATION, objectRoleValue);

                        // Check type field annotations
                        ModelField[] fields = projectDataModelOracle.getProjectModelFields().get(type);
                        assertNotNull(fields);
                        assertEquals("Error in type " + type + "'s fields: ", 2, fields.length);
                        Map<String, Set<Annotation>> mFieldAnnotations = ProjectDataModelOracleUtils.getTypeFieldsAnnotations(projectDataModelOracle, type);
                        assertNotNull(mFieldAnnotations);
                        Set fieldAnnotations = mFieldAnnotations.get(fieldName);
View Full Code Here

            invalidateDMOProjectCache.fire(new InvalidateDMOProjectCacheEvent(null, null, path));
            DataModelTO reloadedModel = modelerService.loadModel(project);
            assertNotNull(reloadedModel);

            ProjectDataModelOracle projectDataModelOracle = dataModelService.getProjectDataModel(path);

            // TODO for the ProjectDataModelOracle, in fact, the getModelFields() method should only return the declared
            // TODO fields per fact type, i.e. similar to getClass().getDeclaredFields(), which may including @this
            Map<String, ModelField[]> modelFields = projectDataModelOracle.getProjectModelFields();
            if (modelFields != null) {
                String inheritorFullName = extendingPackage + "." + extendingName;
                ModelField[] fields = modelFields.get(inheritorFullName);

                assertNotNull(fields);
View Full Code Here

        this.type = type;
    }

    @Override
    protected ProjectDataModelOracle getProjectDataModelOracle( final Path path ) {
        final ProjectDataModelOracle dmo = new ProjectDataModelOracleImpl();
        dmo.addProjectModelFields( new HashMap<String, ModelField[]>() {{
            put( "org.drools.workbench.screens.dtablexls.backend.server.indexing.classes.Applicant",
                 new ModelField[]{ new ModelField( "age",
                                                   "java.lang.Integer",
                                                   ModelField.FIELD_CLASS_TYPE.REGULAR_CLASS,
                                                   ModelField.FIELD_ORIGIN.DECLARED,
View Full Code Here

        try {
            final String content = ioService.readAllString( path );
            final ScoreCardModel model = GuidedScoreCardXMLPersistence.getInstance().unmarshall( content );

            final ProjectDataModelOracle dmo = getProjectDataModelOracle( path );
            final DefaultIndexBuilder builder = new DefaultIndexBuilder();
            final GuidedScoreCardIndexVisitor visitor = new GuidedScoreCardIndexVisitor( dmo,
                                                                                         builder,
                                                                                         model );
            visitor.visit();
View Full Code Here

            if ( packageDescr == null ) {
                logger.error( "Unable to parse DRL for '" + path.toUri().toString() + "'." );
                return index;
            }

            final ProjectDataModelOracle dmo = getProjectDataModelOracle( path );
            final DefaultIndexBuilder builder = new DefaultIndexBuilder();
            final PackageDescrIndexVisitor visitor = new PackageDescrIndexVisitor( dmo,
                                                                                   builder,
                                                                                   packageDescr );
            visitor.visit();
View Full Code Here

            if ( packageDescr == null ) {
                logger.error( "Unable to parse DRL for '" + path.toUri().toString() + "'." );
                return index;
            }

            final ProjectDataModelOracle dmo = getProjectDataModelOracle( path );
            final DefaultIndexBuilder builder = new DefaultIndexBuilder();
            final PackageDescrIndexVisitor visitor = new PackageDescrIndexVisitor( dmo,
                                                                                   builder,
                                                                                   packageDescr );
            visitor.visit();
View Full Code Here

    @Override
    public DrlModelContent loadContent( final Path path ) {
        try {
            final String drl = load( path );
            final ProjectDataModelOracle oracle = dataModelService.getProjectDataModel( path );
            final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes( oracle );

            return new DrlModelContent( drl,
                                        Arrays.asList( fullyQualifiedClassNames ) );
View Full Code Here

    @Override
    public List<String> loadClassFields( final Path path,
                                         final String fullyQualifiedClassName ) {
        try {
            final ProjectDataModelOracle oracle = dataModelService.getProjectDataModel( path );
            final String[] fieldNames = DataModelOracleUtilities.getFieldNames( oracle,
                                                                                fullyQualifiedClassName );
            return Arrays.asList( fieldNames );

        } catch ( Exception e ) {
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.datamodel.oracle.ProjectDataModelOracle

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.