Search in sources :

Example 1 with RuleImplementation

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;
}
Also used : SSP(org.asqatasun.entity.audit.SSP) Processor(org.asqatasun.processor.Processor) Test(org.asqatasun.entity.reference.Test) Content(org.asqatasun.entity.audit.Content) ArrayList(java.util.ArrayList) ProcessResult(org.asqatasun.entity.audit.ProcessResult) RuleImplementation(org.asqatasun.ruleimplementation.RuleImplementation)

Example 2 with RuleImplementation

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;
}
Also used : AbstractSiteRuleWithPageResultImplementation(org.asqatasun.ruleimplementation.AbstractSiteRuleWithPageResultImplementation) RuleImplementationLoader(org.asqatasun.ruleimplementationloader.RuleImplementationLoader) RuleImplementation(org.asqatasun.ruleimplementation.RuleImplementation)

Example 3 with 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;
}
Also used : Test(org.asqatasun.entity.reference.Test) ArrayList(java.util.ArrayList) ProcessResult(org.asqatasun.entity.audit.ProcessResult) Consolidator(org.asqatasun.consolidator.Consolidator) RuleImplementation(org.asqatasun.ruleimplementation.RuleImplementation)

Aggregations

RuleImplementation (org.asqatasun.ruleimplementation.RuleImplementation)3 ArrayList (java.util.ArrayList)2 ProcessResult (org.asqatasun.entity.audit.ProcessResult)2 Test (org.asqatasun.entity.reference.Test)2 Consolidator (org.asqatasun.consolidator.Consolidator)1 Content (org.asqatasun.entity.audit.Content)1 SSP (org.asqatasun.entity.audit.SSP)1 Processor (org.asqatasun.processor.Processor)1 AbstractSiteRuleWithPageResultImplementation (org.asqatasun.ruleimplementation.AbstractSiteRuleWithPageResultImplementation)1 RuleImplementationLoader (org.asqatasun.ruleimplementationloader.RuleImplementationLoader)1