svn commit: r464511 - in /incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact: ContactMechMapProcs.xml PartyContactMechMapProcs.xml PartyContactMechServices.xml

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

svn commit: r464511 - in /incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact: ContactMechMapProcs.xml PartyContactMechMapProcs.xml PartyContactMechServices.xml

jonesde
Author: jonesde
Date: Mon Oct 16 07:59:07 2006
New Revision: 464511

URL: http://svn.apache.org/viewvc?view=rev&rev=464511
Log:
A number of cleanups (including formatting) in the PartyContactMech stuff; this stuff is still a total mess and needs a lot more cleanup, especially along the lines of some changes I made here like using set-service-fields instead of manually doing all the work in a separate file using a call-simple-map-processor, which causes much more complex code and doesn't automatically handle new fields, and all sorts of undesirable things; this isn't what a simple-map-processor is meant to be used for

Modified:
    incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/ContactMechMapProcs.xml
    incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechMapProcs.xml
    incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/ContactMechMapProcs.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/ContactMechMapProcs.xml?view=diff&rev=464511&r1=464510&r2=464511
==============================================================================
--- incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/ContactMechMapProcs.xml (original)
+++ incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/ContactMechMapProcs.xml Mon Oct 16 07:59:07 2006
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!--
-
 Copyright 2001-2006 The Apache Software Foundation
 
 Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -18,53 +17,46 @@
 
 <simple-map-processors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
-  <!-- ContactMech map procs -->
-  <simple-map-processor name="contactMech">
-    <process field="contactMechTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechTypeIdMissing"/>
- </not-empty></process>
-    <process field="infoString"><copy/></process>
-  </simple-map-processor>
-  <simple-map-processor name="updateContactMech">
-    <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/>
-     </not-empty></process>
- <process field="contactMechTypeId"><copy/></process>
-    <process field="infoString"><copy/></process>
-  </simple-map-processor>
-
-  <simple-map-processor name="postalAddress">
-   <process field="contactMechId"><copy set-if-null="false"/></process>
-    <process field="toName"><copy/></process>
-    <process field="attnName"><copy/></process>
-    <process field="address1"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyAddressLine1Missing"/>
-     </not-empty></process>
-    <process field="address2"><copy/></process>
-    <process field="directions"><copy/></process>
-    <process field="city"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyCityMissing"/>
-     </not-empty></process>
-    <process field="stateProvinceGeoId"><copy/></process>
-    <process field="postalCode"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPostalCodeMissing"/>
-     </not-empty></process>
-    <process field="postalCodeExt"><copy/></process>
-    <process field="countryGeoId"><copy/></process>
-    <process field="postalCodeGeoId"><copy/></process>
-  </simple-map-processor>
-
-  <simple-map-processor name="telecomNumber">
-   <process field="contactMechId"><copy set-if-null="false"/></process>  
-    <process field="countryCode"><copy/></process>
-    <process field="areaCode"><copy/></process>
-    <process field="askForName"><copy/></process>
-    <process field="contactNumber"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactNumberMissing"/>
-     </not-empty></process>
-  </simple-map-processor>
-
-  <simple-map-processor name="emailAddress">
-   <process field="contactMechId"><copy set-if-null="false"/></process>
-    <process field="emailAddress">
-        <copy to-field="infoString"/>
-        <not-empty><fail-property resource="PartyUiLabels" property="PartyEmailAddressMissing"/></not-empty>
-        <validate-method method="isEmail"><fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/>
-        </validate-method>
-     </process>
-  </simple-map-processor>
+    <!-- ContactMech map procs -->
+    <simple-map-processor name="contactMech">
+        <process field="contactMechTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechTypeIdMissing"/></not-empty></process>
+        <process field="infoString"><copy/></process>
+    </simple-map-processor>
+    <simple-map-processor name="updateContactMech">
+        <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
+        <process field="contactMechTypeId"><copy/></process>
+        <process field="infoString"><copy/></process>
+    </simple-map-processor>
+
+    <simple-map-processor name="postalAddress">
+        <process field="contactMechId"><copy set-if-null="false"/></process>
+        <process field="toName"><copy/></process>
+        <process field="attnName"><copy/></process>
+        <process field="address1"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyAddressLine1Missing"/></not-empty></process>
+        <process field="address2"><copy/></process>
+        <process field="directions"><copy/></process>
+        <process field="city"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyCityMissing"/></not-empty></process>
+        <process field="stateProvinceGeoId"><copy/></process>
+        <process field="postalCode"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPostalCodeMissing"/></not-empty></process>
+        <process field="postalCodeExt"><copy/></process>
+        <process field="countryGeoId"><copy/></process>
+        <process field="postalCodeGeoId"><copy/></process>
+    </simple-map-processor>
+
+    <simple-map-processor name="telecomNumber">
+        <process field="contactMechId"><copy set-if-null="false"/></process>
+        <process field="countryCode"><copy/></process>
+        <process field="areaCode"><copy/></process>
+        <process field="askForName"><copy/></process>
+        <process field="contactNumber"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactNumberMissing"/></not-empty></process>
+    </simple-map-processor>
+
+    <simple-map-processor name="emailAddress">
+        <process field="contactMechId"><copy set-if-null="false"/></process>
+        <process field="emailAddress">
+            <copy to-field="infoString"/>
+            <not-empty><fail-property resource="PartyUiLabels" property="PartyEmailAddressMissing"/></not-empty>
+            <validate-method method="isEmail"><fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/></validate-method>
+         </process>
+    </simple-map-processor>
 </simple-map-processors>

Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechMapProcs.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechMapProcs.xml?view=diff&rev=464511&r1=464510&r2=464511
==============================================================================
--- incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechMapProcs.xml (original)
+++ incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechMapProcs.xml Mon Oct 16 07:59:07 2006
@@ -19,73 +19,59 @@
 <simple-map-processors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
   <!-- ContactMech map procs -->
-  <simple-map-processor name="partyContactMech">    
-    <process field="infoString"><copy/></process>
-    <process field="partyId"><copy/></process>
-    <process field="extension"><copy/></process>
-    <process field="allowSolicitation"><copy/></process>
-  </simple-map-processor>
-  <simple-map-processor name="updatePartyContactMech">
-    <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
-    <process field="infoString"><copy/></process>
-    <process field="partyId"><copy/></process>
-    <process field="extension"><copy/></process>
-    <process field="allowSolicitation"><copy/></process>    
-  </simple-map-processor>
-  <simple-map-processor name="deleteContactMech">
-    <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
-    <process field="partyId"><copy/></process>
-  </simple-map-processor>
+    <simple-map-processor name="deleteContactMech">
+        <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
+        <process field="partyId"><copy/></process>
+    </simple-map-processor>
 
-  <simple-map-processor name="postalAddress">
-    <process field="partyId"><copy/></process>
-    <process field="toName"><copy/></process>
-    <process field="attnName"><copy/></process>
-    <process field="address1"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyAddressLine1Missing"/></not-empty></process>
-    <process field="address2"><copy/></process>
-    <process field="directions"><copy/></process>
-    <process field="city"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyCityMissing"/></not-empty></process>
-    <process field="stateProvinceGeoId"><copy/></process>
-    <process field="postalCode"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPostalCodeMissing"/></not-empty></process>
-    <process field="countryGeoId"><copy/></process>
-    <process field="postalCodeGeoId"><copy/></process>
-    <process field="allowSolicitation"><copy/></process>
-  </simple-map-processor>
+    <simple-map-processor name="postalAddress">
+        <process field="partyId"><copy/></process>
+        <process field="toName"><copy/></process>
+        <process field="attnName"><copy/></process>
+        <process field="address1"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyAddressLine1Missing"/></not-empty></process>
+        <process field="address2"><copy/></process>
+        <process field="directions"><copy/></process>
+        <process field="city"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyCityMissing"/></not-empty></process>
+        <process field="stateProvinceGeoId"><copy/></process>
+        <process field="postalCode"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPostalCodeMissing"/></not-empty></process>
+        <process field="countryGeoId"><copy/></process>
+        <process field="postalCodeGeoId"><copy/></process>
+        <process field="allowSolicitation"><copy/></process>
+    </simple-map-processor>
 
-  <simple-map-processor name="telecomNumber">
-    <process field="partyId"><copy/></process>
-    <process field="countryCode"><copy/></process>
-    <process field="areaCode"><copy/></process>
-    <process field="contactNumber"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactNumberMissing"/></not-empty></process>
-    <process field="extension"><copy/></process>
-    <process field="allowSolicitation"><copy/></process>
-  </simple-map-processor>
+    <simple-map-processor name="telecomNumber">
+        <process field="partyId"><copy/></process>
+        <process field="countryCode"><copy/></process>
+        <process field="areaCode"><copy/></process>
+        <process field="contactNumber"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactNumberMissing"/></not-empty></process>
+        <process field="extension"><copy/></process>
+        <process field="allowSolicitation"><copy/></process>
+    </simple-map-processor>
 
-  <simple-map-processor name="emailAddress">
-   <process field="contactMechId"><copy set-if-null="false"/></process>
-    <process field="partyId"><copy/></process>
-    <process field="emailAddress">
-        <copy to-field="infoString"/>
-        <not-empty><fail-property resource="PartyUiLabels" property="PartyEmailAddressMissing"/></not-empty>
-        <validate-method method="isEmail"><fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/></validate-method></process>
-    <process field="allowSolicitation"><copy/></process>
-  </simple-map-processor>
+    <simple-map-processor name="emailAddress">
+     <process field="contactMechId"><copy set-if-null="false"/></process>
+        <process field="partyId"><copy/></process>
+        <process field="emailAddress">
+            <copy to-field="infoString"/>
+            <not-empty><fail-property resource="PartyUiLabels" property="PartyEmailAddressMissing"/></not-empty>
+            <validate-method method="isEmail"><fail-property resource="PartyUiLabels" property="PartyEmailAddressNotFormattedCorrectly"/></validate-method></process>
+        <process field="allowSolicitation"><copy/></process>
+    </simple-map-processor>
 
-  <!-- PartyContactMechPurpose map procs -->  
-  <simple-map-processor name="createPartyContactMechPurpose">
-    <process field="partyId"><copy/></process>
-    <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
-    <process field="contactMechPurposeTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPurposeTypeMissingCannotAdd"/></not-empty></process>
-  </simple-map-processor>
-  <simple-map-processor name="deletePartyContactMechPurpose">
-    <process field="partyId"><copy/></process>
-    <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
-    <process field="contactMechPurposeTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPurposeTypeMissingCannotRemove"/></not-empty></process>
-    <process field="fromDate">
-        <not-empty><fail-property resource="PartyUiLabels" property="CommonFromDateMissing"/></not-empty>
-        <convert type="Timestamp"><fail-property resource="PartyUiLabels" property="CommonFromDateNotValidDateTime"/></convert></process>
-  </simple-map-processor>
-  
-  <!-- PartyContactMech -->
+    <!-- PartyContactMechPurpose map procs -->
+    <simple-map-processor name="createPartyContactMechPurpose">
+        <process field="partyId"><copy/></process>
+        <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
+        <process field="contactMechPurposeTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPurposeTypeMissingCannotAdd"/></not-empty></process>
+    </simple-map-processor>
+    <simple-map-processor name="deletePartyContactMechPurpose">
+        <process field="partyId"><copy/></process>
+        <process field="contactMechId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyContactMechIdMissing"/></not-empty></process>
+        <process field="contactMechPurposeTypeId"><copy/><not-empty><fail-property resource="PartyUiLabels" property="PartyPurposeTypeMissingCannotRemove"/></not-empty></process>
+        <process field="fromDate">
+            <not-empty><fail-property resource="PartyUiLabels" property="CommonFromDateMissing"/></not-empty>
+            <convert type="Timestamp"><fail-property resource="PartyUiLabels" property="CommonFromDateNotValidDateTime"/></convert></process>
+    </simple-map-processor>
   
+   <!-- PartyContactMech -->
 </simple-map-processors>

Modified: incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml?view=diff&rev=464511&r1=464510&r2=464511
==============================================================================
--- incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml (original)
+++ incubator/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml Mon Oct 16 07:59:07 2006
@@ -19,8 +19,10 @@
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd">
     <simple-method method-name="createPartyContactMech" short-description="Create a PartyContactMech">
-        <make-value value-name="newValue" entity-name="PartyContactMech"/>
-        <make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
+        <log level="always" message="In createPartyContactMech parameters: ${parameters}"/>
+        
+        <make-value entity-name="PartyContactMech" value-name="newValue"/>
+        <make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/><!-- DEJ20061016: is this really needed? doesn't seem to be used... -->
         <if-empty map-name="parameters" field-name="partyId">
             <set field="parameters.partyId" from-field="userLogin.partyId"/>
         </if-empty>
@@ -52,16 +54,15 @@
     </simple-method>
     
     <simple-method method-name="updatePartyContactMech" short-description="Update a PartyContactMech">
+        <log level="always" message="In updatePartyContactMech parameters: ${parameters}"/>
+        
         <make-value entity-name="PartyContactMech" value-name="newPartyContactMech"/>
         <if-empty map-name="parameters" field-name="partyId">
             <set field="parameters.partyId" from-field="userLogin.partyId"/>
         </if-empty>
         <if-compare-field field-name="partyId" map-name="parameters" to-map-name="userLogin" operator="not-equals">
-            <check-permission permission="PARTYMGR" action="_PCM_UPDATE">
-                <fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/>
-            </check-permission>
+            <check-permission permission="PARTYMGR" action="_PCM_UPDATE"><fail-property resource="PartyUiLabels" property="PartyPermissionErrorForThisParty"/></check-permission>
         </if-compare-field>
-        <check-errors/>
         
         <!-- Find old value -->
         <make-value entity-name="PartyContactMech" value-name="partyContactMechMap"/>
@@ -70,11 +71,10 @@
         <filter-list-by-date list-name="partyContactMechs" to-list-name="validPartyContactMechs"/>
         <first-from-list entry-name="partyContactMech" list-name="validPartyContactMechs"/>
         <if-empty field-name="partyContactMech">
-            <add-error><fail-property resource="PartyUiLabels" property="PartyCannotUpdateContactBecauseNotWithSpecifiedParty"/>
-            </add-error>
+            <add-error><fail-property resource="PartyUiLabels" property="PartyCannotUpdateContactBecauseNotWithSpecifiedParty"/></add-error>
         </if-empty>
+
         <check-errors/>
-        <field-to-list list-name="storeList" field-name="partyContactMech"/>
         
         <clone-value value-name="partyContactMech" new-value-name="newPartyContactMech"/>
         
@@ -98,14 +98,16 @@
         <set-nonpk-fields value-name="newPartyContactMech" map-name="parameters" set-if-null="false"/>
         <now-timestamp-to-env env-name="newPartyContactMech.fromDate"/>
         <now-timestamp-to-env env-name="partyContactMech.thruDate"/>
-        <field-to-list list-name="storeList" field-name="newPartyContactMech"/>
 
+        <store-value value-name="partyContactMech"/>
+        <create-value value-name="newPartyContactMech"/>
+        
         <if-compare-field field-name="contactMechId" map-name="parameters" to-map-name="newPartyContactMech" operator="not-equals">
             <get-related value-name="partyContactMech" relation-name="PartyContactMechPurpose" list-name="partyContactMechPurposes"/>  
             <iterate entry-name="partyContactMechPurposeOld" list-name="partyContactMechPurposes">
                 <clone-value value-name="partyContactMechPurposeOld" new-value-name="partyContactMechPurpose"/>
                 <now-timestamp-to-env env-name="partyContactMechPurposeOld.thruDate"/>
-                <field-to-list field-name="partyContactMechPurposeOld" list-name="storeList"/>
+                <store-value value-name="partyContactMechPurposeOld"/>
 
                 <set field="partyContactMechPurpose.contactMechId" from-field="newPartyContactMech.contactMechId"/>
                 <set field="purposeMap.partyId" from-field="partyContactMechPurpose.partyId"/>
@@ -114,17 +116,14 @@
                 <find-by-and entity-name="PartyContactMechPurpose" list-name="purposeResult" map-name="purposeMap"/>
                     
                 <if-empty field-name="purposeResult">
-                    <field-to-list field-name="partyContactMechPurpose" list-name="storeList"/>    
+                    <create-value value-name="partyContactMechPurpose"/>
                 </if-empty>
             </iterate>
-
-
         </if-compare-field>
         
-        <store-list list-name="storeList"/>
         <log level="info" message="Setting id to result: ${newPartyContactMech.contactMechId}"/>
-        <field-to-result field-name="contactMechId" map-name="newPartyContactMech"/>
-        <field-to-request field-name="contactMechId" map-name="newPartyContactMech"/>      
+        <field-to-result field-name="newPartyContactMech.contactMechId" result-name="contactMechId"/>
+        <field-to-request field-name="newPartyContactMech.contactMechId" request-name="contactMechId"/>
     </simple-method>    
     
     <simple-method method-name="deletePartyContactMech" short-description="Delete a PartyContactMech">
@@ -169,17 +168,18 @@
         <call-map-processor xml-resource="org/ofbiz/party/contact/ContactMechMapProcs.xml"
                 processor-name="postalAddress" in-map-name="parameters" out-map-name="context"/>
         <check-errors/>
+
         <call-service in-map-name="context" service-name="createPostalAddress">
             <default-message>Postal Address successfully created</default-message>
             <result-to-field result-name="contactMechId" map-name="newPartyContactMech"/>
         </call-service>
 
-        <call-map-processor xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"
-                processor-name="partyContactMech" in-map-name="parameters" out-map-name="context2"/>
         <check-errors/>
-        <set field="context2.contactMechId" from-field="newPartyContactMech.contactMechId"/>
+
+        <set field="createPartyContactMechMap.contactMechId" from-field="newPartyContactMech.contactMechId"/>
+        <set-service-fields service-name="createPartyContactMech" map-name="parameters" to-map-name="createPartyContactMechMap"/>
         
-        <call-service in-map-name="context2" break-on-error="true" service-name="createPartyContactMech">
+        <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechMap" break-on-error="true">
             <default-message>Party Contact Mechanism successfully created</default-message>
         </call-service>
         <field-to-request field-name="contactMechId" map-name="newPartyContactMech"/>
@@ -206,13 +206,12 @@
             <default-message>Postal Address successfully updated</default-message>
             <result-to-field result-name="contactMechId" map-name="newPartyContactMech" field-name="contactMechId" />            
         </call-service>
-        <call-map-processor xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"
-                processor-name="updatePartyContactMech" in-map-name="parameters" out-map-name="context2"/>
-        <check-errors/>
-        <set field="context2.newContactMechId" from-field="newPartyContactMech.contactMechId"/>
-        <set field="context2.contactMechTypeId" value="POSTAL_ADDRESS"/>
-        <log level="info" message="Copied id to context2: ${context2.newContactMechId}"/>
-        <call-service in-map-name="context2" service-name="updatePartyContactMech">
+
+        <set-service-fields service-name="updatePartyContactMech" map-name="parameters" to-map-name="updatePartyContactMechMap"/>
+        <set field="updatePartyContactMechMap.newContactMechId" from-field="newPartyContactMech.contactMechId"/>
+        <set field="updatePartyContactMechMap.contactMechTypeId" value="POSTAL_ADDRESS"/>
+        <log level="info" message="Copied id to updatePartyContactMechMap: ${updatePartyContactMechMap.newContactMechId}"/>
+        <call-service service-name="updatePartyContactMech" in-map-name="updatePartyContactMechMap">
             <default-message>Party Contact Mechanism successfully updated</default-message>      
         </call-service>
         <field-to-request field-name="contactMechId" map-name="newPartyContactMech"/>
@@ -238,11 +237,12 @@
             <default-message>Telecom number successfully created</default-message>
             <result-to-field result-name="contactMechId" map-name="newPartyContactMech"/>            
         </call-service>
-        <call-map-processor xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"
-                processor-name="partyContactMech" in-map-name="parameters" out-map-name="context2"/>
-        <set field="context2.contactMechId" from-field="newPartyContactMech.contactMechId"/>  
-        <log level="info" message="Copied id to context2: ${context2.contactMechId}"/>        
-        <call-service in-map-name="context2" break-on-error="true" service-name="createPartyContactMech">
+
+        <set-service-fields service-name="createPartyContactMech" map-name="parameters" to-map-name="createPartyContactMechMap"/>
+        <set field="createPartyContactMechMap.contactMechId" from-field="newPartyContactMech.contactMechId"/>
+        <log level="info" message="Copied id to createPartyContactMechMap: ${createPartyContactMechMap.contactMechId}"/>
+
+        <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechMap" break-on-error="true">
             <default-message>Party Contact Mechanism successfully created</default-message>      
         </call-service>
         <field-to-request field-name="contactMechId" map-name="newPartyContactMech"/>
@@ -268,12 +268,12 @@
             <result-to-field result-name="contactMechId" map-name="newPartyContactMech" field-name="contactMechId" />            
         </call-service>
         
-        <call-map-processor xml-resource="org/ofbiz/party/contact/PartyContactMechMapProcs.xml"
-                processor-name="updatePartyContactMech" in-map-name="parameters" out-map-name="context2"/>
-        <set field="context2.newContactMechId" from-field="newPartyContactMech.contactMechId"/>  
-        <set field="context2.contactMechTypeId" value="TELECOM_NUMBER"/>
-        <log level="info" message="Copied id to context2: ${context2.newContactMechId}"/>
-        <call-service in-map-name="context2" service-name="updatePartyContactMech">
+        <set-service-fields service-name="updatePartyContactMech" map-name="parameters" to-map-name="updatePartyContactMechMap"/>
+        <set field="updatePartyContactMechMap.newContactMechId" from-field="newPartyContactMech.contactMechId"/>  
+        <set field="updatePartyContactMechMap.contactMechTypeId" value="TELECOM_NUMBER"/>
+        <log level="info" message="Copied id to updatePartyContactMechMap: ${updatePartyContactMechMap.newContactMechId}"/>
+
+        <call-service in-map-name="updatePartyContactMechMap" service-name="updatePartyContactMech">
             <default-message>Party Contact Mechanism successfully updated</default-message>      
         </call-service>
         <log level="info" message="Setting result id: ${newPartyContactMech.contactMechId}"/>