IDEMPIERE-5572 Scheduler: Allow process to suppress auto sending of process execution result to scheduler recipients (#1668)
This commit is contained in:
parent
33f2ccf7b8
commit
1daa1c70e2
|
@ -171,6 +171,9 @@ public class ProcessInfo implements Serializable
|
||||||
|
|
||||||
private int m_AD_Scheduler_ID = 0;
|
private int m_AD_Scheduler_ID = 0;
|
||||||
|
|
||||||
|
/** For scheduler: true to notify scheduler recipients with process execution result using AD_Scheduler.R_MailTexT_ID mail template (if define). Default is true. **/
|
||||||
|
private boolean isNotifyRecipients = true;
|
||||||
|
|
||||||
public int getLanguageID() {
|
public int getLanguageID() {
|
||||||
return languageID;
|
return languageID;
|
||||||
}
|
}
|
||||||
|
@ -994,4 +997,17 @@ public class ProcessInfo implements Serializable
|
||||||
this.m_AD_Scheduler_ID = AD_Scheduler_ID;
|
this.m_AD_Scheduler_ID = AD_Scheduler_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if scheduler should notify scheduler recipients with process execution result
|
||||||
|
*/
|
||||||
|
public boolean isNotifyRecipients() {
|
||||||
|
return isNotifyRecipients;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param isNotifyRecipients if true, scheduler should notify scheduler recipients with process execution result
|
||||||
|
*/
|
||||||
|
public void setNotifyRecipients(boolean isNotifyRecipients) {
|
||||||
|
this.isNotifyRecipients = isNotifyRecipients;
|
||||||
|
}
|
||||||
} // ProcessInfo
|
} // ProcessInfo
|
||||||
|
|
|
@ -269,9 +269,9 @@ public class Scheduler extends AdempiereServer
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> sendErrors = new ArrayList<>();
|
List<String> sendErrors = new ArrayList<>();
|
||||||
// always notify recipients
|
// notify recipients
|
||||||
Integer[] userIDs = scheduler.getRecipientAD_User_IDs(true);
|
Integer[] userIDs = scheduler.getRecipientAD_User_IDs(true);
|
||||||
if (userIDs.length > 0)
|
if (userIDs.length > 0 && pi.isNotifyRecipients())
|
||||||
{
|
{
|
||||||
ProcessInfoUtil.setLogFromDB(pi);
|
ProcessInfoUtil.setLogFromDB(pi);
|
||||||
List<File> fileList = new ArrayList<File>();
|
List<File> fileList = new ArrayList<File>();
|
||||||
|
|
Loading…
Reference in New Issue