Skip to end of banner
Go to start of banner

Hooks Mechanism

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

From R14 onwards the Hooks Mechanism can be used to customize the existing business logic.

What does this section cover?

Hooks Mechanism

The Hooks Mechanism gives you the ability to extend the existing functionality by intercepting main system processes. This can be achieved by implementing specific abstract methods that are called before and after main system methods such as construct, save, delete etc.

Business Objects

To be able to extend the functionality of an existing Business Object EJB class you have to:

  1. Create a custom EJB class extending com.crm.businessobject.CRMBase and implementing com.crm.hooks.CRMBOHook interface.
  2. Declare your hook implementation class in hooks.xml file which is located under <your_custom_project_directory>/src/main/resources

 

 Example
hooks.xml
<hookconfig>
	<hooks>
		...
		<hook>
			<serviceclass>CRMBOContactInformationBean</serviceclass>
			<interfacename>CRMBOHook</interfacename>
			<implementationclass>CUSTOMCRMBOContactInformationBean</implementationclass>
		</hook>
	</hooks>
</hookconfig>


Processes

To be able to extend the functionality of an existing Process EJB class you have to:

 

  1. Create a custom EJB class extending com.crm.process.CRMProcess and implementing one of the interfaces found in com.crm.hooks package. Keep in mind that there are available interfaces for some but not all processes.
  2. Declare your hook implementation class in hooks.xml file which is located under <your_custom_project_directory>/src/main/resources


 

 Example
hooks.xml
<hookconfig>
	<hooks>
		...
		<hook>
			<serviceclass>CRMProcessServiceRequestBean</serviceclass>
			<interfacename>CRMProcessServiceRequestHook</interfacename>
			<implementationclass>CUSTOMCRMProcessServiceRequestBean</implementationclass>
		</hook>
	</hooks>
</hookconfig>


 


  • No labels