public class DefaultEventHandler extends AbstractEventHandler
Default EventHandler that returns false for all event types.
Override the specific handleEvent() methods for events associated with your
trigger rule.
Example:
public boolean handleEvent(UpdateResourceEvent event) {
IGRCObject object = (IGRCObject) event.getResource();
//example: in addition to other updates, set a field to current date
setCurrentDate(object);
return true;
}
Custom EventHandlers should extend this class rather than directly extending from
AbstractEventHandler.
To throw a validation message or error from a handleEvent method, use
AbstractEventHandler.throwException(String, java.util.List, Throwable, com.ibm.openpages.api.Context).
| Constructor and Description |
|---|
DefaultEventHandler()
Default constructor
|
DefaultEventHandler(java.util.HashMap<java.lang.String,java.lang.String> attributes)
Constructor with the Map of all attributes of the event handler.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleEvent(AbstractEvent event)
Abstract method to handle an event.
|
boolean |
handleEvent(AssociateResourceEvent event)
HandleEvent() method for AssociateResourceEvent type.
|
boolean |
handleEvent(CopyResourceEvent event)
HandleEvent() method for CopyResourceEvent type.
|
boolean |
handleEvent(CreateResourceEvent event)
HandleEvent() method for CreateResourceEvent type.
|
boolean |
handleEvent(CreateResourceWithRelationsEvent event)
HandleEvent() method for CreateResourceWithRelationsEvent type.
|
boolean |
handleEvent(DeleteResourceEvent event)
HandleEvent() method for DeleteResourceEvent type.
|
boolean |
handleEvent(DisassociateResourceEvent event)
HandleEvent() method for DissassociateResourceEvent type.
|
boolean |
handleEvent(MoveResourceEvent event)
HandleEvent() method for MoveResourceEvent type.
|
boolean |
handleEvent(QueryEvent event)
HandleEvent() method for QueryEvent type.
|
boolean |
handleEvent(ReassignPrimaryParentEvent event)
HandleEvent() method for ReassignPrimaryParentEvent type.
|
boolean |
handleEvent(RenameResourceEvent event)
HandleEvent() method for RenameResourceEvent type.
|
boolean |
handleEvent(SearchEvent event)
HandleEvent() method for SearchEvent type.
|
boolean |
handleEvent(UpdateResourceEvent event)
HandleEvent() method for UpdateResourceEvent type.
|
getAttributes, getRuleAttributes, setAttributes, setRuleAttributes, throwExceptionpublic DefaultEventHandler()
public DefaultEventHandler(java.util.HashMap<java.lang.String,java.lang.String> attributes)
attributes - a Map of attributes that provide configuration to the Event Handlerpublic final boolean handleEvent(AbstractEvent event) throws java.lang.Exception
AbstractEventHandlerhandleEvent in class AbstractEventHandlerevent - the event for the event handler to handlejava.lang.Exceptionpublic boolean handleEvent(CreateResourceEvent event)
TriggerPositionType.PRE.event - a create resource event to be handledpublic boolean handleEvent(CreateResourceWithRelationsEvent event)
TriggerPositionType.PRE.event - a create resource with relations event to be handledpublic boolean handleEvent(UpdateResourceEvent event)
event - an update resource event to be handledpublic boolean handleEvent(AssociateResourceEvent event)
event - an associate resource event to be handledpublic boolean handleEvent(DisassociateResourceEvent event)
event - a disassociate resource event to be handledpublic boolean handleEvent(ReassignPrimaryParentEvent event)
event - a reassigning primary parent event to be handledpublic boolean handleEvent(CopyResourceEvent event)
event - a copy resource event to be handledpublic boolean handleEvent(MoveResourceEvent event)
event - a move resource event to be handledpublic boolean handleEvent(RenameResourceEvent event)
event - a rename resource event to be handledpublic boolean handleEvent(DeleteResourceEvent event)
event - a delete resource event to be handledpublic boolean handleEvent(QueryEvent event)
event - a query event to be handledpublic boolean handleEvent(SearchEvent event)
event - a search event to be handled
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.