Conversation
n1kPLV
marked this pull request as draft
June 22, 2026 08:36
…ace json generation
There was a problem hiding this comment.
🟡 Changes recommended
Several confirmed runtime/behavior issues in the new JSON processors (null handling, EMF value serialization, and unsafe cardinality parsing) need to be fixed before the feature can be relied upon.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds new KiCool systems/processors to export simulation traces and SCCharts models as JSON (via Gson), and wires them into the respective system/processor providers; also slightly improves CLI error output context.
Changes:
- Introduces a trace-to-JSON processor (
TraceToJSON) plus supporting JSON DTOs and a KiCo system. - Introduces an SCCharts-to-JSON processor (
SCTXToJSON) plus supporting JSON DTOs, KiCo systems, and adds Gson to the SCCharts bundle manifest. - Improves KiCo CLI error output by including the source model path in the “Error(s) in compilation …” line.
File summaries
| File | Description |
|---|---|
| plugins/de.cau.cs.kieler.simulation/system/de.cau.cs.kieler.ktrace.toJson.kico | Adds a KiCo system entry for trace JSON generation. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/trace/ktrace/json/TraceToJSON.xtend | New processor that transforms trace models into JSON via Gson. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/trace/ktrace/json/Trace.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/trace/ktrace/json/Tick.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/trace/ktrace/json/Assignment.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/providers/SimulationSystemProvider.xtend | Registers the new trace-to-JSON KiCo system. |
| plugins/de.cau.cs.kieler.simulation/src/de/cau/cs/kieler/simulation/providers/SimulationProcessorProvider.xtend | Registers the new trace-to-JSON processor. |
| plugins/de.cau.cs.kieler.sccharts/system/de.cau.cs.kieler.sccharts.SCTXToJSON.kico | Adds a KiCo system entry for SCCharts JSON generation. |
| plugins/de.cau.cs.kieler.sccharts/system/de.cau.cs.kieler.sccharts.extended.toJSON.kico | Adds a KiCo system that preprocesses then exports SCCharts JSON. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/providers/SCChartsSystemProvider.xtend | Registers the new SCCharts JSON KiCo systems. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/providers/SCChartsProcessorProvider.xtend | Registers the new SCCharts JSON processor. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/SCTXToJSON.xtend | New processor that transforms SCCharts models into JSON via Gson. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/Action.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/Reference.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/Region.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/State.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/Transition.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/src/de/cau/cs/kieler/sccharts/processors/json/Variable.java | New generated DTO for JSON output. |
| plugins/de.cau.cs.kieler.sccharts/META-INF/MANIFEST.MF | Adds Gson dependency declarations for SCCharts bundle. |
| plugins/de.cau.cs.kieler.kicool/src/de/cau/cs/kieler/kicool/cli/KielerCompilerCLI.xtend | Improves error header output with model context. |
Review details
- Files reviewed: 20/20 changed files
- Comments generated: 6
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+125
to
+131
| transformed.variableID = effect.reference?.valuedObject?.name + effect.reference?.indices?.map [ | ||
| "[" + it.serialize + "]" | ||
| ].join() | ||
| if (transformed.variableID === null) { | ||
| environment.errors.add( | ||
| "Assignment %s has no target variable.".format(effect.serialize, effect.class.name)) | ||
| } |
| transformed.variableID = effect.reference?.valuedObject?.name | ||
| if (transformed.variableID === null) { | ||
| environment.errors.add( | ||
| "Assignment %s has no target variable.".format(effect.serialize, effect.class.name)) |
Comment on lines
+176
to
+179
| JsonArrayValue: | ||
| assignee.elements | ||
| JsonObjectValue: | ||
| assignee.membersMap |
| val transformedRoots = this.sourceModel.traces.map[transformTrace]; | ||
| val fileName = "trace" | ||
|
|
||
| println("Processing Resource " + this.sourceModel.eResource) |
| if (state.reference !== null) { | ||
| // TODO: if the target is in the same file as the referencing statement, this causes the target to be renamed | ||
| // in the renaming step. Not an issue, but weird. | ||
| scopeNames.add(state.reference.target.name.hostcodeSafeName) |
| transformed.initialValue = v.initialValue?.serialize?.toString | ||
| transformed.isInput = isInput | ||
| transformed.isOutput = isOutput | ||
| transformed.cardinalities = v.cardinalities?.map[serialize]?.map[Integer.parseInt(it.toString, 10)] ?: List.of() |
…for declaring a variable to be const.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not ready for merge, only for CI