Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate GraalVM JS to script mediator #2196

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Conversation

arunans23
Copy link
Member

@arunans23 arunans23 commented Jul 8, 2024

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

$subject
This will replace existing rhinoJS and be an alternative to deprecated nashornJs.

Note: E4X is deprecated and it is not supported by GraalVM JS engine. To overcome this when using GraalJS, DOMparser can be used to parse XML strings rather than using XML objects. But then the users who are using
script mediator with the new GraalVM JS engine will not be able to use XML objects in javascript but they will be able to use setPayloadXML and getPayloadXML methods in script mediator by using string representations of XML.

To maintain backward compatibility, the existing rhinoJs engine is kept and it can be used by setting the language as "rhinoJs" in the script mediator syntax.

Example

<script language="rhinoJs">
     var bNode = mc.getPayloadXML().b;
</script>

Default "js" language will be utilizing the graalVM JS engine.

Example

<script language="js">
     var rno = mc.getPayloadXML().toString(); 
      var st1 = mc.getEnvelope().getBody().getFirstElement().getText();
     mc.getEnvelope().getBody().getFirstElement().setText(st1 * 2);
</script>

This will replace existing rhinoJS and be an alternative to deprecated nashornJs
rosensilva
rosensilva previously approved these changes Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants