Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 24.0
Div
Classe2e-refDiv

Otp
Floatingfalse

Rp

The E2E Bridge offers the JavaScript adapter to use JavaScript with composite services. This is useful for e.g. dynamic evaluation of expressions at runtime.

Also, you can use JavaScript as a JSON pre-processor instead of the JSON parser.
JSON requests are frequently very dynamic and structurally complex. To use the JSON parser, you would have to model the JSON structure as UML class diagrams, which proved to be very error-prone. It turned out to be much easier using JavaScript to parse the message and then also JavaScript to analyze the resulting object to get all relevant data (which is frequently a small subset of the overall message).

Multiexcerpt include
MultiExcerptNamehelloJSWorld
nopaneltrue
PageWithExcerptINTERNAL:_examples_BRIDGE

Using the JavaScript Adapter with a Static Script

To call a JavaScript add an action having the stereotype <<JavaScriptAdapter>>. You can assign the stereotype manually or use the E2E Action Wizard.

Figure: Action with JavaScript

Image Modified

Add the JavaScript to the tagged value script. You can use the Action Script Editor to do that. All variables used in the script must have a corresponding object flow.

Using the JavaScript Adapter with a Dynamic Script

To call a dynamic JavaScript, add an input object of type JavaScript to the action node (e.g. script in the example below). This object should contain the custom JavaScript.

Figure: Action with Dynamic JavaScript

Image Modified

Note
iconfalse

If input parameters are modified inside the script, the modifications will be visible outside - even if they are not defined as output.

Panel
titleOn this Page:
Table of Contents
Panel
titleRelated Pages: