Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/providers/LowCodeEditorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { currentFile, notIsfs, openLowCodeEditors, outputChannel } from "../util
export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
private readonly _rule: string = "/ui/interop/rule-editor";
private readonly _dtl: string = "/ui/interop/dtl-editor";
private readonly _bpl: string = "/ui/interop/bpl-editor";

private _errorMessage(detail: string) {
return vscode.window
Expand Down Expand Up @@ -51,10 +52,11 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
// Check that the class exists on the server and is a rule or DTL class
let webApp: string;
const queryData = await api.actionQuery(
"SELECT $LENGTH(rule.Name) AS Rule, $LENGTH(dtl.Name) AS DTL " +
"SELECT $LENGTH(rule.Name) AS Rule, $LENGTH(dtl.Name) AS DTL, $LENGTH(bpl.Name) AS BPL " +
"FROM %Dictionary.ClassDefinition AS dcd " +
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.Rule.Definition') AS rule ON dcd.Name = rule.Name " +
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.DataTransformDTL') AS dtl ON dcd.Name = dtl.Name " +
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.BusinessProcessBPL') AS bpl ON dcd.Name = bpl.Name " +
"WHERE dcd.Name = ?",
[className]
);
Expand All @@ -70,11 +72,20 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
);
}
webApp = this._dtl;
} else if (queryData.result.content[0].BPL) {
if (lt(api.config.serverVersion, "2026.1.0")) {
return this._errorMessage(
"Opening the BPL editor in VS Code requires InterSystems IRIS version 2026.1 or above."
);
}
webApp = this._bpl;
} else {
// Class exists but is not a rule or DTL class
return this._errorMessage(`${className} is neither a rule definition class nor a DTL transformation class.`);
// Class exists but is not a rule, BPL, or DTL class
return this._errorMessage(
`${className} is not a rule definition, DTL transformation, or BPL business process class.`
);
}
sendLowCodeTelemetryEvent(webApp == this._rule ? "rule" : "dtl", document.uri.scheme);
sendLowCodeTelemetryEvent(webApp == this._rule ? "rule" : webApp == this._bpl ? "bpl" : "dtl", document.uri.scheme);

// Add this document to the Set of open low-code editors
const documentUriString = document.uri.toString();
Expand Down Expand Up @@ -104,7 +115,7 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
<body>
<div id="content">
<iframe id="editor" title="Low-Code Editor" src="${targetOrigin}${api.config.pathPrefix}${webApp}/index.html?$NAMESPACE=${api.config.ns.toUpperCase()}&VSCODE=1${!vscode.workspace.fs.isWritableFileSystem(document.uri.scheme) ? "&READONLY=1" : ""}&${
webApp == this._rule ? "rule" : "DTL"
webApp == this._rule ? "rule" : webApp == this._bpl ? "BP" : "DTL"
}=${className}" width="100%" height="100%" frameborder="0"></iframe>
</div>
<script>
Expand Down
14 changes: 5 additions & 9 deletions src/providers/ObjectScriptCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,16 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
case "xdata": {
if (api.active) {
let cmd: vscode.Command;
if (symbol.name == "BPL" && superclasses.includes("Ens.BusinessProcessBPL")) {
cmd = {
title: "Open Low-Code Editor in Browser",
command: "vscode-objectscript.openPathInBrowser",
tooltip: "Open low-code editor in an external browser",
arguments: [`/EnsPortal.BPLEditor.zen?BP=${className}.BPL`, document.uri],
};
} else if (
if (
(symbol.name == "RuleDefinition" &&
superclasses.includes("Ens.Rule.Definition") &&
gte(api.config.serverVersion, "2023.1.0")) ||
(symbol.name == "DTL" &&
superclasses.includes("Ens.DataTransformDTL") &&
gte(api.config.serverVersion, "2025.1.0"))
gte(api.config.serverVersion, "2025.1.0")) ||
(symbol.name == "BPL" &&
superclasses.includes("Ens.BusinessProcessBPL") &&
gte(api.config.serverVersion, "2026.1.0"))
) {
cmd = {
title: "Reopen in Low-Code Editor",
Expand Down