Search in sources :

Example 1 with ScoreCardModelContent

use of org.drools.workbench.screens.guided.scorecard.model.ScoreCardModelContent in project drools-wb by kiegroup.

the class GuidedScoreCardEditorPresenter method getModelSuccessCallback.

private RemoteCallback<ScoreCardModelContent> getModelSuccessCallback() {
    return new RemoteCallback<ScoreCardModelContent>() {

        @Override
        public void callback(final ScoreCardModelContent content) {
            // Path is set to null when the Editor is closed (which can happen before async calls complete).
            if (versionRecordManager.getCurrentPath() == null) {
                return;
            }
            model = content.getModel();
            final PackageDataModelOracleBaselinePayload dataModel = content.getDataModel();
            oracle = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), model, dataModel);
            resetEditorPages(content.getOverview());
            addSourcePage();
            addImportsTab(importsWidget);
            view.setContent(model, oracle);
            importsWidget.setContent(oracle, model.getImports(), isReadOnly);
            createOriginalHash(model);
            view.hideBusyIndicator();
        }
    };
}
Also used : ScoreCardModelContent(org.drools.workbench.screens.guided.scorecard.model.ScoreCardModelContent) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) RemoteCallback(org.jboss.errai.common.client.api.RemoteCallback)

Example 2 with ScoreCardModelContent

use of org.drools.workbench.screens.guided.scorecard.model.ScoreCardModelContent in project drools-wb by kiegroup.

the class GuidedScoreCardEditorServiceImpl method constructContent.

@Override
protected ScoreCardModelContent constructContent(Path path, Overview overview) {
    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());
    // Signal opening to interested parties
    resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
    return new ScoreCardModelContent(model, overview, dataModel);
}
Also used : ScoreCardModelContent(org.drools.workbench.screens.guided.scorecard.model.ScoreCardModelContent) ScoreCardModel(org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel) PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) PackageDataModelOracle(org.kie.soup.project.datamodel.oracle.PackageDataModelOracle) GuidedScoreCardModelVisitor(org.drools.workbench.models.guided.scorecard.backend.GuidedScoreCardModelVisitor) ResourceOpenedEvent(org.uberfire.workbench.events.ResourceOpenedEvent)

Aggregations

ScoreCardModelContent (org.drools.workbench.screens.guided.scorecard.model.ScoreCardModelContent)2 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)2 GuidedScoreCardModelVisitor (org.drools.workbench.models.guided.scorecard.backend.GuidedScoreCardModelVisitor)1 ScoreCardModel (org.drools.workbench.models.guided.scorecard.shared.ScoreCardModel)1 RemoteCallback (org.jboss.errai.common.client.api.RemoteCallback)1 PackageDataModelOracle (org.kie.soup.project.datamodel.oracle.PackageDataModelOracle)1 ResourceOpenedEvent (org.uberfire.workbench.events.ResourceOpenedEvent)1