Example: nca_java_set_option

In the following example, a Java object appears and its fields are filled after the button press CONTROL_B_OK_COURT_0. The name of the Java object is CONTROL_BN_SESSION_VALIDATION_0, and its properties and their values (taken from the recording log) are as follows:

Example: Server Message Properties: action=2 handlerClassId=0x10F handlerId=84
property=402 type=0xE008 value=Message
Sub Message Properties: action=2 handlerClassId=0x10F handlerId=84
property=403 type=0x4000 value="sessionId"
property=404 type=0x4000 value="381"
property=403 type=0x4000 value="sessionType"
property=404 type=0x4000 value="A"
property=403 type=0x4000 value="traceMask"
property=404 type=0x4000 value="0"
The handlerClassId field identifies it as a Java object. The first property is sessionId and its value is "381". The example uses the JAVA_SAVE_PROP option of nca_java_set_option to enable Vugen to save all the values. It then retrieves the sessionId value from the object.
The example also uses nca_java_set_option to change the separator from the default `|' character to `#', because the user already uses `|' as data in the fields.
char *java_value;

nca_java_set_option
(JAVA_SAVE_PROP, 1);
nca_java_set_option(JAVA_SEPARATOR, '#');

nca_set_window("Libra");

/* The Java object is created after the call to nca_menu_select_item */
nca_menu_select_item("Libra", "Results;Confirm Sessions");
nca_button_set("CONTROL_LIST_TYPE_R_ADMIN_0",1);
nca_button_press("CONTROL_BUT_FROM_DATE_0");
nca_set_window("Calendar");
nca_button_press("CALENDAR_OK_0");
nca_set_window("Session Confirmation");

/* The Java object's fields are created after this operation */
nca_button_press("CONTROL_B_OK_COURT_0");

/* Get one the Java object's properties: the session id */
nca_java_get_value_ex("CONTROL_BN_SESSION_VALIDATION_0", "sessionId", java_value);
lr_output_message("value=%s", java_value);
nca_java_delete_name("CONTROL_BN_SESSION_VALIDATION_0", "sessionId");