use of de.metas.process.RelatedProcessDescriptor in project metasfresh-webui-api by metasfresh.
the class ADProcessDescriptorsFactory method toWebuiRelatedProcessDescriptor.
private WebuiRelatedProcessDescriptor toWebuiRelatedProcessDescriptor(@NonNull final RelatedProcessDescriptor relatedProcessDescriptor, @NonNull final IProcessPreconditionsContext preconditionsContext) {
final ProcessId processId = ProcessId.ofAD_Process_ID(relatedProcessDescriptor.getProcessId());
final ProcessDescriptor processDescriptor = getProcessDescriptor(processId);
final ProcessPreconditionsResolutionSupplier preconditionsResolutionSupplier = ProcessPreconditionsResolutionSupplier.builder().preconditionsContext(preconditionsContext).processPreconditionsCheckers(relatedProcessDescriptor.getProcessPreconditionsCheckers()).processDescriptor(processDescriptor).build();
return WebuiRelatedProcessDescriptor.builder().processId(processDescriptor.getProcessId()).processCaption(processDescriptor.getCaption()).processDescription(processDescriptor.getDescription()).debugProcessClassname(processDescriptor.getProcessClassname()).quickAction(relatedProcessDescriptor.isWebuiQuickAction()).defaultQuickAction(relatedProcessDescriptor.isWebuiDefaultQuickAction()).preconditionsResolutionSupplier(preconditionsResolutionSupplier).build();
}
use of de.metas.process.RelatedProcessDescriptor in project metasfresh-webui-api by metasfresh.
the class MaterialCockpitViewFactory method createProcessDescriptor.
private RelatedProcessDescriptor createProcessDescriptor() {
final IADProcessDAO adProcessDAO = Services.get(IADProcessDAO.class);
final int processId = adProcessDAO.retriveProcessIdByClassIfUnique(Env.getCtx(), MD_Cockpit_DocumentDetail_Display.class);
Preconditions.checkArgument(processId > 0, "No AD_Process_ID found for class %s", MD_Cockpit_DocumentDetail_Display.class);
final RelatedProcessDescriptor processDescriptor = RelatedProcessDescriptor.builder().processId(processId).webuiQuickAction(true).build();
return processDescriptor;
}
Aggregations