Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Creating and Initializing Events | Creating Events | Field Type Checking
 
Field Type Checking
When you create an event with a BrokerClient reference, the following field type checking rules will be applied to the event.
1. All event fields will appear to be set on the event at the time the event is created.
2. You are not allowed to set a field which does not exist for the event type.
3. You cannot set an event field with a data type other than that defined by the event type.
When you create an event with a null BrokerClient reference, the following type checking rules will be applied to the event.
1. You can set fields with any field name and any data type.
2. Any attempt to retrieve an event field that was not previously set will cause a BrokerFieldNotFoundException exception to be thrown.
3. After a field has been set, you are not allowed to change the field's type without first clearing the event field, using the BrokerEvent.clearField method or clearing the entire event using the BrokerEvent.clear method.
Note:
For most applications, you should create an event within the context of a Broker client so that type checking will occur.