BL Scripting with JavaScript
- 1 Introduction
- 2 Business Rule scripting with JavaScript
- 2.1 JS FIX functionality
- 2.2 Error handling during script execution
- 2.3 Logging in JavaScript
- 2.3.1 print(<text>)
- 2.4 Operations with session
- 2.4.1 startSession(<sessionName>)
- 2.4.2 startSession(<senderCompId>,<targetCompId>)
- 2.4.3 startSession(<senderCompId>,<targetCompId>,<sessionQualifier>)
- 2.4.4 disconnectSession(<sessionName>,<reason>)
- 2.4.5 disconnectSession(<senderCompId>,<targetCompId>,<reason>)
- 2.4.6 disconnectSession(<senderCompId>,<targetCompId>,<sessionQualifier>,<reason>)
- 2.4.7 terminateSession(<sessionName>,<reason>)
- 2.4.8 terminateSession(<senderCompId>,<targetCompId>,<reason>)
- 2.4.9 terminateSession(<senderCompId>,<targetCompId>,<sessionQualifier>,<reason>)
- 2.5 Operations with messages across BL rules
- 2.5.1 setCtxKV(key,value)
- 2.5.2 getCtxKV(key,[defaultValue])
- 2.5.3 delCtxKV(key)
- 2.6 Operations with group fields
- 2.7 Bulk operations with group fields
- 2.8 Operations with message fields
- 2.8.1 removeField(<fieldTag>)
- 2.8.2 createReject(rejectType [, jAsFallback])
- 2.8.3 isSupportedField(<fieldTag>)
- 2.8.4 isSupportedField( <group handle> , <fieldTag>)
- 2.8.5 getNumField(<fieldTag>)
- 2.8.6 getNumField(<group handle>, <entry>, <fieldTag>)
- 2.8.7 getDateField(<fieldTag>, <format>)
- 2.8.8 getDateField(<group handle>, <entry>, <fieldTag>, <format>)
- 2.8.9 getStringField(<fieldTag>)
- 2.8.10 getStringField(<group handle>, <entry>, <fieldTag>)
- 2.8.11 getMStringField(<fieldTag>)
- 2.8.12 getMStringField(<group handle>, <entry>, <fieldTag>)
- 2.8.13 getRawDataField(<fieldTag>)
- 2.8.14 getRawDataField(<group handle>, <entry>, <fieldTag>)
- 2.8.15 setNumField(<fieldTag>, <new value>)
- 2.8.16 setDateField(<fieldTag>, <format>, <new value>)
- 2.8.17 setStringField(<fieldTag>, <new value>)
- 2.8.18 setMStringField(<fieldTag>, <new value>)
- 2.8.19 setRawDataField(<fieldTag>, <new value>)
- 2.8.20 setNumField(<group handle>, <entry>, <fieldTag>, <new value>)
- 2.8.21 setDateField(<group handle>, <entry>, <fieldTag>, <format>, <new value>)
- 2.8.22 setStringField(<group handle>, <entry>, <fieldTag>, <new value>)
- 2.8.23 setMStringField(<group handle>, <entry>, <fieldTag>, <new value>)
- 2.8.24 setRawDataField(<group handle>, <entry>, <fieldTag>, <new value>)
- 2.8.25 swapFields(<fieldTag1>, <fieldTag2>)
- 2.8.26 swapFields(<group handle field 1>, <entry field 1>, <fieldTag1>, <fieldTag2>)
- 2.8.27 swapFields(<group handle field 1>, <entry field 1>, <fieldTag1>, <group handle field 2>, <entry field 2>, <fieldTag2>)
- 2.9 Additional Date operations
- 2.10 Create date from current date or using passed arguments.
- 2.11 Convert from date to string
- 2.12 Get part of the date - year, month, day, etc.
- 2.12.1 getYear(<date handle>)
- 2.12.2 getMonth(<date handle>)
- 2.12.3 getWeek(<date handle>)
- 2.12.4 getDay(<date handle>)
- 2.12.5 getHour(<date handle>)
- 2.12.6 getMinutes(<date handle>)
- 2.12.7 getSec(<date handle>)
- 2.12.8 getMSec(<date handle>)
- 2.12.9 getNSec(<date handle>)
- 2.13 Set date part - year, month, day, etc.
- 2.13.1 setYear(<date handle>, <new val>)
- 2.13.2 setMonth(<date handle>, <new val>)
- 2.13.3 setWeek(<date handle>, <new val>)
- 2.13.4 setDay(<date handle>, <new val>)
- 2.13.5 setHour(<date handle>, <new val>)
- 2.13.6 setMinutes(<date handle>, <new val>)
- 2.13.7 setSec(<date handle>, <new val>)
- 2.13.8 setMSec(<date handle>, <new val>)
- 2.13.9 setNSec(<date handle>, <new val>)
- 2.14 Change date part with automatic date recalculation
- 2.14.1 changeYear(<date handle>, <new val>)
- 2.14.2 changeMonth(<date handle>, <new val>)
- 2.14.3 changeDay(<date handle>, <new val>)
- 2.14.4 changeHour(<date handle>, <new val>)
- 2.14.5 changeMinutes(<date handle>, <new val>)
- 2.14.6 changeSec(<date handle>, <new val>)
- 2.14.7 changeMSec(<date handle>, <new val>)
- 2.14.8 changeNSec(<date handle>, <new val>)
- 2.15 Routing functions
- 2.15.1 getSourceClientId()
- 2.15.2 getSourceSessionId()
- 2.15.3 getSourceSessionQualifier()
- 2.15.4 getSessionParser(<sessionName>)
- 2.15.5 getSessionParser(<senderCompID>, <targetCompID>)
- 2.15.6 getSessionParser(<senderCompId>, <targetCompId>, <sessionQualifier>)
- 2.15.7 isSessionActive(<Session Name>)
- 2.15.8 convert(<source protocol>, <target protocol>)
- 2.15.9 transform(<target protocol>, <target message type>)
- 2.15.10 getMsgBySeqNum(<SenderCompId>, <TargetCompId> , <SeqNum>)
- 2.15.11 getMsgBySeqNum(<SenderCompId>, <TargetCompId>, <SessionQualifier>, <SeqNum>)
- 2.15.12 send(<SenderCompID>, <TargetCompID>)
- 2.15.13 send(<SenderCompID>, <TargetCompID>,<SessionQualifier>)
- 2.15.14 send(<session source identifier>)
- 2.15.15 handler(<handler name>, <array of additional parameters>)
- 2.15.16 processNetStatusRequest()
- 2.15.17 createNotification (<category>, <reason>)
- 2.15.18 strategySend (<strategyName>)
- 2.15.19 strategyReject (<historyName>, <createBusinessRejectIfFailed>)
- 2.15.20 serializeMessage()
- 2.15.21 serializeMessage(<tagDelimiter>)
- 2.15.22 parseMessage(<msg>)
- 2.15.23 parseMessage(<msg>, <version>)
- 2.16 Error Handling Functions
- 2.16.1 getErrorCode()
- 2.16.2 getErrorText()
- 2.17 History functions
- 2.17.1 saveToHistory (<historyName>, <keyFields>, <commonFields>, <expireDateTime>)
- 2.17.2 updateHistory (<historyName>, <keyFields>, <commonFields>, <expireDateTime>)
- 2.17.3 saveOrUpdate(<historyName>, <keyFields>, <commonFields>, <expireDateTime>)
- 2.17.4 getFromHistory (<historyName>, <keyFields>, <columnName>)
- 2.17.5 getRecordFromHistory (<historyName>, <keyFields>)
- 2.17.6 removeRecordFromHistory (<historyName>, <keyFields>)
- 2.17.7 removeRecordFromHistoryByCompositeKey (<historyName>, <keyFields>)
- 2.18 Direct Database API functions
- 2.18.1 executeSQL(<text>)
- 2.19 Security functions
- 2.19.1 decryptString(<text>)
- 2.19.2 hashString(<text>)
- 2.20 Sequence numbers handling functions
- 2.20.1 setSessionSeqNums(<text>)
- 2.21 Predefined FIX date formats