OpenWGA 7.10 - TMLScript reference


Object:

HDBModelEvent

Description

The HDBModelEvent is passed to HDBModel event scripts to provide context information and offer event-specific functionality.

All properties of the operation that were not passed by the calling code may return null in this case.

Retrieval Passed as single parameter object to HDBModel event script functions
Properties and methods
Name Purpose
cancel(message [, javaException]) Cancels the HDBModel operation currently taking place
content Returns the content on which the operation is performed
contentClass Returns the content class of the content on which the operation is done
customParam A custom parameter for usage in event scripts and update processes
hdbModel.deletedContentKey Returns the content key of the deleted document in a delete operation
eventReceiver Returns the content document whose event script is executed
form Returns a TMLForm object that was passed to the operation
Examples

A HDBModel event script uses the HDBModel event object (received under name "e") to cancel the event in case that no custom param is passed.

this.preCreate = function(e) {

  if (e.customParam == null) {

    e.cancel("A custom parameter must be given to create this content class");

  }

}