Skip to main content

D – JavaScript in EA Script Manager

Back to index

Note: EA Script Manager supports JavaScript (not to be confused with Java). In this test, Kernaro's Script Agent generated JavaScript code – Python was not executed.


D1 · What was tested

Scenario: List all elements in a given package that have an empty Notes field.

Approach:

  1. Request sent to Kernaro Chat with GUID scope
  2. Kernaro Script Agent generated JavaScript code
  3. Code was manually copied to EA Script Manager and executed
  4. Errors were identified and resolved with Kernaro's assistance

Python Execution was NOT tested. Although Python 3.12 was configured and validated in Kernaro Settings, the Script Agent chose JavaScript for this use case. Python execution via Kernaro remains to be evaluated.


D2 · Script generation via Chat

Query sent to Kernaro:

GUID ={8208DC8D-B283-10B3-86D0-E8D891DD8861}. Using Python,
list all elements in the root package defined by GUID
that have empty Notes field. Show element name and type.

Result: Kernaro generated JavaScript (not Python as requested). The code was presented in chat with instructions to run it manually via Specialize → Scripting.

Finding D2-1 – Language instruction not respected:
When explicitly asked for Python, the Script Agent generated JavaScript. This may be intentional (JavaScript is natively supported in EA) but conflicts with the explicit user instruction.


D3 · Enumerator hallucination

Kernaro generated code using new Enumerator() – a syntax from Internet Explorer / WSH environments that is not supported in EA's JavaScript engine.

Generated (broken):

var elementEnumerator = new Enumerator(thePackage.Elements); // ❌
while (!elementEnumerator.atEnd()) {
var el = elementEnumerator.item();
// ...
elementEnumerator.moveNext();
}

EA error: Enumerator is not defined

Kernaro was informed via chat with the error message text. After correction request, the agent regenerated the same broken pattern. The fix was applied manually.

Correct EA JavaScript syntax:

for (var i = 0; i < thePackage.Elements.Count; i++) {
var el = thePackage.Elements.GetAt(i); // ✅
}

for (var j = 0; j < thePackage.Packages.Count; j++) {
CollectEmptyNotes(thePackage.Packages.GetAt(j), results); // ✅
}

Finding D3-1: Kernaro repeatedly regenerates new Enumerator() even after explicit correction. This is a training data issue – EA JavaScript uses COM collections with .Count / .GetAt(), not WSH Enumerator objects.


D4 · Debugging with Kernaro assistance

Although Kernaro could not automatically execute the script or directly fix the error after seeing a screenshot (clipboard image was rejected – see E – Findings, the workflow was:

  1. Run script in EA → error appears in Debug output
  2. Copy error text to Kernaro Chat
  3. Kernaro provides corrected code
  4. Manually replace in Script Manager and re-run

This iterative approach worked and is a valid workflow for script development.


D5 · Successful output

After applying the correct EA JavaScript syntax, the script produced the expected result:

Elements With Empty Notes
Root Package: Starter Use Case Model
=====================================================
Element Name | Element Type
----------------------------------------------|--------------
Customer | Actor
Customer1 | Actor
Customer2 | Actor
-----------------------------------------------------
Total elements with empty Notes: 3

D6 · Script Manager vs Kernaro Agent – clarification

EA Script ManagerKernaro Agent
ExecutionManual (user clicks Run)Automatic (event trigger)
StorageScript Library in modelKernaro internal
LanguageJavaScript / VBScriptLLM-generated, runs via Kernaro
Write to modelVia EA API directlyVia approved Kernaro tools
Use caseBatch, on-demandGovernance, quality gates

Scripts saved to Script Library are independent from Kernaro Agents. They serve different purposes.


Back to index | → E – Findings


Images

[IMG-01]

img/01-javascripts.png

[IMG-02]

img/02-javascripts.png

[IMG-03]

img/03-javascripts.png

[IMG-04]

img/04-javascripts.png

[IMG-05]

img/05-javascripts.png

[IMG-06]

img/06-javascripts.png

[IMG-07]

img/07-javascripts.png

[IMG-08]

img/08-javascripts.png

[IMG-09]

img/09-javascripts.png

[IMG-10]

img/10-javascripts.png

[IMG-11]

img/11-javascripts.png

[IMG-12]

img/12-CLAUDE-Dashboard.png

[IMG-13]

img/13-CLAUDE-Dashboard.png

[IMG-14]

img/14-javascripts.png