use of com.buschmais.xo.api.XOException in project jqa-core-framework by buschmais.
the class AnalyzerVisitor method visitConcept.
@Override
public boolean visitConcept(Concept concept, Severity effectiveSeverity) throws RuleExecutorException {
try {
store.beginTransaction();
ConceptDescriptor conceptDescriptor = store.find(ConceptDescriptor.class, concept.getId());
Result.Status status;
if (conceptDescriptor == null || configuration.isExecuteAppliedConcepts()) {
logger.info("Applying concept '" + concept.getId() + "' with severity: '" + concept.getSeverity().getInfo(effectiveSeverity) + "'.");
reportPlugin.beginConcept(concept);
Result<Concept> result = execute(concept, effectiveSeverity);
reportPlugin.setResult(result);
status = result.getStatus();
if (conceptDescriptor == null) {
conceptDescriptor = store.create(ConceptDescriptor.class);
conceptDescriptor.setId(concept.getId());
conceptDescriptor.setStatus(result.getStatus());
}
reportPlugin.endConcept();
} else {
status = conceptDescriptor.getStatus();
}
store.commitTransaction();
return Result.Status.SUCCESS.equals(status);
} catch (XOException e) {
store.rollbackTransaction();
throw new RuleExecutorException("Cannot apply concept " + concept.getId(), e);
}
}
use of com.buschmais.xo.api.XOException in project jqa-core-framework by buschmais.
the class AnalyzerVisitor method visitConstraint.
@Override
public void visitConstraint(Constraint constraint, Severity effectiveSeverity) throws RuleExecutorException {
logger.info("Validating constraint '" + constraint.getId() + "' with severity: '" + constraint.getSeverity().getInfo(effectiveSeverity) + "'.");
try {
store.beginTransaction();
reportPlugin.beginConstraint(constraint);
reportPlugin.setResult(execute(constraint, effectiveSeverity));
reportPlugin.endConstraint();
store.commitTransaction();
} catch (XOException e) {
store.rollbackTransaction();
throw new RuleExecutorException("Cannot validate constraint " + constraint.getId(), e);
}
}
Aggregations