This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release22.01
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release22.01 by this push:
     new e4c95d8850 Fixed: Convert CommunicationEventServices mini lang to 
groovy (OFBIZ-9992) (OFBIZ-11164)
e4c95d8850 is described below

commit e4c95d885020ab831af237850f13fe2bc5b5c43c
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Tue Mar 7 11:45:50 2023 +0100

    Fixed: Convert CommunicationEventServices mini lang to groovy (OFBIZ-9992) 
(OFBIZ-11164)
    
    In the new groovy file, CommunicationEventServices.groovy The parameter was 
set
    as the whole object communicationEvent instead of the ID only
    communicationEventId which is the one required. It gave this error :
    Error running Groovy method [sendEmailDated] in Groovy file
    
[component://party/groovyScripts/communication/CommunicationEventServices.groovy]:
    (org.apache.ofbiz.service.ServiceValidationException: The following required
    parameter is missing: [IN] [sendCommEventAsEmail.communicationEventId])
    
    I did the line change and it worked and sent the email.
    
    jleroux: I was a bit lost in (OFBIZ-9992) and (OFBIZ-11164) so I simply 
checked
    sendCommEventAsEmail definition and that's alright
    
    Thanks: Serge Byishimo (https://github.com/sergeByishimo)
---
 .../party/groovyScripts/communication/CommunicationEventServices.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/applications/party/groovyScripts/communication/CommunicationEventServices.groovy
 
b/applications/party/groovyScripts/communication/CommunicationEventServices.groovy
index 0e1d03c3d4..a099944b74 100644
--- 
a/applications/party/groovyScripts/communication/CommunicationEventServices.groovy
+++ 
b/applications/party/groovyScripts/communication/CommunicationEventServices.groovy
@@ -483,7 +483,7 @@ def sendEmailDated() {
     List<GenericValue> communicationEvents = 
from("CommunicationEvent").where(conditions).queryList()
     communicationEvents.each { communicationEvent ->
         // run service don't cover the new transaction need
-        serviceContext.communicationEvent = communicationEvent
+        serviceContext.communicationEventId = 
communicationEvent.communicationEventId
         dispatcher.runSync("sendCommEventAsEmail", serviceContext, 7200, true)
     }
 

Reply via email to