Search in sources :

Example 1 with RelatedProcessDescriptor

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();
}
Also used : ProcessDescriptor(de.metas.ui.web.process.descriptor.ProcessDescriptor) RelatedProcessDescriptor(de.metas.process.RelatedProcessDescriptor) WebuiRelatedProcessDescriptor(de.metas.ui.web.process.descriptor.WebuiRelatedProcessDescriptor) ProcessId(de.metas.ui.web.process.ProcessId)

Example 2 with RelatedProcessDescriptor

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;
}
Also used : RelatedProcessDescriptor(de.metas.process.RelatedProcessDescriptor) IADProcessDAO(de.metas.process.IADProcessDAO)

Aggregations

RelatedProcessDescriptor (de.metas.process.RelatedProcessDescriptor)2 IADProcessDAO (de.metas.process.IADProcessDAO)1 ProcessId (de.metas.ui.web.process.ProcessId)1 ProcessDescriptor (de.metas.ui.web.process.descriptor.ProcessDescriptor)1 WebuiRelatedProcessDescriptor (de.metas.ui.web.process.descriptor.WebuiRelatedProcessDescriptor)1