Can I use JavaScript control flow inside my JavascriptProcessor scripts?
Yes. You write JavaScript in the normal way, and operate on the oa_data passed in which also doubles as the result object. Your condition expressions will typically involve data extracted from each incoming record. It can also involve variables from a separate properties file or command line which are specific to this executing instance of the adaptor: these are evaluated when the adaptor is loaded and thereafter behave as literal string values. As a design guideline we very strongly advocate avoiding writing long pieces of JavaScript (a screenful is long). Instead break down your JavaScript into small blocks of defined functionality and place each in a separate ScriptProcessor. This makes it much easier to unit-test each piece of logic (we plan to provide some practical help with this at the component level in the future) according to expected inputs and outputs. It also allows you to take advantage of the discard and exception routing support of OpenAdaptor. Note that hosting it in m