Package org.kie.workbench.common.services.datamodel.oracle

Examples of org.kie.workbench.common.services.datamodel.oracle.PackageDataModelOracle


        this.model = set;
        this.layout = new DirtyableFlexTable();

        layout.setStyleName( "model-builderInner-Background" ); // NON-NLS

        PackageDataModelOracle completions = this.getModeller().getSuggestionCompletions();
        if ( completions.isGlobalVariable( set.getVariable() ) ) {

            List<MethodInfo> infos = completions.getMethodInfosForGlobalVariable( set.getVariable() );
            if ( infos != null ) {
                this.fieldCompletionTexts = new String[ infos.size() ];
                this.fieldCompletionValues = new String[ infos.size() ];
                int i = 0;
                for ( MethodInfo info : infos ) {
                    this.fieldCompletionTexts[ i ] = info.getName();
                    this.fieldCompletionValues[ i ] = info.getNameWithParameters();
                    i++;
                }

                this.variableClass = completions.getGlobalVariable( set.getVariable() );

            } else {
                this.fieldCompletionTexts = new String[ 0 ];
                this.fieldCompletionValues = new String[ 0 ];
                readOnly = true;
            }

        } else {

            FactPattern pattern = mod.getModel().getLHSBoundFact( set.getVariable() );
            if ( pattern != null ) {
                List<String> methodList = completions.getMethodNames( pattern.getFactType() );
                fieldCompletionTexts = new String[ methodList.size() ];
                fieldCompletionValues = new String[ methodList.size() ];
                int i = 0;
                for ( String methodName : methodList ) {
                    fieldCompletionTexts[ i ] = methodName;
                    fieldCompletionValues[ i ] = methodName;
                    i++;
                }
                this.variableClass = pattern.getFactType();
                this.isBoundFact = true;

            } else {
                /*
                 * if the call method is applied on a bound variable created in
                 * the rhs
                 */
                ActionInsertFact patternRhs = mod.getModel().getRHSBoundFact( set.getVariable() );
                if ( patternRhs != null ) {
                    List<String> methodList = completions.getMethodNames( patternRhs.getFactType() );
                    fieldCompletionTexts = new String[ methodList.size() ];
                    fieldCompletionValues = new String[ methodList.size() ];
                    int i = 0;
                    for ( String methodName : methodList ) {
                        fieldCompletionTexts[ i ] = methodName;
                        fieldCompletionValues[ i ] = methodName;
                        i++;
                    }
                    this.variableClass = patternRhs.getFactType();
                    this.isBoundFact = true;
                } else {
                    readOnly = true;
                }
            }
        }

        this.isFactTypeKnown = completions.isFactTypeRecognized( this.variableClass );
        if ( readOnly == null ) {
            this.readOnly = !this.isFactTypeKnown;
        } else {
            this.readOnly = readOnly;
        }
View Full Code Here


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

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

    @Override
    public GuidedDecisionTableEditorContent loadContent( final Path path ) {
        try {
            final GuidedDecisionTable52 model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            final Set<PortableWorkDefinition> workItemDefinitions = workItemsService.loadWorkItemDefinitions( path );
            return new GuidedDecisionTableEditorContent( oracle,
                                                         model,
                                                         workItemDefinitions );
View Full Code Here

    @Override
    public ScoreCardModelContent loadContent( final Path path ) {
        try {
            final ScoreCardModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            return new ScoreCardModelContent( model,
                                              oracle );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

        return new RemoteCallback<DrlModelContent>() {

            @Override
            public void callback( final DrlModelContent content ) {
                final String drl = content.getDrl();
                final PackageDataModelOracle oracle = content.getDataModel();
                if ( drl == null || drl.isEmpty() ) {
                    view.setContent( null,
                                     oracle );
                } else {
                    view.setContent( drl,
View Full Code Here

    @Override
    public FactModelContent loadContent( final Path path ) {
        final FactModels factModels = load( path );
        final List<FactMetaModel> allAvailableTypes = loadAllAvailableTypes( path );
        allAvailableTypes.addAll( factModels.getModels() );
        final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
        return new FactModelContent( factModels,
                                     allAvailableTypes,
                                     oracle );
    }
View Full Code Here

    }

    @Override
    public GuidedDecisionTableEditorContent loadContent( final Path path ) {
        final GuidedDecisionTable52 model = load( path );
        final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
        final Set<PortableWorkDefinition> workItemDefinitions = workItemsService.loadWorkItemDefinitions( path );
        return new GuidedDecisionTableEditorContent( oracle,
                                                     model,
                                                     workItemDefinitions );
    }
View Full Code Here

    @Override
    public GlobalsEditorContent loadContent( final Path path ) {
        try {
            //De-serialize model
            final GlobalsModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );

            return new GlobalsEditorContent( model,
                                             oracle );

        } catch ( Exception e ) {
View Full Code Here

    @Override
    public GuidedTemplateEditorContent loadContent( final Path path ) {
        try {
            final TemplateModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            return new GuidedTemplateEditorContent( oracle,
                                                    model );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

    @Override
    public GuidedTemplateEditorContent loadContent( final Path path ) {
        try {
            final TemplateModel model = load( path );
            final PackageDataModelOracle oracle = dataModelService.getDataModel( path );
            return new GuidedTemplateEditorContent( oracle,
                                                    model );

        } catch ( Exception e ) {
            throw ExceptionUtilities.handleException( e );
View Full Code Here

TOP

Related Classes of org.kie.workbench.common.services.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.