Javascript usage tips
While Clinical One Cloud Service uses Javascript as a programming language for rules, there are some usage caveats and limitations that you should know before beginning your rules development, especially if you are an experienced Javascript developer.
Rule processing caveats
Follow these guidelines to help your rules process efficiently:
- Use the documented helper functions to reduce your need to loop through repeating instances when performing certain matching and compare operations on data. This improves your rule performance.
- Use generic Javascript functions under ECMAScript 5. For example, you can process an array of elements with filter( ), reduce( ), and so forth to loop through an array for a specific purpose. This can simplify your coding.
Javascript limitations
The following common Javascript and HTML coding operations are not allowed in any rule expressions:
- Console operations
- Print operations
- File operations (such as load( ) and open( ))
- DOM manipulations (such as document and window)
- Display messages (such as alert)
- Interrupting script processing (such as exit( ) and quit( ))
- Debugger commands
- Looping operations (such as for and while)
- Words internally restricted by the Rules engine:
- Expression
- Window
There are also some reserved words that are typically not allowed in JavaScript. For a complete list, see JavaScript Reserved Words.
Parent topic: Before you begin your rules development