RED-10708: Tables as components in DM
This commit is contained in:
parent
c3e0aae800
commit
a9fff497b5
@ -82,9 +82,9 @@ class TableComponentsIntegrationTest extends AbstractRedactionIntegrationTest {
|
||||
var entityLog = redactionStorageService.getEntityLog(TEST_DOSSIER_ID, TEST_FILE_ID);
|
||||
boolean tableEntityFound = entityLog.getEntityLogEntry()
|
||||
.stream()
|
||||
.anyMatch(entry -> entry.getMatchedRule() != null && entry.getMatchedRule().contains("DOC.100.0"));
|
||||
.anyMatch(entry -> entry.getMatchedRule() != null && entry.getMatchedRule().contains("T.0.0"));
|
||||
|
||||
assertTrue(tableEntityFound, "Expected table entity creation ('DOC.100.0') to be present in the entity log");
|
||||
assertTrue(tableEntityFound, "Expected table entity creation ('T.0.0') to be present in the entity log");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -69,12 +69,12 @@ query "getFileAttributes"
|
||||
|
||||
//------------------------------------ table rules ------------------------------------
|
||||
|
||||
rule "DOC.100.0: Create TableEntities for all Tables"
|
||||
rule "T.0.0: Create TableEntities for all Tables"
|
||||
when
|
||||
$table: Table()
|
||||
then
|
||||
Optional<TableEntity> tableEntity = entityCreationService.bySemanticNode($table, "Table", EntityType.ENTITY);
|
||||
tableEntity.ifPresent(t -> t.apply("DOC.100.0", "Table found.", "n-a"));
|
||||
tableEntity.ifPresent(t -> t.apply("T.0.0", "Table found.", "n-a"));
|
||||
end
|
||||
|
||||
//------------------------------------ Headlines rules ------------------------------------
|
||||
|
||||
@ -45,12 +45,11 @@ query "getComponents"
|
||||
|
||||
//------------------------------------ table rules ------------------------------------
|
||||
|
||||
rule "TableComponents.900.0: Create components for all table entities."
|
||||
salience -900
|
||||
rule "TableComponents.0.0: Create components for all table entities."
|
||||
when
|
||||
$tables: List() from collect (Entity(type == "Table"))
|
||||
then
|
||||
componentCreationService.createComponentForTables("TableComponents.900.0", $tables);
|
||||
componentCreationService.createComponentForTables("TableComponents.0.0", $tables);
|
||||
end
|
||||
|
||||
//------------------------------------ Default Components rules ------------------------------------
|
||||
|
||||
@ -68,6 +68,15 @@ query "getFileAttributes"
|
||||
$fileAttribute: FileAttribute()
|
||||
end
|
||||
|
||||
//------------------------------------ T rules ------------------------------------
|
||||
rule "T.0.0: Create TableEntities for all Tables"
|
||||
when
|
||||
$table: Table()
|
||||
then
|
||||
Optional<TableEntity> tableEntity = entityCreationService.bySemanticNode($table, "Table", EntityType.ENTITY);
|
||||
tableEntity.ifPresent(t -> t.apply("T.0.0", "Table found.", "n-a"));
|
||||
end
|
||||
|
||||
//------------------------------------ H rules ------------------------------------
|
||||
|
||||
// Rule unit: H.0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user