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

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


                                           FieldAccessorsAndMutators.BOTH,
                                           DataType.TYPE_STRING ) )
                .end()
                .build();

        final PackageDataModelOracle packageLoader = PackageDataModelOracleBuilder.newPackageOracleBuilder()
                .setProjectOracle( projectLoader )
                .build();

        //Emulate server-to-client conversions
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl();
        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setModelFields( projectLoader.getProjectModelFields() );
        dataModel.setWorkbenchEnumDefinitions( packageLoader.getPackageWorkbenchDefinitions() );
        populateDataModelOracle( mock( Path.class ),
                                 model,
                                 oracle,
                                 dataModel );
View Full Code Here


                                           FieldAccessorsAndMutators.BOTH,
                                           DataType.TYPE_STRING ) )
                .end()
                .build();

        final PackageDataModelOracle packageLoader = PackageDataModelOracleBuilder.newPackageOracleBuilder()
                .setProjectOracle( projectLoader )
                .addEnum( "'Driver.gender' : ['M', 'F']",
                          Thread.currentThread().getContextClassLoader() )
                .build();

        //Emulate server-to-client conversions
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl();
        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setModelFields( projectLoader.getProjectModelFields() );
        dataModel.setWorkbenchEnumDefinitions( packageLoader.getPackageWorkbenchDefinitions() );
        populateDataModelOracle( mock( Path.class ),
                                 model,
                                 oracle,
                                 dataModel );
View Full Code Here

public class GuidedDecisionTableTest {

    @Test
    public void testValueLists() {
        final GuidedDecisionTable52 model = new GuidedDecisionTable52();
        final PackageDataModelOracle loader = PackageDataModelOracleBuilder.newPackageOracleBuilder()
                .addEnum( "Driver",
                          "name",
                          new String[]{ "bob", "michael" } )
                .addEnum( "Person",
                          "rating",
                          new String[]{ "1", "2" } )
                .build();

        //Emulate server-to-client conversions
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl();
        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setModelFields( loader.getProjectModelFields() );
        dataModel.setWorkbenchEnumDefinitions( loader.getPackageWorkbenchDefinitions() );
        populateDataModelOracle( mock( Path.class ),
                                 model,
                                 oracle,
                                 dataModel );
        final GuidedDecisionTableUtils utils = new GuidedDecisionTableUtils( model,
View Full Code Here

    }

    @Test
    public void testNoConstraintLists() {
        final GuidedDecisionTable52 model = new GuidedDecisionTable52();
        final PackageDataModelOracle loader = PackageDataModelOracleBuilder.newPackageOracleBuilder()
                .addEnum( "Driver",
                          "name",
                          new String[]{ "bob", "michael" } )
                .build();

        //Emulate server-to-client conversions
        final AsyncPackageDataModelOracle oracle = new AsyncPackageDataModelOracleImpl();
        final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
        dataModel.setModelFields( loader.getProjectModelFields() );
        populateDataModelOracle( mock( Path.class ),
                                 model,
                                 oracle,
                                 dataModel );
        final GuidedDecisionTableUtils utils = new GuidedDecisionTableUtils( model,
View Full Code Here

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

        } catch ( Exception e ) {
View Full Code Here

    @Override
    public DrlModelContent loadContent( final Path path ) {
        try {
            final String drl = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes( oracle );
            final List<DSLSentence> dslConditions = oracle.getPackageDslConditionSentences();
            final List<DSLSentence> dslActions = oracle.getPackageDslActionSentences();

            //Signal opening to interested parties
            resourceOpenedEvent.fire( new ResourceOpenedEvent( path,
                    sessionInfo ) );
View Full Code Here

    @Override
    public ScoreCardModelContent loadContent( final Path path ) {
        try {
            final ScoreCardModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
            final GuidedScoreCardModelVisitor visitor = new GuidedScoreCardModelVisitor( model );
            DataModelOracleUtilities.populateDataModel( oracle,
                                                        dataModel,
                                                        visitor.getConsumedModelClasses() );
View Full Code Here

    @Override
    public RuleModel load( final Path path ) {
        try {
            final String drl = ioService.readAllString( Paths.convert( path ) );
            final List<String> globals = utilities.loadGlobalsForPackage( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );

            RuleModel ruleModel = null;
            if ( dslrResourceType.accept( path ) ) {
                final String[] dsls = utilities.loadDslsForPackage( path );
                ruleModel = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL( drl,
View Full Code Here

    @Override
    public GuidedEditorContent loadContent( final Path path ) {
        try {
            final RuleModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();

            //Get FQCN's used by model
            final GuidedRuleModelVisitor visitor = new GuidedRuleModelVisitor( model );
            final Set<String> consumedFQCNs = visitor.getConsumedModelClasses();

            //Get FQCN's used by Globals
            consumedFQCNs.addAll( oracle.getPackageGlobals().values() );

            DataModelOracleUtilities.populateDataModel( oracle,
                                                        dataModel,
                                                        consumedFQCNs );
View Full Code Here

    @Override
    public ScoreCardModelContent loadContent( final Path path ) {
        try {
            final ScoreCardModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
            final GuidedScoreCardModelVisitor visitor = new GuidedScoreCardModelVisitor( model );
            DataModelOracleUtilities.populateDataModel( oracle,
                                                        dataModel,
                                                        visitor.getConsumedModelClasses() );
View Full Code Here

TOP

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

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.