Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | API Reference | awSet | awSetField
 
awSetField
BrokerError awSetField(
BrokerEvent event,
char *field_name,
short field_type,
void *value);
event
The event whose field is to be set.
field_name
The name of the event field to set.
field_type
The field's type, such as FIELD_TYPE_BOOLEAN (see the table below).
value
The field's new value.
Sets the value of the destination event field field_name to the source value. To set sequence fields, use the awSetSequenceField function described on awSetSequenceField. The use of the source value depends on the type of the destination field, indicated by field_type.
*For basic types, pass the address of a variable of that type.
*For strings, pass a char* pointer.
*For structures, pass a BrokerEvent.
*For BrokerBoolean, pass one of these two values: True (1) or False (0).
Note:
Attempting to set a an event field with a type that does not match the event's definition will result in an error being returned. No error will be returned if a FIELD_TYPE_STRING value is used to set a field whose type is FIELD_TYPE_UNICODE_STRING. In these cases, the ANSI string that is supplied will automatically be converted to a unicode string.
See Specifying Field Names for complete information on specifying field_name.
Field Type Values for awSetField
FIELD_TYPE_BYTE
char *
FIELD_TYPE_SHORT
short*
FIELD_TYPE_INT
int *
FIELD_TYPE_LONG
BrokerLong *
FIELD_TYPE_FLOAT
float *
FIELD_TYPE_DOUBLE
double *
FIELD_TYPE_BOOLEAN
BrokerBoolean *
FIELD_TYPE_DATE
BrokerDate *
FIELD_TYPE_CHAR
char *
FIELD_TYPE_STRING
char *
FIELD_TYPE_STRUCT
BrokerEvent
FIELD_TYPE_UNICODE_CHAR
charUC *
FIELD_TYPE_UNICODE_STRING
charUC *
Possible BrokerError major codes
Meaning
AW_ERROR_FIELD_NOT_FOUND
The event is associated with a Broker client and field_name does not exist in the event.
AW_ERROR_FIELD_TYPE_MISMATCH
The field's type does not match the type of field_type or the field_name incorrectly accesses a type.
AW_ERROR_INVALID_EVENT
The event is invalid.
AW_ERROR_INVALID_FIELD_NAME
The field_name is invalid.
AW_ERROR_INVALID_TYPE
The field_type is FIELD_TYPE_SEQUENCE or is not a supported field type.
AW_ERROR_NULL_PARAM
The parameter field_name or value is NULL.
See also: