Search in sources :

Example 1 with ABCAnalysisServiceImpl

use of com.axelor.apps.base.service.ABCAnalysisServiceImpl in project axelor-open-suite by axelor.

the class ABCAnalysisController method runAnalysis.

@SuppressWarnings("unchecked")
public void runAnalysis(ActionRequest request, ActionResponse response) {
    ABCAnalysis abcAnalysis = request.getContext().asType(ABCAnalysis.class);
    try {
        Class<? extends ABCAnalysisServiceImpl> clazz = (Class<? extends ABCAnalysisServiceImpl>) Class.forName(abcAnalysis.getTypeSelect());
        Beans.get(clazz).runAnalysis(Beans.get(ABCAnalysisRepository.class).find(abcAnalysis.getId()));
        response.setReload(true);
    } catch (ClassNotFoundException | AxelorException e) {
        TraceBackService.trace(response, e, ResponseMessageType.ERROR);
    }
}
Also used : AxelorException(com.axelor.exception.AxelorException) ABCAnalysis(com.axelor.apps.base.db.ABCAnalysis) ABCAnalysisClass(com.axelor.apps.base.db.ABCAnalysisClass) ABCAnalysisServiceImpl(com.axelor.apps.base.service.ABCAnalysisServiceImpl)

Aggregations

ABCAnalysis (com.axelor.apps.base.db.ABCAnalysis)1 ABCAnalysisClass (com.axelor.apps.base.db.ABCAnalysisClass)1 ABCAnalysisServiceImpl (com.axelor.apps.base.service.ABCAnalysisServiceImpl)1 AxelorException (com.axelor.exception.AxelorException)1