use of org.compiere.model.I_AD_Process in project adempiere by adempiere.
the class AProcess method startProcess.
private void startProcess(I_AD_Process process) {
final I_AD_Process processTrl = POWrapper.translate(process, I_AD_Process.class);
final VButton button = new VButton(// columnName,
"StartProcess", // mandatory,
false, // isReadOnly,
false, // isUpdateable,
true, processTrl.getName(), processTrl.getDescription(), processTrl.getHelp(), process.getAD_Process_ID());
parent.actionButton(button);
}
use of org.compiere.model.I_AD_Process in project adempiere by adempiere.
the class AProcessModel method fetchProcesses.
public List<I_AD_Process> fetchProcesses(Properties ctx, GridTab gridTab) {
final List<I_AD_Process> emptyList = Collections.unmodifiableList(new ArrayList<I_AD_Process>());
if (gridTab == null) {
return emptyList;
}
final MRole role = MRole.getDefault(ctx, false);
Check.assumeNotNull(role, "No role found for {0}", ctx);
final int AD_Table_ID = gridTab.getAD_Table_ID();
final List<I_AD_Process> list = fetchProcessesForTable(ctx, AD_Table_ID);
for (Iterator<I_AD_Process> it = list.iterator(); it.hasNext(); ) {
final I_AD_Process process = it.next();
// Filter out processes on which we don't have access
final Boolean accessRW = role.checkProcessAccess(process.getAD_Process_ID());
if (accessRW == null) {
logger.log(Level.FINE, "Removing process {0} because user has no access at all to it", process);
it.remove();
continue;
} else if (!accessRW) {
logger.log(Level.FINE, "Removing process {0} because user has only readonly access to it", process);
it.remove();
continue;
}
// Filter out processes which have preconditions which don't apply
if (!isPreconditionApplicable(process, gridTab)) {
logger.log(Level.FINE, "Removing process {0} because preconditions were not met", process);
it.remove();
continue;
}
}
return list;
}
use of org.compiere.model.I_AD_Process in project adempiere by adempiere.
the class AProcessModel method getDescription.
/**
* Gets description/tooltip to be used in Gear
*
* @param process
* @return description/tooltip
*/
public String getDescription(final I_AD_Process process) {
final I_AD_Process processTrl = POWrapper.translate(process, I_AD_Process.class);
String description = processTrl.getDescription();
final IDeveloperModeBL developerModeBL = Services.get(IDeveloperModeBL.class);
if (developerModeBL != null && developerModeBL.isEnabled()) {
if (description == null) {
description = "";
} else {
description += "\n - ";
}
description += "Classname:" + process.getClassname() + ", ID=" + process.getAD_Process_ID();
}
return description;
}
use of org.compiere.model.I_AD_Process in project adempiere by adempiere.
the class AProcessModel method getDisplayName.
/**
* Gets display name to be used in Gear
*
* @param process
* @return process display name
*/
public String getDisplayName(final I_AD_Process process) {
final I_AD_Process processTrl = POWrapper.translate(process, I_AD_Process.class);
String name = processTrl.getName();
final IDeveloperModeBL developerModeBL = Services.get(IDeveloperModeBL.class);
if (developerModeBL != null && developerModeBL.isEnabled()) {
name += "/" + process.getValue();
}
return name;
}
use of org.compiere.model.I_AD_Process in project adempiere by adempiere.
the class AProcess method getPopupMenu.
private JPopupMenu getPopupMenu() {
JPopupMenu popup = new JPopupMenu("ProcessMenu");
List<I_AD_Process> processes = model.fetchProcesses(Env.getCtx(), parent.getCurrentTab());
if (processes.size() == 0)
return null;
for (I_AD_Process process : processes) {
CMenuItem mi = createProcessMenuItem(process);
popup.add(mi);
}
return popup;
}
Aggregations