You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2020/09/30 12:35:17 UTC
[ofbiz-framework] 01/03: Fixed: createPartyGroupRoleAndContactMechs
service not working (OFBIZ-11986)
This is an automated email from the ASF dual-hosted git repository.
jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
commit 7b01534208ca83e4c890791821cad54a89ea4a23
Author: Jacques Le Roux <ja...@les7arts.com>
AuthorDate: Sun Sep 27 13:41:52 2020 +0200
Fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)
While researched on ticket OFBIZ-11896 identified that groovy version of
createPartyGroupRoleAndContactMechs service (converted from mini lang at rev
8af7cf877583acf100d1229260e62fe7f4c92563 ) is not working.
Identify these two reasons,
resolvePartyGroupMap called incorrectly
resolvePostalAddressMap and resolveTelecomNumberMap implemented incorrectly
as 'postalAddress' and 'telecomNumber' map processor not available into PartyMapProcs.xml.
There may be more reasons along with these two reasons.
Thanks: Akash Jain for report, Sourabh Jain for incomplete patch (missed 2nd
point from Akash
---
.../party/groovyScripts/party/PartySimpleMethods.groovy | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/applications/party/groovyScripts/party/PartySimpleMethods.groovy b/applications/party/groovyScripts/party/PartySimpleMethods.groovy
index 7e934ec..20605cb 100644
--- a/applications/party/groovyScripts/party/PartySimpleMethods.groovy
+++ b/applications/party/groovyScripts/party/PartySimpleMethods.groovy
@@ -31,7 +31,7 @@ import org.apache.ofbiz.service.ServiceUtil
*/
def createPartyGroupRoleAndContactMechs() {
try {
- parameters.partyGroupContext = resolvePartyGroupMap(parameters)
+ parameters.partyGroupContext = resolvePartyGroupMap()
if (parameters.address1) {
parameters.postalAddressContext = resolvePostalAddressMap()
}
@@ -76,22 +76,21 @@ def createPartyGroupRoleAndContactMechs() {
// TODO need to convert from MapProcessor
def resolvePartyGroupMap() {
- return resolvePartyProcessMap('partyGroup')
+ return resolvePartyProcessMap("party/minilang/party/PartyMapProcs.xml", 'partyGroup')
}
def resolvePostalAddressMap() {
- return resolvePartyProcessMap('postalAddress')
+ return resolvePartyProcessMap("party/minilang/contact/PartyContactMechMapProcs.xml", 'postalAddress')
}
def resolveTelecomNumberMap() {
- return resolvePartyProcessMap('telecomNumber')
+ return resolvePartyProcessMap("party/minilang/contact/PartyContactMechMapProcs.xml", 'telecomNumber')
}
-def resolvePartyProcessMap(String processMapName) {
+def resolvePartyProcessMap(String mapProcessorPath, String processMapName) {
List messages = []
Map resultMap = [:]
- SimpleMapProcessor.runSimpleMapProcessor('component://party/minilang/party/PartyMapProcs.xml',
- processMapName, parameters, resultMap, messages, context.locale)
+ SimpleMapProcessor.runSimpleMapProcessor('component://' + mapProcessorPath, processMapName, parameters, resultMap, messages, context.locale)
// Check errors
if (messages) {
throw new GenericServiceException(messages.join(','))
}
return resultMap
-}
\ No newline at end of file
+}