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