Reply To: Tran Event Notification “field Value Changed” Does Not Work

#8316
Jane Dillon
Participant

Hi

Thanks for the reply. Unfortunately with your suggestions and my current implementation the behaviour is as before, i.e.
– Filtering the available values is possible but clearing/resetting the Internal-BU-field value has not been possible.

All my target filtered fields are “Picklists” so concentrating on “a single tran info field” would still have to be a picklist
and “InternalBU” (or “ExternalBU”) will have to be tested to prove feasibility.
While I appreciate why you mentioned starting on “a single tran info field” – “InternalBU” (or “ExternalBU” or similar) will have to be handled.

My set-up at the moment is as follows;

Script 1:
Instrument Builder → User-driven Tran Field Notification → Event Notification.
Events: “Field Options”, “Field Options, Field Value Changed”
Implementation class: extends AbstractFieldEventListener
Override method: com.olf.embedded.trading.AbstractFieldEventListener.getChoices(Session, Field, ReferenceChoices)

Script 2:
Operation Services → Tranfield → Pre-process
Criteria: Tranfields: “Tran – Ins Type (56)”
Implementation class: implements FieldListener
Override method: com.olf.embedded.trading.FieldListener.preProcess(Context, Field, String, String, Table)

Below is a sample of the code used to test the setting of a value and sample error Messages – from Script 2;

Test 1;
ReferenceChoice internalBuToBeSet = internalBuField.getChoices().get(0);
internalBuField.setSelection(internalBuToBeSet);
Error 1;
Fail Exception: Error: Index = 0, but should be between 0 and -1

Test 2;
StaticDataFactory staticDataFactory = context.getStaticDataFactory();
ReferenceChoice none = staticDataFactory.getReferenceChoices(EnumReferenceTable.Bunit).findChoice(“None”);
internalBuField.setSelection(none);
//Note: I have tried to add “none” to the filtered list.
Error 2;
OLF Presentation Module:SET_ERROR_INFO:-12:Tranfield Operations Service ‘InstrumentTypeFieldChanger’ Failure. (Exception: Error: Choice provided ‘None’ is invalid. This choice is unavailable.). Operation has been blocked.:
OLF Presentation Module:SET_ERROR_INFO:-12:Operation service pre-process check failure:

Test 3;
internalBuField.setValue(“”);
Error 3;
OLF Presentation Module:SET_ERROR_INFO:-12:Tranfield Operations Service ‘InstrumentTypeFieldChanger’ Failure. (Exception: Error: Invalid value () provided for reference field ‘Int Bunit’ (seq nums = 0, -1, -1, -1, -1)). Operation has been blocked.:
OLF Presentation Module:SET_ERROR_INFO:-12:Operation service pre-process check failure:

Test 4;
StaticDataFactory staticDataFactory = context.getStaticDataFactory();
ReferenceChoices allChoices = staticDataFactory.getReferenceChoices(EnumReferenceTable.Bunit);
ReferenceChoice knownValidChoice = allChoices.findChoice(“…..”);
internalBuField.setSelection(knownValidChoice);

Error 4;
InstrumentTypeFieldChanger Fail Exception: Error: Choice provided ‘…..’ is invalid. This choice is unavailable.

Download PDF version

This field is for validation purposes and should be left unchanged.