Table of Contents |
---|
JavaScript as a condition or action of
...
Business Rule
FIXEdge allows using JavaScript as a condition or action on the Business Layer.
In order to apply the JS condition/action to the FIX message, you should use the Script element.
Code Block | ||||
---|---|---|---|---|
| ||||
<Condition> <Script Language="JavaScript" FileName ="testScript.js"/> </Condition> <Action> <MoveField SourceField="32" TargetField="48" /> </Action> | ||||
Info | ||||
JS condition can be combined with other conditions in the usual way. |
In order to use the script as a condition/action, it should return the value. In JS every expression returns the value and the result of the script is a value returned by the last run expression. So the boolean value can be returned in such a way:
...
Note |
---|
Do not use JS elements that modify the message (for example setStringField or transform) as a condition, because it will lead to an error that interrupts the script. |
JavaScript reference to BL rule
FIXEdge provides users with the ability to reference parameters defined in the Condition or Action section of the BL rule from inside the script since the FIXEdge 6.14.0 release.
...