guidewiregosuclaimcenter

calling ContactUtil.unlinkCMContact() from batch


In ClaimCenter, I need to unlink a contact entity from appropriate CM entity. I have found a method ContactUtil.unlinkCMContact(pcf.api.Location, entity.Contact) which does exactly that and I would like to call it.

The problem is that the method receives a parameter of type Location, but I am inside a batch process and I have no UI context and no variable like _currentLocation_ available to use.

I have tried to pass the null value, but it raised an exception, obviously that parameter is really used to access the bundle, although there is no UI. Also I have tried to create some dummy Location instance but it seems unfeasable outside of pcf context.
I would like to avoiding reimplementing of the method because I really do not know what exactly should I implement in that case.


Solution

  • What is your exact requirement? If you only need the contact to not pick up any more the changes from ContactManager automatically I think it should be enough with setting the contact.AutoSync flag to TC_SUSPENDED. If you need to completely unlink the contact you could explore the functions defined in the ContactSystemLinkPlugin, such as unlink, or calling link with a null ABUID.