Class EntityEventHandler
Abstract base class for an entity event handler.
Implements
Inherited Members
Namespace: Attachmate.Verastream.HostIntegrator.ScriptAPI
Assembly: Attachmate.Verastream.HostIntegrator.ScriptAPI.dll
Syntax
public abstract class EntityEventHandler : MarshalByRefObject, IEventHandler
Remarks
Abstract base class for an entity event handler. All classes that extend this class appear as entity event handlers in the VHI design tool.
Methods
EntityArrival(IEntityArrivalEvent)
Called when a new entity is recognized and validated as defined in the model.
Declaration
public virtual void EntityArrival(IEntityArrivalEvent vsEvent)
Parameters
Type | Name | Description |
---|---|---|
IEntityArrivalEvent | vsEvent | The event instance. |
Remarks
Any exception thrown from this event will cause the currently running operation, if any, to fail.
Exceptions
Type | Condition |
---|---|
ApptrieveException | Any exception will interrupt the current client request or model activity. |
EntityDeparture(IEntityDepartureEvent)
Called when the current entity is no longer recognized.
Declaration
public virtual void EntityDeparture(IEntityDepartureEvent vsEvent)
Parameters
Type | Name | Description |
---|---|---|
IEntityDepartureEvent | vsEvent | The event instance. |
Remarks
If another entity is not recognized, this event can override the departure and stay at the previously recognized entity. When departure is overridden, this event will fire again the next time data is received from the host.
Any exception thrown from this event will cause the currently running operation, if any, to fail.
Exceptions
Type | Condition |
---|---|
ApptrieveException | Any exception will interrupt the current client request or model activity. |
InitializeLifetimeService()
Tell the .NET Framework remoting system that instances of this type have an infinite lifetime.
Declaration
public override object InitializeLifetimeService()
Returns
Type | Description |
---|---|
object | A null value. |
Overrides
MoveCursor(IEntityMoveCursorEvent)
Called when the cursor needs to move to a specific location on the terminal screen.
Declaration
public virtual void MoveCursor(IEntityMoveCursorEvent vsEvent)
Parameters
Type | Name | Description |
---|---|---|
IEntityMoveCursorEvent | vsEvent | The event instance. |
Remarks
This event will fire in response to the following commands if the cursor is not already at the requested location:
- DefaultValue
- DefaultValueEncrypted
- MoveCursor
- ShiftCursor
- TransmitToAttr
- TransmitToAttrEncrypted
- TransmitToField
- TransmitToFieldEncrypted
- TransmitToOffset
- TransmitToOffsetEncrypted
- UpdateAttribute
- UpdateRecordSetField
If no method to move the cursor forward or backward is defined for a character mode model, this event will fire to position the cursor at each attribute and field before writing.
If the cursor is not positioned at the specified location upon returning from the event, VHI will fail the current client request.
Any exception thrown from this event will cause the current command to fail.
Exceptions
Type | Condition |
---|---|
ApptrieveException | Any exception will result in the move cursor to fail. |
WriteAttributes(IWriteAttributesEvent)
Called when when a client or procedure requests to write one or more attributes on the entity.
Declaration
public virtual void WriteAttributes(IWriteAttributesEvent vsEvent)
Parameters
Type | Name | Description |
---|---|---|
IWriteAttributesEvent | vsEvent | The event instance. |
Remarks
Called when when a client or procedure requests to write one or more attributes on the entity. In addition, the event is fired in response to the following commands:
- UpdateAttributes
- UpdateRecordSetFields
This event is not fired when an attribute or field is written with one of the following commands:
- DefaultValue
- DefaultValueEncrypted
- TransmitToAttr
- TransmitToAttrEncrypted
- TransmitToField
- TransmitToFieldEncrypted
- UpdateAttribute
- UpdateRecordSetField
The intended usage of this event is to orchestrate the order of
attribute writes and the cursor movement between them. The actual
writing of each attribute to the terminal can be done, but its
recommended to use the IWriteAttributesEvent
method WriteAttribute
to write each attribute. This method ensures that the appropriate
AttributeEventHandler
method
WriteAttribute
, if any,
is called.
Any exception thrown from this event will cause the write request to fail.
Exceptions
Type | Condition |
---|---|
ApptrieveException | Any exception will cause the writing of attributes to fail. |