use of org.drools.workbench.screens.guided.dtree.model.GuidedDecisionTreeEditorContent in project drools-wb by kiegroup.
the class GuidedDecisionTreeEditorServiceImpl method constructContent.
@Override
protected GuidedDecisionTreeEditorContent constructContent(Path path, Overview overview) {
final GuidedDecisionTree model = load(path);
final PackageDataModelOracle oracle = dataModelService.getDataModel(path);
final PackageDataModelOracleBaselinePayload dataModel = new PackageDataModelOracleBaselinePayload();
// Get FQCN's used by model
final GuidedDecisionTreeModelVisitor visitor = new GuidedDecisionTreeModelVisitor(model);
final Set<String> consumedFQCNs = visitor.getConsumedModelClasses();
// Get FQCN's used by Globals
consumedFQCNs.addAll(oracle.getPackageGlobals().values());
DataModelOracleUtilities.populateDataModel(oracle, dataModel, consumedFQCNs);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
return new GuidedDecisionTreeEditorContent(model, overview, dataModel);
}
use of org.drools.workbench.screens.guided.dtree.model.GuidedDecisionTreeEditorContent in project drools-wb by kiegroup.
the class GuidedDecisionTreeEditorPresenter method getModelSuccessCallback.
private RemoteCallback<GuidedDecisionTreeEditorContent> getModelSuccessCallback() {
return new RemoteCallback<GuidedDecisionTreeEditorContent>() {
@Override
public void callback(final GuidedDecisionTreeEditorContent content) {
// Path is set to null when the Editor is closed (which can happen before async calls complete).
if (versionRecordManager.getCurrentPath() == null) {
return;
}
GuidedDecisionTreeEditorPresenter.this.content = content;
model = content.getModel();
metadata = content.getOverview().getMetadata();
final PackageDataModelOracleBaselinePayload dataModel = content.getDataModel();
oracle = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), model, dataModel);
resetEditorPages(content.getOverview());
addSourcePage();
addImportsTab(importsWidget);
importsWidget.setContent(oracle, model.getImports(), isReadOnly);
view.setModel(model, isReadOnly);
view.setDataModel(oracle, isReadOnly);
view.hideBusyIndicator();
// If there were any parsing errors give the User the option to remove the broken DRL or ignore it
if (!model.getParserErrors().isEmpty()) {
final ParserMessagesPopup popup = new ParserMessagesPopup(model);
popup.show();
}
createOriginalHash(model);
}
};
}
Aggregations