cancel
Showing results for 
Search instead for 
Did you mean: 

Anonymize Customer Data in Hybris for B2Bcustomer and Customer

0 Kudos

We have task to do Anonymization b2bcustomer data . Can any one tell me how to do this.

I have tried doing with below groovy scripts.

import de.hybris.platform.servicelayer.search.FlexibleSearchQuery;

import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;

modelService = spring.getBean("modelService");

queryString = new StringBuilder("Select {pk} from {B2BCustomer}");

query = new FlexibleSearchQuery(queryString.toString());

resultProd = flexibleSearchService.search(query);

b2bCustomerResults = resultProd.getResult();

int i=0;

b2bCustomerResults.each {B2BCustomerModel ->

i++;

B2BCustomerModel.setUid("test@yopmail.com");

B2BCustomerModel.setName("Test");

B2BCustomerModel.setPhone("xxxxx");

B2BCustomerModel.setFirstName("test");

B2BCustomerModel.setLastName("test");

modelService.save(B2BCustomerModel);

}


Facing below exception when running above scrpit

Script execution has failed [reason: de.hybris.platform.servicelayer.exceptions.ModelSavingException: [de.hybris.platform.gigya.gigyaservices.interceptor.GigyaUserValidateInterceptor@3c59d50]:Error while sending user information to gigya.]

We tried to unregister the interceptor but still facing issue.

def inteceptorMapping = spring.getBean("gigyaUserValidateInterceptor")

registry = spring.getBean("interceptorRegistry");

registry.unregisterInterceptor(inteceptorMapping);

Script execution has failed [reason: de.hybris.platform.servicelayer.exceptions.ModelSavingException: [de.hybris.platform.gigya.gigyaservices.interceptor.GigyaUserValidateInterceptor@ffa6dc1]:Error while sending user information to gigya.]Script execution has failed [reason: groovy.lang.MissingMethodException: No signature of method: de.hybris.platform.servicelayer.interceptor.impl.DefaultInterceptorRegistry.unregisterInterceptor() is applicable for argument types: (de.hybris.platform.gigya.gigyaservices.interceptor.GigyaUserValidateInterceptor) values: [de.hybris.platform.gigya.gigyaservices.interceptor.GigyaUserValidateInterceptor@3c59d50]Possible solutions: unregisterInterceptor(de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping), registerInterceptor(de.hybris.platform.servicelayer.interceptor.impl.InterceptorMapping), registerInterceptor(java.lang.String, de.hybris.platform.servicelayer.interceptor.Interceptor, java.util.Collection)]Can any one help how to unregister the inteceptor . Or can we please tell how to do Anonymize the B2Bcustomer in hybris.

Accepted Solutions (0)

Answers (0)