[ofbiz-framework] branch trunk updated: fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)

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

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


The following commit(s) were added to refs/heads/trunk by this push:
     new cf7164f  fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)
cf7164f is described below

commit cf7164fc64280eb8747073622dea3e0bc4d31ca6
Author: holivier <[hidden email]>
AuthorDate: Wed Oct 7 11:44:49 2020 +0200

    fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)
   
    Service is used for create employee service, and email address is not mandatory, so emailAddressContext should be empty if parameters.emailAddress is empty.
   
    Correction done is to call createPerson before creating emailAddressContext to be able to put set partyId in the if not empty parameters.emailAddress
---
 applications/party/minilang/party/PartySimpleMethods.xml | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/applications/party/minilang/party/PartySimpleMethods.xml b/applications/party/minilang/party/PartySimpleMethods.xml
index 91fb7c8..e8af48a 100644
--- a/applications/party/minilang/party/PartySimpleMethods.xml
+++ b/applications/party/minilang/party/PartySimpleMethods.xml
@@ -120,6 +120,11 @@ under the License.
                 xml-resource="component://party/minilang/contact/PartyContactMechMapProcs.xml"/>
         </if-not-empty>
 
+        <call-service service-name="createPerson" in-map-name="personContext">
+            <result-to-field result-name="partyId" field="partyId"/>
+        </call-service>
+        <check-errors/>
+
         <if-not-empty field="parameters.emailAddress">
             <call-map-processor in-map-name="parameters" out-map-name="emailAddressContext">
                 <simple-map-processor name="emailAddress">
@@ -129,15 +134,10 @@ under the License.
                     </process>
                 </simple-map-processor>
             </call-map-processor>
+            <set field="emailAddressContext.partyId" from="partyId"/>
         </if-not-empty>
         <check-errors/>
-        
-        <call-service service-name="createPerson" in-map-name="personContext">
-            <result-to-field result-name="partyId" field="partyId"/>
-        </call-service>
-        <check-errors/>
-        <set field="emailAddressContext.partyId" from="partyId"/>
-        
+
         <if-not-empty field="parameters.roleTypeId">
             <set field="createPartyRoleCtx.partyId" from-field="partyId"/>
             <set field="createPartyRoleCtx.roleTypeId" from-field="parameters.roleTypeId"/>
@@ -147,7 +147,6 @@ under the License.
         <set field="postalAddContactMechPurpTypeId" from-field="parameters.postalAddContactMechPurpTypeId"/>
         <set field="contactNumber" from-field="parameters.contactNumber"/>
         <set field="phoneContactMechPurpTypeId" from-field="parameters.phoneContactMechPurpTypeId"/>
-        <set field="emailAddress" from-field="emailAddressContext"/>
         <set field="emailContactMechPurpTypeId" from-field="parameters.emailContactMechPurpTypeId"/>
         <call-simple-method method-name="createPartyContactMechs"/>
         <field-to-result field="partyId"/>
@@ -233,6 +232,7 @@ under the License.
 
         <!-- email address -->
         <if-not-empty field="emailAddressContext">
+            <set field="emailAddressContext.partyId" from-field="partyId"/>
             <set field="emailAddressContext.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
             <if-not-empty field="emailContactMechPurpTypeId"> <!-- override with purpose present in parameters, if any (This field is not used now, just here for future implementations) -->
                 <set field="emailAddressContext.contactMechPurposeTypeId" from-field="emailContactMechPurpTypeId"/>