IDEMPIERE-5572 Scheduler: Allow process to suppress auto sending of process execution result to scheduler recipients (#1668)

This commit is contained in:
hengsin 2023-02-10 21:13:40 +08:00 committed by GitHub
parent 33f2ccf7b8
commit 1daa1c70e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -171,6 +171,9 @@ public class ProcessInfo implements Serializable
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() {
return languageID;
}
@ -994,4 +997,17 @@ public class ProcessInfo implements Serializable
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

View File

@ -269,9 +269,9 @@ public class Scheduler extends AdempiereServer
}
List<String> sendErrors = new ArrayList<>();
// always notify recipients
// notify recipients
Integer[] userIDs = scheduler.getRecipientAD_User_IDs(true);
if (userIDs.length > 0)
if (userIDs.length > 0 && pi.isNotifyRecipients())
{
ProcessInfoUtil.setLogFromDB(pi);
List<File> fileList = new ArrayList<File>();