use of de.metas.ui.web.view.IViewsRepository in project metasfresh-webui-api by metasfresh.
the class HUReportProcessInstance method startProcess.
@Override
public synchronized ProcessInstanceResult startProcess(@NonNull final ProcessExecutionContext context) {
final int numberOfCopies = getCopies();
if (numberOfCopies <= 0) {
throw new AdempiereException("@" + PARAM_Copies + "@ > 0");
}
final IViewsRepository viewsRepo = context.getViewsRepo();
final DocumentCollection documentsCollection = context.getDocumentsCollection();
final ViewId viewId = viewRowIdsSelection.getViewId();
final HUEditorView view = HUEditorView.cast(viewsRepo.getView(viewId));
final HUReportExecutorResult reportExecutorResult = HUReportExecutor.newInstance(context.getCtx()).numberOfCopies(numberOfCopies).printPreview(true).executeNow(reportADProcessId, extractHUsToReport(view));
final ADProcessPostProcessService postProcessService = ADProcessPostProcessService.builder().viewsRepo(viewsRepo).documentsCollection(documentsCollection).build();
final ProcessInstanceResult result = postProcessService.postProcess(ADProcessPostProcessRequest.builder().viewId(viewId).processInfo(reportExecutorResult.getProcessInfo()).processExecutionResult(reportExecutorResult.getProcessExecutionResult()).instanceIdOverride(instanceId).build());
return lastExecutionResult = result;
}
use of de.metas.ui.web.view.IViewsRepository in project metasfresh-webui-api by metasfresh.
the class WEBUI_PP_Order_HUEditor_ProcessBase method getPPOrderView.
protected Optional<PPOrderLinesView> getPPOrderView() {
final ViewId parentViewId = getView().getParentViewId();
if (parentViewId == null) {
return Optional.empty();
}
final IViewsRepository viewsRepo = Adempiere.getSpringApplicationContext().getBean(IViewsRepository.class);
final PPOrderLinesView ppOrderView = viewsRepo.getView(parentViewId, PPOrderLinesView.class);
return Optional.of(ppOrderView);
}
Aggregations