use of org.drools.workbench.screens.drltext.model.DrlModelContent in project drools-wb by kiegroup.
the class DRLTextEditorServiceImpl method constructContent.
@Override
protected DrlModelContent constructContent(Path path, Overview overview) {
final PackageDataModelOracle oracle = dataModelService.getDataModel(path);
final String[] fullyQualifiedClassNames = DataModelOracleUtilities.getFactTypes(oracle);
final List<DSLSentence> dslConditions = oracle.getExtensions(DSLConditionSentence.INSTANCE);
final List<DSLSentence> dslActions = oracle.getExtensions(DSLActionSentence.INSTANCE);
// Signal opening to interested parties
resourceOpenedEvent.fire(new ResourceOpenedEvent(path, safeSessionInfo));
return new DrlModelContent(load(path), overview, Arrays.asList(fullyQualifiedClassNames), dslConditions, dslActions);
}
use of org.drools.workbench.screens.drltext.model.DrlModelContent in project drools-wb by kiegroup.
the class DRLTextEditorServiceImplCDITest method testLoadContent.
@Test
public void testLoadContent() throws Exception {
final DrlModelContent content = drlService.loadContent(getPath(CAR_DRIVING_LICENSE));
Assertions.assertThat(content.getDrl()).isEqualTo(drlService.load(getPath(CAR_DRIVING_LICENSE)));
Assertions.assertThat(content.getFullyQualifiedClassNames()).hasSize(3);
Assertions.assertThat(content.getFullyQualifiedClassNames()).contains("org.kiegroup.Person", "org.kiegroup.DrivingLicenseApplication", "org.kiegroup.storage.Storage");
}
Aggregations