use of org.uberfire.workbench.events.ResourceOpenedEvent in project drools-wb by kiegroup.
the class GuidedDecisionTableGraphEditorServiceImpl method constructContent.
@Override
protected GuidedDecisionTableEditorGraphContent constructContent(final Path path, final Overview overview) {
final GuidedDecisionTableEditorGraphModel model = load(path);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
return new GuidedDecisionTableEditorGraphContent(model, overview);
}
use of org.uberfire.workbench.events.ResourceOpenedEvent in project drools-wb by kiegroup.
the class GuidedRuleTemplateEditorServiceImpl method constructContent.
@Override
protected GuidedTemplateEditorContent constructContent(Path path, Overview overview) {
final TemplateModel 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());
// Get FQCN's of collections defined in project settings
// they can be used in From Collect expressions
consumedFQCNs.addAll(oracle.getModuleCollectionTypes().entrySet().stream().filter(entry -> entry.getValue()).map(entry -> entry.getKey()).collect(Collectors.toSet()));
DataModelOracleUtilities.populateDataModel(oracle, dataModel, consumedFQCNs);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
return new GuidedTemplateEditorContent(model, overview, dataModel);
}
use of org.uberfire.workbench.events.ResourceOpenedEvent in project drools-wb by kiegroup.
the class ScoreCardXLSServiceImpl method load.
@Override
public InputStream load(final Path path, final String sessionId) {
try {
final InputStream inputStream = ioService.newInputStream(Paths.convert(path), StandardOpenOption.READ);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, getSessionInfo(sessionId)));
return inputStream;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
use of org.uberfire.workbench.events.ResourceOpenedEvent in project drools-wb by kiegroup.
the class DecisionTableXLSServiceImpl method load.
@Override
public InputStream load(final Path path, final String sessionId) {
try {
final InputStream inputStream = ioService.newInputStream(Paths.convert(path), StandardOpenOption.READ);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, getSessionInfo(sessionId)));
return inputStream;
} catch (Exception e) {
throw ExceptionUtilities.handleException(e);
}
}
Aggregations