use of org.asqatasun.ruleimplementation.RuleImplementation in project Asqatasun by Asqatasun.
the class ProcessorServiceImpl method process.
@Override
public Collection<ProcessResult> process(Collection<Content> contentList, Collection<Test> testList) {
Collection<ProcessResult> processResultList = new ArrayList<>();
Processor processor = processorFactory.create();
for (Content content : contentList) {
if (content instanceof SSP) {
processor.setSSP((SSP) content);
for (Test test : testList) {
if (!test.getNoProcess()) {
RuleImplementation ruleImplementation = ruleImplementationLoaderService.loadRuleImplementation(test);
processor.setRuleImplementation(ruleImplementation);
processor.run();
processResultList.add(processor.getResult());
}
}
}
}
return processResultList;
}
use of org.asqatasun.ruleimplementation.RuleImplementation in project Asqatasun by Asqatasun.
the class RuleImplementationLoaderServiceImpl method loadRuleImplementation.
@Override
public RuleImplementation loadRuleImplementation(Test test) {
RuleImplementationLoader ruleImplementationLoader = ruleImplementationLoaderFactory.create(archiveRoot, test.getRuleArchiveName(), test.getRuleClassName());
ruleImplementationLoader.run();
RuleImplementation ruleImplementation = ruleImplementationLoader.getResult();
ruleImplementation.setTest(test);
ruleImplementation.setProcessResultDataService(processResultDataService);
ruleImplementation.setNomenclatureLoaderService(nomenclatureLoaderService);
// of a given ProcessResult in this case
if (ruleImplementation instanceof AbstractSiteRuleWithPageResultImplementation) {
((AbstractSiteRuleWithPageResultImplementation) ruleImplementation).setProcessRemarkDataService(processRemarkDataService);
}
return ruleImplementation;
}
use of org.asqatasun.ruleimplementation.RuleImplementation in project Asqatasun by Asqatasun.
the class ConsolidatorServiceImpl method consolidate.
@Override
public Collection<ProcessResult> consolidate(Collection<ProcessResult> grossResultList, Collection<Test> testList) {
List<ProcessResult> resultList = new ArrayList<>();
for (Test test : testList) {
// if the rule archive name is empty, the test is not launched
if (!test.getNoProcess()) {
RuleImplementation ruleImplementation = ruleImplementationLoaderService.loadRuleImplementation(test);
Consolidator consolidator = consolidatorFactory.create(grossResultList, ruleImplementation, ProcessRemarkServiceFactory.create(processRemarkDataService, evidenceElementDataService, evidenceDataService));
consolidator.run();
resultList.addAll(consolidator.getResult());
}
}
return resultList;
}
Aggregations