fixed: createPartyGroupRoleAndContactMechs service not working
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
@@ -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"/>
