blob: 7fe2268223e23eac5fb7b09eb5df1ac2c6d4b5df [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<simple-method method-name="testFindPartyWithSearchParameters" short-description="Test findparty service on certain search parameters" login-required="false">
<set field="searchParams.partyId" value="DemoCustomer"/>
<set field="searchParams.roleTypeId" value="CUSTOMER"/>
<map-to-map map="searchParams" to-map="serviceCtx"/>
<call-service service-name="findParty" in-map-name="serviceCtx">
<results-to-map map-name="partyList"/>
</call-service>
<find-by-primary-key entity-name="PartyRoleDetailAndPartyDetail" map="searchParams" value-field="partyRoleDetailAndPartyDetail"/>
<if-not-empty field="partyRoleDetailAndPartyDetail">
<assert><not><if-empty field="partyList"/></not></assert>
<else>
<assert><if-empty field="partyList"/></assert>
</else>
</if-not-empty>
<check-errors/>
</simple-method>
<simple-method method-name="testFindPartyWithNoSearchParameters" short-description="Test findparty service when no search parameters are passed" login-required="false">
<set field="serviceCtx.lookupFlag" value="Y"/>
<call-service service-name="findParty" in-map-name="serviceCtx">
<result-to-field result-name="partyList"/>
</call-service>
<!-- At least one party will always exists in the system in any case -->
<assert><not><if-empty field="partyList"/></not></assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyCreditCard" short-description="Test updateCreditCard service" login-required="false">
<set field="serviceCtx.partyId" value="DemoCustomer"/>
<find-by-and entity-name="PaymentMethodAndCreditCard" map="serviceCtx" list="paymentMethodAndCreditCards"/>
<filter-list-by-date list="paymentMethodAndCreditCards"/>
<first-from-list list="paymentMethodAndCreditCards" entry="paymentMethodAndCreditCard"/>
<!-- first try with just updating without changing the credit card information -->
<set-service-fields service-name="updateCreditCard" map="paymentMethodAndCreditCard" to-map="serviceCtx"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateCreditCard" in-map-name="serviceCtx">
<result-to-field result-name="paymentMethodId"/>
<result-to-field result-name="oldPaymentMethodId"/>
</call-service>
<clear-field field="paymentMethodAndCreditCard"/>
<entity-one entity-name="PaymentMethodAndCreditCard" value-field="paymentMethodAndCreditCard"/>
<assert>
<not><if-empty field="paymentMethodAndCreditCard"/></not>
<if-compare-field field="paymentMethodId" to-field="oldPaymentMethodId" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardType" to-field="serviceCtx.cardType" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardNumber" to-field="serviceCtx.cardNumber" operator="equals"/>
</assert>
<check-errors/>
<clear-field field="paymentMethodAndCreditCard"/>
<clear-field field="paymentMethodId"/>
<clear-field field="oldPaymentMethodId"/>
<!-- try now with few changes (cardType, cardNumber in this case), a new record will be created in PaymentMethod, CreditCard entity -->
<set field="serviceCtx.cardType" value="CCT_MASTERCARD"/>
<set field="serviceCtx.cardNumber" value="5500000000000004"/>
<call-service service-name="updateCreditCard" in-map-name="serviceCtx">
<result-to-field result-name="paymentMethodId"/>
<result-to-field result-name="oldPaymentMethodId"/>
</call-service>
<entity-one entity-name="PaymentMethodAndCreditCard" value-field="paymentMethodAndCreditCard"/>
<assert>
<not><if-empty field="paymentMethodAndCreditCard"/></not>
<if-compare-field field="paymentMethodId" to-field="oldPaymentMethodId" operator="not-equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardType" to-field="serviceCtx.cardType" operator="equals"/>
<if-compare-field field="paymentMethodAndCreditCard.cardNumber" to-field="serviceCtx.cardNumber" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateUserPassword" short-description="Test updatePassword service" login-required="false">
<set field="partyId" value="DemoCustomer"/>
<set field="userLoginId" value="DemoCustomer"/>
<call-class-method method-name="findPartyLatestUserLogin" class-name="org.apache.ofbiz.party.party.PartyWorker" ret-field="partyUserLogin">
<field field="partyId" type="java.lang.String"/>
<field field="delegator" type="org.apache.ofbiz.entity.Delegator"/>
</call-class-method>
<set-service-fields service-name="updatePassword" map="partyUserLogin" to-map="serviceCtx"/>
<!-- old details: userLoginId = DemoCustomer, password = ofbiz -->
<set field="serviceCtx.newPassword" value="ofbiz-demo"/>
<set field="serviceCtx.newPasswordVerify" value="ofbiz-demo"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePassword" in-map-name="serviceCtx">
<result-to-field result-name="updatedUserLogin"/>
</call-service>
<entity-one entity-name="PartyAndUserLogin" value-field="partyAndUserLogin">
<field-map field-name="userLoginId" from-field="partyUserLogin.userLoginId"/>
<field-map field-name="partyId" from-field="partyId"/>
</entity-one>
<assert>
<not><if-empty field="partyAndUserLogin"/></not>
<if-compare-field field="partyUserLogin.currentPassword" to-field="partyAndUserLogin.currentPassword" operator="not-equals"/>
<if-compare-field field="partyAndUserLogin.userLoginId" to-field="userLoginId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyRole" short-description="A test to add a role to a party" login-required="false">
<set field="partyId" value="DemoCustomer"/>
<set field="roleTypeId" value="SUPPLIER"/>
<set field="serviceCtx.partyId" from-field="partyId"/>
<set field="serviceCtx.roleTypeId" from-field="roleTypeId"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyRole" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testEnsurePartyRole" short-description="A test to ensure the association between a party and a role" login-required="false">
<set field="partyId" value="DemoCustomer"/>
<set field="roleTypeId" value="SUPPLIER"/>
<set field="serviceCtx.partyId" from-field="partyId"/>
<set field="serviceCtx.roleTypeId" from-field="roleTypeId"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="ensurePartyRole" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
<set field="roleTypeId" value="EMPLOYEE"/>
<set field="serviceCtx.roleTypeId" from-field="roleTypeId"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<if-empty field="partyRole"/>
</assert>
<check-errors/>
<call-service service-name="ensurePartyRole" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
<!-- test ensure from -->
<set field="ensurePartyRoleFromCtx.userLogin" from-field="userLogin"/>
<set field="roleTypeId" value="CONTRACTOR"/>
<set field="ensurePartyRoleFromCtx.roleTypeIdFrom" from-field="roleTypeId"/>
<set field="ensurePartyRoleFromCtx.partyIdFrom" from-field="partyId"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<if-empty field="partyRole"/>
</assert>
<check-errors/>
<call-service service-name="ensurePartyRoleFrom" in-map-name="ensurePartyRoleFromCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
<!-- test ensure to -->
<set field="ensurePartyRoleToCtx.userLogin" from-field="userLogin"/>
<set field="roleTypeId" value="MANUFACTURER"/>
<set field="ensurePartyRoleToCtx.roleTypeIdTo" from-field="roleTypeId"/>
<set field="ensurePartyRoleToCtx.partyIdTo" from-field="partyId"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<if-empty field="partyRole"/>
</assert>
<check-errors/>
<call-service service-name="ensurePartyRoleTo" in-map-name="ensurePartyRoleToCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole"/>
<assert>
<not><if-empty field="partyRole"/></not>
<if-compare-field field="partyRole.partyId" operator="equals" to-field="partyId"/>
<if-compare-field field="partyRole.roleTypeId" operator="equals" to-field="roleTypeId"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateNewCommEvent" short-description="test to create a new communication event" login-required="false">
<set field="createNewCommEventMap.communicationEventTypeId" value="EMAIL_COMMUNICATION"/>
<set field="createNewCommEventMap.statusId" value="COM_ENTERED"/>
<set field="createNewCommEventMap.partyIdFrom" value="DemoCustomer"/>
<set field="createNewCommEventMap.contactMechTypeId" value="EMAIL_ADDRESS"/>
<entity-one entity-name="UserLogin" value-field="createNewCommEventMap.userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<call-service service-name="createCommunicationEvent" in-map-name="createNewCommEventMap">
<result-to-field result-name="communicationEventId" field="commEventMap.communicationEventId"/>
</call-service>
<call-simple-method method-name="inlineUpdateCommEvent"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" from-field="commEventMap.communicationEventId"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare-field field="communicationEvent.communicationEventId" to-field="commEventMap.communicationEventId" operator="equals"/>
<if-compare-field field="communicationEvent.communicationEventTypeId" to-field="updateCommEventMap.communicationEventTypeId" operator="equals"/>
<if-compare-field field="communicationEvent.statusId" to-field="updateCommEventMap.statusId" operator="equals"/>
<if-compare-field field="communicationEvent.partyIdFrom" to-field="updateCommEventMap.partyIdFrom" operator="equals"/>
<if-compare-field field="communicationEvent.contactMechTypeId" to-field="updateCommEventMap.contactMechTypeId" operator="equals"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="inlineUpdateCommEvent" short-description="test to update communication event" login-required="false">
<set field="updateCommEventMap.communicationEventId" from-field="commEventMap.communicationEventId"/>
<set field="updateCommEventMap.communicationEventTypeId" value="AUTO_EMAIL_COMM"/>
<set field="updateCommEventMap.statusId" value="COM_COMPLETE"/>
<set field="updateCommEventMap.partyIdFrom" value="admin"/>
<set field="updateCommEventMap.contactMechTypeId" value="ELECTRONIC_ADDRESS"/>
<entity-one entity-name="UserLogin" value-field="updateCommEventMap.userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<call-service service-name="updateCommunicationEvent" in-map-name="updateCommEventMap"/>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyTelecomNumber" short-description="Test createPartyTelecomNumber service" login-required="false">
<set field="partyId" value="DemoCustomer"/>
<set field="serviceCtx.partyId" from-field="partyId"/>
<set field="serviceCtx.contactMechPurposeTypeId" value="PRIMARY_PHONE"/>
<set field="serviceCtx.countryCode" value="1"/>
<set field="serviceCtx.areaCode" value="801"/>
<set field="serviceCtx.contactNumber" value="888-8888"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyTelecomNumber" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<assert><not><if-empty field="contactMechId"/></not></assert>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert><not><if-empty field="contactMech"/></not></assert>
<entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
<assert>
<not><if-empty field="telecomNumber"/></not>
<if-compare field="telecomNumber.countryCode" operator="equals" value="1"/>
<if-compare field="telecomNumber.areaCode" operator="equals" value="801"/>
<if-compare field="telecomNumber.contactNumber" operator="equals" value="888-8888"/>
</assert>
<entity-and entity-name="PartyContactMech" list="pcmList" filter-by-date="true">
<field-map field-name="partyId"/>
<field-map field-name="contactMechId"/>
</entity-and>
<assert><not><if-empty field="pcmList"/></not></assert>
<entity-and entity-name="PartyContactMechPurpose" list="pcmpList" filter-by-date="true">
<field-map field-name="partyId"/>
<field-map field-name="contactMechId"/>
</entity-and>
<assert><not><if-empty field="pcmpList"/></not></assert>
<first-from-list list="pcmpList" entry="pcmp"/>
<assert><if-compare field="pcmp.contactMechPurposeTypeId" operator="equals" value="PRIMARY_PHONE"/></assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePerson" short-description="Test case for service createPerson" login-required="false">
<set field="firstName" value="Demo"/>
<set field="lastName" value="Person"/>
<set field="serviceCtx.firstName" from-field="firstName"/>
<set field="serviceCtx.lastName" from-field="lastName"/>
<call-service service-name="createPerson" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<entity-one entity-name="Person" value-field="person"/>
<assert>
<not><if-empty field="party"/></not>
<if-compare field="party.partyTypeId" operator="equals" value="PERSON"/>
<not><if-empty field="person"/></not>
<if-compare-field field="person.firstName" operator="equals" to-field="firstName"/>
<if-compare-field field="person.lastName" operator="equals" to-field="lastName"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateUpdatePersonWithCreate" short-description="Test the service to create a person" login-required="false">
<set field="serviceCtx.partyId" value="DemoPerson1"/>
<set field="serviceCtx.firstName" value="Demo"/>
<set field="serviceCtx.lastName" value="Person1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createUpdatePerson" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<entity-one entity-name="Person" value-field="person"/>
<assert>
<not><if-empty field="party"/></not>
<if-compare field="person.firstName" operator="equals" value="Demo"/>
<if-compare field="person.lastName" operator="equals" value="Person1"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateUpdatePersonWithUpdate" short-description="Test the service to update a person" login-required="false">
<set field="serviceCtx.partyId" value="DemoPerson1"/>
<set field="serviceCtx.firstName" value="Demo"/>
<set field="serviceCtx.lastName" value="Person2"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createUpdatePerson" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<entity-one entity-name="Person" value-field="person"/>
<assert>
<not><if-empty field="party"/></not>
<not><if-empty field="person"/></not>
<if-compare field="person.firstName" operator="equals" value="Demo"/>
<if-compare field="person.lastName" operator="equals" value="Person2"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyGroup" short-description="Test the service to create party group" login-required="false">
<set field="serviceCtx.partyId" value="DemoGroup1"/>
<set field="serviceCtx.groupName" value="Demo Group"/>
<set field="serviceCtx.partyTypeId" value="PARTY_GROUP"/>
<set field="serviceCtx.statusId" value="PARTY_ENABLED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyGroup" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="PartyGroup" value-field="partyGroup"/>
<assert>
<not><if-empty field="partyGroup"/></not>
<if-compare field="partyGroup.partyId" operator="equals" value="DemoGroup1"/>
<if-compare field="partyGroup.groupName" operator="equals" value="Demo Group"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCopyPartyContactMechs" short-description="Test the service copyPartyContactMechs" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCustomer"/>
<set field="serviceCtx.partyIdTo" value="TestParty"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="copyPartyContactMechs" in-map-name="serviceCtx"/>
<set field="lookupKeyValue.partyId" value="TestParty"/>
<find-by-and entity-name="PartyContactMech" map="lookupKeyValue" list="partyContactMechList"/>
<assert>
<not><if-empty field="partyContactMechList"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateCommunicationEvent" short-description="Test the service createCommunicationEvent" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-3"/>
<set field="serviceCtx.communicationEventTypeId" value="EMAIL_COMMUNICATION"/>
<set field="serviceCtx.statusId" value="COM_COMPLETE"/>
<set field="serviceCtx.fromString" value="send@example.com"/>
<set field="serviceCtx.toString" value="receive@example.com"/>
<set field="serviceCtx.subject" value="Why i would use the OFBiz system"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createCommunicationEvent" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-3"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare operator="equals" field="communicationEvent.statusId" value="COM_COMPLETE"/>
<if-compare operator="equals" field="communicationEvent.subject" value="Why i would use the OFBiz system"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateCommunicationEventRole" short-description="Test the service createCommunicationEventRole" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-6"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="ADDRESSEE"/>
<set field="serviceCtx.statusId" value="COM_ROLE_CREATED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createCommunicationEventRole" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-6"/>
<field-map field-name="roleTypeId" value="ADDRESSEE"/>
<field-map field-name="partyId" value="TestCompany"/>
</entity-one>
<assert>
<not><if-empty field="communicationEventRole"/></not>
<if-compare operator="equals" field="communicationEventRole.statusId" value="COM_ROLE_CREATED"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateCommunicationEventRoleWithoutPermission" short-description="Test the service createCommunicationEventRoleWithoutPermission" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-6"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="INTERNAL_ORGANIZATIO"/>
<set field="serviceCtx.statusId" value="COM_ROLE_CREATED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createCommunicationEventRoleWithoutPermission" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-6"/>
<field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/>
<field-map field-name="partyId" value="TestCompany"/>
</entity-one>
<assert>
<not><if-empty field="communicationEventRole"/></not>
<if-compare operator="equals" field="communicationEventRole.statusId" value="COM_ROLE_CREATED"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateCommunicationEventWithoutPermission" short-description="Test the service createCommunicationEventWithoutPermission" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-4"/>
<set field="serviceCtx.communicationEventTypeId" value="EMAIL_COMMUNICATION"/>
<set field="serviceCtx.statusId" value="COM_COMPLETE"/>
<set field="serviceCtx.fromString" value="send@example.com"/>
<set field="serviceCtx.toString" value="receive@example.com"/>
<set field="serviceCtx.subject" value="Why i would use the OFBiz system"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createCommunicationEventWithoutPermission" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-4"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare operator="equals" field="communicationEvent.statusId" value="COM_COMPLETE"/>
<if-compare operator="equals" field="communicationEvent.subject" value="Why i would use the OFBiz system"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateContactMech" short-description="Test the service createContactMech" login-required="false">
<set field="serviceCtx.contactMechId" value="TestEmailConactMech"/>
<set field="serviceCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
<set field="serviceCtx.infoString" value="test_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createContactMech" in-map-name="serviceCtx"/>
<entity-one entity-name="ContactMech" value-field="contactMech">
<field-map field-name="contactMechId" value="TestEmailConactMech"/>
</entity-one>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="test_email@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateEmailAddress" short-description="Test the service createEmailAddress" login-required="false">
<set field="serviceCtx.emailAddress" value="test.email123@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createEmailAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="test.email123@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyContactMech" short-description="Test the service createPartyContactMech" login-required="false">
<set field="serviceCtx.contactMechId" value="TestContactMech3"/>
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<set field="serviceCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
<call-service service-name="createPartyContactMech" in-map-name="serviceCtx"/>
<entity-and entity-name="PartyContactMech" list="partyContactMechList">
<field-map field-name="contactMechId" value="TestContactMech3"/>
<field-map field-name="partyId" value="TestCustomer"/>
</entity-and>
<first-from-list entry="partyContactMech" list="partyContactMechList"/>
<assert>
<not><if-empty field="partyContactMech"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyDataSource" short-description="Test the service createPartyDataSource" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.dataSourceId" value="MY_PORTAL"/>
<set field="serviceCtx.fromDate" value="2009-09-09 01:01:01" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyDataSource" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyDataSource" value-field="partyDataSource">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="dataSourceId" value="MY_PORTAL"/>
<field-map field-name="fromDate" value="2009-09-09 01:01:01"/>
</entity-one>
<assert>
<not><if-empty field="partyDataSource"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyEmailAddress" short-description="Test the service createPartyEmailAddress" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.emailAddress" value="test.email1234@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyEmailAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="test.email1234@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyIdentifications" short-description="Test the service createPartyIdentifications" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="partyIdentificationTypeId" value="CARD_ID"/>
<set field="partyIdentification.partyIdentificationTypeId" from-field="partyIdentificationTypeId"/>
<set field="partyIdentification.${partyIdentificationTypeId}" value="123456789"/>
<set field="serviceCtx.identifications" from-field="partyIdentification"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyIdentifications" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyIdentification" value-field="partyIdentification">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="partyIdentificationTypeId" value="CARD_ID"/>
</entity-one>
<assert>
<not><if-empty field="partyIdentification"/></not>
<if-compare operator="equals" field="partyIdentification.idValue" value="123456789"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyNote" short-description="Test the service to create party note" login-required="false">
<set field="serviceCtx.partyId" value="DemoCustomer"/>
<set field="noteId" value="DemoNote"/>
<set field="serviceCtx.noteName" value="Demo Note"/>
<set field="serviceCtx.note" value="This is demo note to test createPartyNote service"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyNote" in-map-name="serviceCtx">
<result-to-field result-name="noteId"/>
</call-service>
<entity-one entity-name="PartyNote" value-field="partyNote">
<field-map field-name="partyId" value="DemoCustomer"/>
</entity-one>
<entity-one entity-name="NoteData" value-field="noteData"/>
<assert>
<not><if-empty field="partyNote"/></not>
<not><if-empty field="noteData"/></not>
<if-compare field="noteData.noteName" operator="equals" value="Demo Note"/>
<if-compare field="noteData.noteInfo" operator="equals" value="This is demo note to test createPartyNote service"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyRelationship" short-description="Test the service to create PartyRelationship" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyIdTo" value="TestCustomer"/>
<set field="serviceCtx.roleTypeIdFrom" value="INTERNAL_ORGANIZATIO"/>
<set field="serviceCtx.roleTypeIdTo" value="CONTACT"/>
<set field="serviceCtx.fromDate" value="2009-09-09 01:01:01"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyRelationship" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="PartyRelationship" value-field="partyRelationship">
<field-map field-name="partyIdFrom" value="TestCompany"/>
<field-map field-name="partyIdTo" value="TestCustomer"/>
<field-map field-name="roleTypeIdFrom" value="INTERNAL_ORGANIZATIO"/>
<field-map field-name="roleTypeIdTo" value="CONTACT"/>
<field-map field-name="fromDate" value="2009-09-09 01:01:01"/>
</entity-one>
<assert>
<not><if-empty field="partyRelationship"/></not>
</assert>
</simple-method>
<simple-method method-name="testCreatePartyRelationshipAndRole" short-description="Test the service to create PartyRelationship and PartyRole" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyIdTo" value="TestCustomer"/>
<set field="serviceCtx.roleTypeIdFrom" value="BUYER"/>
<set field="serviceCtx.roleTypeIdTo" value="ACCOUNT_LEAD"/>
<set field="serviceCtx.fromDate" value="2009-09-09 01:01:01" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyRelationshipAndRole" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole">
<field-map field-name="partyId" value="TestCompany"/>
<field-map field-name="roleTypeId" value="BUYER"/>
</entity-one>
<entity-one entity-name="PartyRelationship" value-field="partyRelationship">
<field-map field-name="partyIdFrom" value="TestCompany"/>
<field-map field-name="partyIdTo" value="TestCustomer"/>
<field-map field-name="roleTypeIdFrom" value="BUYER"/>
<field-map field-name="roleTypeIdTo" value="ACCOUNT_LEAD"/>
<field-map field-name="fromDate" value="2009-09-09 01:01:01"/>
</entity-one>
<assert>
<not><if-empty field="partyRole"/></not>
<not><if-empty field="partyRelationship"/></not>
</assert>
</simple-method>
<simple-method method-name="testCreatePartyRelationshipContactAccount" short-description="Test the service createPartyRelationshipContactAccount" login-required="false">
<set field="serviceCtx.accountPartyId" value="TestParty"/>
<set field="serviceCtx.contactPartyId" value="TestCustomer"/>
<set field="serviceCtx.comments" value="This is a test party contact account relationship"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyRelationshipContactAccount" in-map-name="serviceCtx"/>
<set field="lookupKeyValue.partyIdFrom" value="TestParty"/>
<set field="lookupKeyValue.partyIdTo" value="TestCustomer"/>
<set field="lookupKeyValue.roleTypeIdFrom" value="ACCOUNT"/>
<set field="lookupKeyValue.roleTypeIdTo" value="CONTACT"/>
<find-by-and entity-name="PartyRelationship" map="lookupKeyValue" list="partyRelationshipList"/>
<assert>
<not><if-empty field="partyRelationshipList"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyRelationshipType" short-description="Test the service createPartyRelationshipType" login-required="false">
<set field="serviceCtx.partyRelationshipTypeId" value="TEST_TYPE"/>
<set field="serviceCtx.partyRelationshipName" value="Test Type"/>
<set field="serviceCtx.description" value="This is a test type to test service."/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyRelationshipType" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRelationshipType" value-field="partyRelationshipType">
<field-map field-name="partyRelationshipTypeId" value="TEST_TYPE"/>
</entity-one>
<assert>
<not><if-empty field="partyRelationshipType"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePersonAndUserLogin" short-description="Test the service to create person and user login" login-required="false">
<set field="serviceCtx.partyId" value="DemoPerson"/>
<set field="serviceCtx.firstName" value="Demo"/>
<set field="serviceCtx.lastName" value="Person"/>
<set field="serviceCtx.userLoginId" value="demo.person"/>
<set field="serviceCtx.currentPassword" value="ofbiz"/>
<set field="serviceCtx.currentPasswordVerify" value="ofbiz"/>
<call-service service-name="createPersonAndUserLogin" in-map-name="serviceCtx">
<result-to-field result-name="newUserLogin"/>
</call-service>
<get-related-one value-field="newUserLogin" relation-name="Person" to-value-field="person"/>
<assert>
<not><if-empty field="newUserLogin"/></not>
<if-compare field="newUserLogin.partyId" operator="equals" value="DemoPerson"/>
<if-compare field="person.firstName" operator="equals" value="Demo"/>
<if-compare field="person.lastName" operator="equals" value="Person"/>
<if-compare field="newUserLogin.userLoginId" operator="equals" value="demo.person"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePostalAddress" short-description="Test the service createPostalAddress" login-required="false">
<set field="serviceCtx.toName" value="Test Address"/>
<set field="serviceCtx.address1" value="2004 Factory Blvd"/>
<set field="serviceCtx.city" value="City of Industry"/>
<set field="serviceCtx.countryGeoId" value="USA"/>
<set field="serviceCtx.stateProvinceGeoId" value="CA"/>
<set field="serviceCtx.postalCode" value="90000"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPostalAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="PostalAddress" value-field="postalAddress"/>
<assert>
<not><if-empty field="postalAddress"/></not>
<if-compare field="postalAddress.address1" operator="equals" value="2004 Factory Blvd"/>
<if-compare field="postalAddress.city" operator="equals" value="City of Industry"/>
<if-compare field="postalAddress.postalCode" operator="equals" value="90000"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateRoleType" short-description="Test the service createRoleType" login-required="false">
<set field="serviceCtx.roleTypeId" value="TEST_ROLE"/>
<set field="serviceCtx.description" value="Test Role to test service createRoleType"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createRoleType" in-map-name="serviceCtx">
<result-to-field result-name="roleType"/>
</call-service>
<assert>
<not><if-empty field="roleType"/></not>
<if-compare field="roleType.roleTypeId" operator="equals" value="TEST_ROLE"/>
<if-compare field="roleType.description" operator="equals" value="Test Role to test service createRoleType"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateTelecomNumber" short-description="Test the service createTelecomNumber" login-required="false">
<set field="serviceCtx.contactMechId" value="TestTelecomNumber"/>
<set field="serviceCtx.areaCode" value="801"/>
<set field="serviceCtx.contactNumber" value="1111111"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createTelecomNumber" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
<assert>
<not><if-empty field="telecomNumber"/></not>
<if-compare field="telecomNumber.areaCode" operator="equals" value="801"/>
<if-compare field="telecomNumber.contactNumber" operator="equals" value="1111111"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateUpdatePartyRelationshipAndRoles" short-description="Test the service to create/update PartyRelationship and PartyRole" login-required="false">
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyIdTo" value="TestCustomer"/>
<set field="serviceCtx.roleTypeIdFrom" value="BUYER"/>
<set field="serviceCtx.roleTypeIdTo" value="ACCOUNT_LEAD"/>
<set field="serviceCtx.fromDate" value="2009-09-09 01:01:01" type="Timestamp"/>
<set field="serviceCtx.partyRelationshipTypeId" value="AGENT"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createUpdatePartyRelationshipAndRoles" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole">
<field-map field-name="partyId" value="TestCompany"/>
<field-map field-name="roleTypeId" value="BUYER"/>
</entity-one>
<entity-one entity-name="PartyRelationship" value-field="partyRelationship">
<field-map field-name="partyIdFrom" value="TestCompany"/>
<field-map field-name="partyIdTo" value="TestCustomer"/>
<field-map field-name="roleTypeIdFrom" value="BUYER"/>
<field-map field-name="roleTypeIdTo" value="ACCOUNT_LEAD"/>
<field-map field-name="fromDate" value="2009-09-09 01:01:01"/>
</entity-one>
<assert>
<not><if-empty field="partyRole"/></not>
<not><if-empty field="partyRelationship"/></not>
<if-compare field="serviceCtx.partyRelationshipTypeId" operator="equals" value="AGENT"/>
</assert>
</simple-method>
<simple-method method-name="testDeleteCommunicationEvent" short-description="Test the service deleteCommunicationEvent" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deleteCommunicationEvent" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-1"/>
</entity-one>
<assert>
<if-empty field="communicationEvent"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeleteCommunicationEventWorkEffort" short-description="Test the service deleteCommunicationEventWorkEffort" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-5"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deleteCommunicationEventWorkEffort" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-5"/>
</entity-one>
<set field="lookupValue.communicationEventId" value="TestEvent-5"/>
<find-by-and entity-name="CommunicationEventWorkEff" map="lookupValue" list="communicationEventWorkEff"/>
<assert>
<if-empty field="communicationEvent"/>
<if-empty field="communicationEventWorkEff"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyContactMechPurpose" short-description="Test the service deletePartyContactMechPurpose" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestContactMech"/>
<set field="serviceCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<set field="serviceCtx.fromDate" value="2000-01-01 00:00:00" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyContactMechPurpose" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyContactMechPurpose" value-field="partyContactMechPurpose">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="contactMechId" value="TestContactMech"/>
<field-map field-name="contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<field-map field-name="fromDate" value="2000-01-01 00:00:00"/>
</entity-one>
<assert>
<not><if-empty field="partyContactMechPurpose"/></not>
<not><if-empty field="partyContactMechPurpose.thruDate"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyContactMechPurposeIfExists" short-description="Test the service deletePartyContactMechPurposeIfExists" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestContactMech2"/>
<set field="serviceCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyContactMechPurpose" value-field="partyContactMechPurpose">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="contactMechId" value="TestContactMech2"/>
<field-map field-name="contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<field-map field-name="fromDate" value="2000-01-01 00:00:00"/>
</entity-one>
<assert>
<not><if-empty field="partyContactMechPurpose"/></not>
<not><if-empty field="partyContactMechPurpose.thruDate"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyRelationship" short-description="Test the service to delete PartyRelationship" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyIdTo" value="TestCustomer"/>
<set field="serviceCtx.roleTypeIdFrom" value="_NA_"/>
<set field="serviceCtx.roleTypeIdTo" value="CONTACT"/>
<set field="serviceCtx.fromDate" value="2000-01-01 00:00:00"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyRelationship" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRelationship" value-field="partyRelationship">
<field-map field-name="partyIdFrom" value="TestCompany"/>
<field-map field-name="partyIdTo" value="TestCustomer"/>
<field-map field-name="roleTypeIdFrom" value="_NA_"/>
<field-map field-name="roleTypeIdTo" value="CONTACT"/>
<field-map field-name="fromDate" value="2000-01-01 00:00:00"/>
</entity-one>
<assert>
<if-empty field="partyRelationship"/>
</assert>
</simple-method>
<simple-method method-name="testDeletePartyRole" short-description="A test to delete a role from party" login-required="false">
<set field="partyId" value="TestCustomer"/>
<set field="roleTypeId" value="ACCOUNTANT"/>
<set field="serviceCtx.partyId" from-field="partyId"/>
<set field="serviceCtx.roleTypeId" from-field="roleTypeId"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyRole" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyRole" value-field="partyRole">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="roleTypeId" value="ACCOUNTANT"/>
</entity-one>
<assert>
<if-empty field="partyRole"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testFindPartiesById" short-description="Test the service findPartiesById" login-required="false">
<set field="serviceCtx.idToFind" value="TestCustomer"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="findPartiesById" in-map-name="serviceCtx">
<result-to-field result-name="party"/>
</call-service>
<assert>
<not><if-empty field="party"/></not>
<if-compare field="party.partyId" operator="equals" value="TestCustomer"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testFindPartyFromEmailAddress" short-description="Test the service findPartyFromEmailAddress" login-required="false">
<set field="serviceCtx.address" value="newtest_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="findPartyFromEmailAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="party"/></not>
<not><if-empty field="contactMech"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testFindPartyFromTelephone" short-description="Test the service findPartyFromTelephone" login-required="false">
<set field="serviceCtx.telno" value="801555-5555"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="findPartyFromTelephone" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<assert>
<not><if-empty field="party"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testFindPartyFromTelephoneComplete" short-description="Test the service findPartyFromTelephoneComplete" login-required="false">
<set field="serviceCtx.telno" value="801555-5555"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="findPartyFromTelephoneComplete" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Party" value-field="party"/>
<assert>
<not><if-empty field="party"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemoveCommunicationEventRole" short-description="Test the service removeCommunicationEventRole" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-5"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="ADDRESSEE"/>
<set field="serviceCtx.statusId" value="COM_ROLE_CREATED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removeCommunicationEventRole" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-5"/>
<field-map field-name="roleTypeId" value="ADDRESSEE"/>
<field-map field-name="partyId" value="TestCompany"/>
</entity-one>
<assert>
<if-empty field="communicationEventRole"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testSetCommEventComplete" short-description="Test the service setCommEventComplete" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-6"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="setCommEventComplete" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-6"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare operator="equals" field="communicationEvent.statusId" value="COM_COMPLETE"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testSetCommunicationEventRoleStatus" short-description="Test the service setCommunicationEventRoleStatus" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-2"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="ADDRESSEE"/>
<set field="serviceCtx.statusId" value="COM_ROLE_COMPLETED"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="setCommunicationEventRoleStatus" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-2"/>
<field-map field-name="partyId" value="TestCompany"/>
<field-map field-name="roleTypeId" value="ADDRESSEE"/>
<field-map field-name="statusId" value="COM_ROLE_COMPLETED"/>
</entity-one>
<assert>
<not><if-empty field="communicationEventRole"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testSetCommEventRoleToRead" short-description="Test the service setCommEventRoleToRead" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-7"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="ADDRESSEE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="setCommEventRoleToRead" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-7"/>
<field-map field-name="partyId" value="TestCompany"/>
<field-map field-name="roleTypeId" value="ADDRESSEE"/>
<field-map field-name="statusId" value="COM_ROLE_READ"/>
</entity-one>
<assert>
<not><if-empty field="communicationEventRole"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testSetCommunicationEventStatus" short-description="Test the service setCommunicationEventStatus" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-6"/>
<set field="serviceCtx.statusId" value="COM_COMPLETE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="setCommunicationEventStatus" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-6"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare field="communicationEvent.statusId" operator="equals" value="COM_COMPLETE"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateCommunicationEvent" short-description="Test the service updateCommunicationEvent" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-7"/>
<set field="serviceCtx.statusId" value="COM_COMPLETE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateCommunicationEvent" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEvent" value-field="communicationEvent">
<field-map field-name="communicationEventId" value="TestEvent-7"/>
</entity-one>
<assert>
<not><if-empty field="communicationEvent"/></not>
<if-compare operator="equals" field="communicationEvent.statusId" value="COM_COMPLETE"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateCommunicationEventRole" short-description="Test the service updateCommunicationEventRole" login-required="false">
<set field="serviceCtx.communicationEventId" value="TestEvent-2"/>
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.roleTypeId" value="ADDRESSEE"/>
<set field="serviceCtx.statusId" value="COM_ROLE_READ"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateCommunicationEventRole" in-map-name="serviceCtx"/>
<entity-one entity-name="CommunicationEventRole" value-field="communicationEventRole">
<field-map field-name="communicationEventId" value="TestEvent-2"/>
<field-map field-name="roleTypeId" value="ADDRESSEE"/>
<field-map field-name="partyId" value="TestCompany"/>
</entity-one>
<assert>
<not><if-empty field="communicationEventRole"/></not>
<if-compare operator="equals" field="communicationEventRole.statusId" value="COM_ROLE_READ"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateContactMech" short-description="Test the service createContactMech" login-required="false">
<set field="serviceCtx.contactMechId" value="TestContactMech"/>
<set field="serviceCtx.contactMechTypeId" value="EMAIL_ADDRESS"/>
<set field="serviceCtx.infoString" value="demo_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateContactMech" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="demo_email@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateEmailAddress" short-description="Test the service updateEmailAddress" login-required="false">
<set field="serviceCtx.contactMechId" value="TestContactMech"/>
<set field="serviceCtx.emailAddress" value="test.email123@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateEmailAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="test.email123@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyEmailAddress" short-description="Test the service updatePartyEmailAddress" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestContactMech"/>
<set field="serviceCtx.emailAddress" value="test.email12345@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyEmailAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="ContactMech" value-field="contactMech"/>
<assert>
<not><if-empty field="contactMech"/></not>
<if-compare field="contactMech.infoString" operator="equals" value="test.email12345@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyGroup" short-description="Test the service to update party group" login-required="false">
<set field="serviceCtx.partyId" value="TestGroup-1"/>
<set field="serviceCtx.groupName" value="Test Party Group"/>
<set field="serviceCtx.logoImageUrl" value="http://ofbiz.apache.org/images/ofbiz_logo.gif"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyGroup" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyGroup" value-field="partyGroup">
<field-map field-name="partyId" value="TestGroup-1"/>
</entity-one>
<assert>
<not><if-empty field="partyGroup"/></not>
<if-compare field="partyGroup.groupName" operator="equals" value="Test Party Group"/>
<if-compare field="partyGroup.logoImageUrl" operator="equals" value="http://ofbiz.apache.org/images/ofbiz_logo.gif"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyPostalAddress" short-description="Test the service updatePartyPostalAddress" login-required="false">
<set field="serviceCtx.contactMechId" value="TestPostalAdd2"/>
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.toName" value="Test Address"/>
<set field="serviceCtx.address1" value="2004 Factory Blvd"/>
<set field="serviceCtx.city" value="City of Industry"/>
<set field="serviceCtx.countryGeoId" value="USA"/>
<set field="serviceCtx.stateProvinceGeoId" value="CA"/>
<set field="serviceCtx.postalCode" value="90000"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyPostalAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="PostalAddress" value-field="postalAddress"/>
<assert>
<not><if-empty field="postalAddress"/></not>
<if-compare field="postalAddress.address1" operator="equals" value="2004 Factory Blvd"/>
<if-compare field="postalAddress.city" operator="equals" value="City of Industry"/>
<if-compare field="postalAddress.postalCode" operator="equals" value="90000"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyRelationship" short-description="Test the service to update PartyRelationship" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyIdTo" value="TestParty"/>
<set field="serviceCtx.roleTypeIdFrom" value="_NA_"/>
<set field="serviceCtx.roleTypeIdTo" value="CONTACT"/>
<set field="serviceCtx.fromDate" value="2000-01-01 00:00:00"/>
<set field="serviceCtx.partyRelationshipTypeId" value="AGENT"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyRelationship" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="PartyRelationship" value-field="partyRelationship">
<field-map field-name="partyIdFrom" value="TestCompany"/>
<field-map field-name="partyIdTo" value="TestParty"/>
<field-map field-name="roleTypeIdFrom" value="_NA_"/>
<field-map field-name="roleTypeIdTo" value="CONTACT"/>
<field-map field-name="fromDate" value="2000-01-01 00:00:00"/>
</entity-one>
<assert>
<not><if-empty field="partyRelationship"/></not>
<if-compare field="partyRelationship.partyRelationshipTypeId" operator="equals" value="AGENT"/>
</assert>
</simple-method>
<simple-method method-name="testUpdatePartyTelecomNumber" short-description="Test the service updatePartyTelecomNumber" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestContactMech1"/>
<set field="serviceCtx.areaCode" value="801"/>
<set field="serviceCtx.contactNumber" value="1111111"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyTelecomNumber" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
<assert>
<not><if-empty field="telecomNumber"/></not>
<if-compare field="telecomNumber.areaCode" operator="equals" value="801"/>
<if-compare field="telecomNumber.contactNumber" operator="equals" value="1111111"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePerson" short-description="Test the service to update person" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.firstName" value="New Test"/>
<set field="serviceCtx.lastName" value="Person"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePerson" in-map-name="serviceCtx"/>
<entity-one entity-name="Person" value-field="person">
<field-map field-name="partyId" value="TestCustomer"/>
</entity-one>
<assert>
<not><if-empty field="person"/></not>
<if-compare field="person.firstName" operator="equals" value="New Test"/>
<if-compare field="person.lastName" operator="equals" value="Person"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePostalAddress" short-description="Test the service updatePostalAddress" login-required="false">
<set field="serviceCtx.contactMechId" value="TestPostalAdd1"/>
<set field="serviceCtx.toName" value="Test Address"/>
<set field="serviceCtx.address1" value="2004 Factory Blvd"/>
<set field="serviceCtx.city" value="City of Industry"/>
<set field="serviceCtx.countryGeoId" value="USA"/>
<set field="serviceCtx.stateProvinceGeoId" value="CA"/>
<set field="serviceCtx.postalCode" value="90000"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePostalAddress" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
<result-to-field result-name="oldContactMechId"/>
</call-service>
<entity-one entity-name="PostalAddress" value-field="postalAddress"/>
<assert>
<not><if-empty field="postalAddress"/></not>
<if-compare field="postalAddress.address1" operator="equals" value="2004 Factory Blvd"/>
<if-compare field="postalAddress.city" operator="equals" value="City of Industry"/>
<if-compare field="postalAddress.postalCode" operator="equals" value="90000"/>
<if-compare-field operator="not-equals" field="contactMechId" to-field="oldContactMechId"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateTelecomNumber" short-description="Test the service updateTelecomNumber" login-required="false">
<set field="serviceCtx.contactMechId" value="TestContactMech1"/>
<set field="serviceCtx.areaCode" value="801"/>
<set field="serviceCtx.contactNumber" value="1111111"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateTelecomNumber" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
<result-to-field result-name="oldContactMechId"/>
</call-service>
<entity-one entity-name="TelecomNumber" value-field="telecomNumber"/>
<assert>
<not><if-empty field="telecomNumber"/></not>
<if-compare field="telecomNumber.areaCode" operator="equals" value="801"/>
<if-compare field="telecomNumber.contactNumber" operator="equals" value="1111111"/>
<if-compare-field operator="not-equals" field="contactMechId" to-field="oldContactMechId"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testLookupParty" short-description="Test the service to lookupParty" login-required="false">
<set field="serviceCtx.firstName" value="Test"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="lookupParty" in-map-name="serviceCtx">
<result-to-field result-name="lookupResult"/>
</call-service>
<assert>
<not><if-empty field="lookupResult"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testGetPartyEmail" short-description="Test the service getPartyEmail" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getPartyEmail" in-map-name="serviceCtx">
<result-to-field result-name="emailAddress"/>
<result-to-field result-name="contactMechId"/>
</call-service>
<assert>
<not><if-empty field="emailAddress"/></not>
<not><if-empty field="contactMechId"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateAffiliate" short-description="Test the service createAffiliate" login-required="false">
<set field="serviceCtx.partyId" value="TestCompany"/>
<set field="serviceCtx.affiliateName" value="Test Affiliate"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createAffiliate" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Affiliate" value-field="affiliate"/>
<assert>
<not><if-empty field="affiliate"/></not>
<if-compare field="affiliate.affiliateName" operator="equals" value="Test Affiliate"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdateAffiliate" short-description="Test the service updateAffiliate" login-required="false">
<set field="serviceCtx.partyId" value="TestGroup-1"/>
<set field="serviceCtx.affiliateName" value="Test Affiliate"/>
<set field="serviceCtx.siteType" value="Main Site"/>
<set field="serviceCtx.siteVisitors" value="2000"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updateAffiliate" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Affiliate" value-field="affiliate">
<field-map field-name="partyId" value="TestGroup-1"/>
<field-map field-name="affiliateName" value="Test Affiliate"/>
</entity-one>
<assert>
<not><if-empty field="affiliate"/></not>
<if-compare field="affiliate.siteType" operator="equals" value="Main Site"/>
<if-compare field="affiliate.siteVisitors" operator="equals" value="2000"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testGetPartyMainRole" short-description="Test the service getPartyMainRole" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getPartyMainRole" in-map-name="serviceCtx">
<result-to-field result-name="roleTypeId"/>
</call-service>
<entity-one entity-name="PartyRole" value-field="partyRole">
<field-map field-name="partyId" value="TestCustomer"/>
</entity-one>
<assert>
<not><if-empty field="partyRole"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testGetPartyTelephone" short-description="Test the service getPartyTelephone" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getPartyTelephone" in-map-name="serviceCtx">
<result-to-field result-name="contactNumber"/>
<result-to-field result-name="contactMechId"/>
</call-service>
<assert>
<not><if-empty field="contactNumber"/></not>
<not><if-empty field="contactMechId"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testQuickCreateCustomer" short-description="Test the service quickCreateCustomer" login-required="false">
<set field="serviceCtx.firstName" value="Test"/>
<set field="serviceCtx.lastName" value="Customer"/>
<set field="serviceCtx.emailAddress" value="test.customer@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="quickCreateCustomer" in-map-name="serviceCtx">
<result-to-field result-name="partyId"/>
</call-service>
<entity-one entity-name="Person" value-field="person"/>
<entity-one entity-name="PartyRole" value-field="partyRole">
<field-map field-name="roleTypeId" value="CUSTOMER"/>
</entity-one>
<assert>
<not><if-empty field="person"/></not>
<not><if-empty field="partyRole"/></not>
<if-compare field="person.firstName" operator="equals" value="Test"/>
<if-compare field="person.lastName" operator="equals" value="Customer"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateAddressMatchMap" short-description="Test the service createAddressMatchMap" login-required="false">
<set field="serviceCtx.mapKey" value="TEST_KEY"/>
<set field="serviceCtx.mapValue" value="TEST VALUE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createAddressMatchMap" in-map-name="serviceCtx"/>
<entity-one entity-name="AddressMatchMap" value-field="addressMatchMap">
<field-map field-name="mapKey" value="TEST_KEY"/>
<field-map field-name="mapValue" value="TEST VALUE"/>
</entity-one>
<assert>
<not><if-empty field="addressMatchMap"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testRemoveAddressMatchMap" short-description="Test the service removeAddressMatchMap" login-required="false">
<set field="serviceCtx.mapKey" value="TESTKEY-1"/>
<set field="serviceCtx.mapValue" value="Test Value 1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="removeAddressMatchMap" in-map-name="serviceCtx"/>
<entity-one entity-name="AddressMatchMap" value-field="addressMatchMap">
<field-map field-name="mapKey" value="TESTKEY-1"/>
<field-map field-name="mapValue" value="Test Value 1"/>
</entity-one>
<assert>
<if-empty field="addressMatchMap"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyInvitation" short-description="Test the service createPartyInvitation" login-required="false">
<set field="serviceCtx.partyIdFrom" value="TestCompany"/>
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.emailAddress" value="test_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyInvitation" in-map-name="serviceCtx">
<result-to-field result-name="partyInvitationId"/>
</call-service>
<entity-one entity-name="PartyInvitation" value-field="partyInvitation"/>
<assert>
<not><if-empty field="partyInvitation"/></not>
<if-compare operator="equals" field="partyInvitation.emailAddress" value="test_email@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePartyInvitation" short-description="Test the service updatePartyInvitation" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE"/>
<set field="serviceCtx.emailAddress" value="test_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePartyInvitation" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitation" value-field="partyInvitation">
<field-map field-name="partyInvitationId" value="TEST_INVITE"/>
</entity-one>
<assert>
<not><if-empty field="partyInvitation"/></not>
<if-compare operator="equals" field="partyInvitation.emailAddress" value="test_email@example.com"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyInvitation" short-description="Test the service deletePartyInvitation" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE-1"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyInvitation" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitation" value-field="partyInvitation">
<field-map field-name="partyInvitationId" value="TEST_INVITE-1"/>
</entity-one>
<assert>
<if-empty field="partyInvitation"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testGetPartyPostalAddress" short-description="Test the service getPartyPostalAddress" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="getPartyPostalAddress" in-map-name="serviceCtx">
<result-to-field result-name="address1"/>
<result-to-field result-name="countryGeoId"/>
<result-to-field result-name="contactMechId"/>
</call-service>
<assert>
<not><if-empty field="address1"/></not>
<not><if-empty field="countryGeoId"/></not>
<not><if-empty field="contactMechId"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyContactMechPurpose" short-description="Test the service createPartyContactMechPurpose" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestContactMech"/>
<set field="serviceCtx.contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<set field="serviceCtx.fromDate" value="2009-09-09 01:01:01" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyContactMechPurpose" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyContactMechPurpose" value-field="partyContactMechPurpose">
<field-map field-name="partyId" value="TestCustomer"/>
<field-map field-name="contactMechId" value="TestContactMech"/>
<field-map field-name="contactMechPurposeTypeId" value="PRIMARY_EMAIL"/>
<field-map field-name="fromDate" value="2009-09-09 01:01:01"/>
</entity-one>
<assert>
<not><if-empty field="partyContactMechPurpose"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreateEmailAddressVerification" short-description="Test the service createEmailAddressVerification" login-required="false">
<set field="serviceCtx.emailAddress" value="test_email@example.com"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createEmailAddressVerification" in-map-name="serviceCtx">
<result-to-field result-name="verifyHash"/>
</call-service>
<entity-one entity-name="EmailAddressVerification" value-field="emailAddressVerification">
<field-map field-name="emailAddress" value="test_email@example.com"/>
</entity-one>
<assert>
<not><if-empty field="emailAddressVerification"/></not>
<if-compare-field operator="equals" field="emailAddressVerification.verifyHash" to-field="verifyHash"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyInvitationRoleAssoc" short-description="Test the service createPartyInvitationRoleAssoc" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE"/>
<set field="serviceCtx.roleTypeId" value="COMMEVENT_ROLE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyInvitationRoleAssoc" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitationRoleAssoc" value-field="partyInvitationRoleAssoc">
<field-map field-name="partyInvitationId" value="TEST_INVITE"/>
<field-map field-name="roleTypeId" value="COMMEVENT_ROLE"/>
</entity-one>
<assert>
<not><if-empty field="partyInvitationRoleAssoc"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyInvitationRoleAssoc" short-description="Test the service deletePartyInvitationRoleAssoc" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE-2"/>
<set field="serviceCtx.roleTypeId" value="COMMEVENT_ROLE"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyInvitationRoleAssoc" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitationRoleAssoc" value-field="partyInvitationRoleAssoc">
<field-map field-name="partyInvitationId" value="TEST_INVITE-2"/>
<field-map field-name="roleTypeId" value="COMMEVENT_ROLE"/>
</entity-one>
<assert>
<if-empty field="partyInvitationRoleAssoc"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testUpdatePostalAddressAndPurposes" short-description="Test the service updatePostalAddressAndPurposes" login-required="false">
<set field="serviceCtx.partyId" value="TestCustomer"/>
<set field="serviceCtx.contactMechId" value="TestPostalAdd3"/>
<set field="serviceCtx.toName" value="Test Address"/>
<set field="serviceCtx.address1" value="2004 Factory Blvd"/>
<set field="serviceCtx.city" value="City of Industry"/>
<set field="serviceCtx.countryGeoId" value="USA"/>
<set field="serviceCtx.stateProvinceGeoId" value="CA"/>
<set field="serviceCtx.postalCode" value="90000"/>
<set field="serviceCtx.fromDate" value="2001-05-13 00:00:00.000" type="Timestamp"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="updatePostalAddressAndPurposes" in-map-name="serviceCtx">
<result-to-field result-name="contactMechId"/>
</call-service>
<entity-one entity-name="PostalAddress" value-field="postalAddress"/>
<assert>
<not><if-empty field="postalAddress"/></not>
<if-compare field="postalAddress.address1" operator="equals" value="2004 Factory Blvd"/>
<if-compare field="postalAddress.city" operator="equals" value="City of Industry"/>
<if-compare field="postalAddress.postalCode" operator="equals" value="90000"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testCreatePartyInvitationGroupAssoc" short-description="Test the service createPartyInvitationGroupAssoc" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE"/>
<set field="serviceCtx.partyIdTo" value="TestCompany"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="createPartyInvitationGroupAssoc" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitationGroupAssoc" value-field="partyInvitationGroupAssoc">
<field-map field-name="partyInvitationId" value="TEST_INVITE"/>
<field-map field-name="partyIdTo" value="TestCompany"/>
</entity-one>
<assert>
<not><if-empty field="partyInvitationGroupAssoc"/></not>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testDeletePartyInvitationGroupAssoc" short-description="Test the service deletePartyInvitationGroupAssoc" login-required="false">
<set field="serviceCtx.partyInvitationId" value="TEST_INVITE-2"/>
<set field="serviceCtx.partyIdTo" value="TestCompany"/>
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="deletePartyInvitationGroupAssoc" in-map-name="serviceCtx"/>
<entity-one entity-name="PartyInvitationGroupAssoc" value-field="partyInvitationGroupAssoc">
<field-map field-name="partyInvitationId" value="TEST_INVITE-2"/>
<field-map field-name="partyIdTo" value="TestCompany"/>
</entity-one>
<assert>
<if-empty field="partyInvitationGroupAssoc"/>
</assert>
<check-errors/>
</simple-method>
<simple-method method-name="testClearAddressMatchMap" short-description="Test the service clearAddressMatchMap" login-required="false">
<entity-one entity-name="UserLogin" value-field="userLogin">
<field-map field-name="userLoginId" value="system"/>
</entity-one>
<set field="serviceCtx.userLogin" from-field="userLogin"/>
<call-service service-name="clearAddressMatchMap" in-map-name="serviceCtx"/>
<entity-condition entity-name="AddressMatchMap" list="addrs"/>
<assert>
<if-empty field="addrs"/>
</assert>
<check-errors/>
</simple-method>
</simple-methods>