Skip to content

Commit 388600e

Browse files
authored
Integrate new BPL Editor (#1699)
1 parent 66091eb commit 388600e

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

src/providers/LowCodeEditorProvider.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { currentFile, notIsfs, openLowCodeEditors, outputChannel } from "../util
99
export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
1010
private readonly _rule: string = "/ui/interop/rule-editor";
1111
private readonly _dtl: string = "/ui/interop/dtl-editor";
12+
private readonly _bpl: string = "/ui/interop/bpl-editor";
1213

1314
private _errorMessage(detail: string) {
1415
return vscode.window
@@ -51,10 +52,11 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
5152
// Check that the class exists on the server and is a rule or DTL class
5253
let webApp: string;
5354
const queryData = await api.actionQuery(
54-
"SELECT $LENGTH(rule.Name) AS Rule, $LENGTH(dtl.Name) AS DTL " +
55+
"SELECT $LENGTH(rule.Name) AS Rule, $LENGTH(dtl.Name) AS DTL, $LENGTH(bpl.Name) AS BPL " +
5556
"FROM %Dictionary.ClassDefinition AS dcd " +
5657
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.Rule.Definition') AS rule ON dcd.Name = rule.Name " +
5758
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.DataTransformDTL') AS dtl ON dcd.Name = dtl.Name " +
59+
"LEFT OUTER JOIN %Dictionary.ClassDefinition_SubclassOf('Ens.BusinessProcessBPL') AS bpl ON dcd.Name = bpl.Name " +
5860
"WHERE dcd.Name = ?",
5961
[className]
6062
);
@@ -70,11 +72,20 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
7072
);
7173
}
7274
webApp = this._dtl;
75+
} else if (queryData.result.content[0].BPL) {
76+
if (lt(api.config.serverVersion, "2026.1.0")) {
77+
return this._errorMessage(
78+
"Opening the BPL editor in VS Code requires InterSystems IRIS version 2026.1 or above."
79+
);
80+
}
81+
webApp = this._bpl;
7382
} else {
74-
// Class exists but is not a rule or DTL class
75-
return this._errorMessage(`${className} is neither a rule definition class nor a DTL transformation class.`);
83+
// Class exists but is not a rule, BPL, or DTL class
84+
return this._errorMessage(
85+
`${className} is not a rule definition, DTL transformation, or BPL business process class.`
86+
);
7687
}
77-
sendLowCodeTelemetryEvent(webApp == this._rule ? "rule" : "dtl", document.uri.scheme);
88+
sendLowCodeTelemetryEvent(webApp == this._rule ? "rule" : webApp == this._bpl ? "bpl" : "dtl", document.uri.scheme);
7889

7990
// Add this document to the Set of open low-code editors
8091
const documentUriString = document.uri.toString();
@@ -103,9 +114,12 @@ export class LowCodeEditorProvider implements vscode.CustomTextEditorProvider {
103114
</head>
104115
<body>
105116
<div id="content">
106-
<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" : ""}&${
107-
webApp == this._rule ? "rule" : "DTL"
108-
}=${className}" width="100%" height="100%" frameborder="0"></iframe>
117+
<iframe id="editor" title="Low-Code Editor" src="${targetOrigin}${api.config.pathPrefix}${webApp}/index.html?${[
118+
`$NAMESPACE=${api.ns}`,
119+
"VSCODE=1",
120+
...(!vscode.workspace.fs.isWritableFileSystem(document.uri.scheme) ? ["READONLY=1"] : []),
121+
`${webApp == this._rule ? "rule" : webApp == this._bpl ? "BP" : "DTL"}=${className}`,
122+
].join("&")}" width="100%" height="100%" frameborder="0"></iframe>
109123
</div>
110124
<script>
111125
(function() {

src/providers/ObjectScriptCodeLensProvider.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -260,20 +260,16 @@ export class ObjectScriptCodeLensProvider implements vscode.CodeLensProvider {
260260
case "xdata": {
261261
if (api.active) {
262262
let cmd: vscode.Command;
263-
if (symbol.name == "BPL" && superclasses.includes("Ens.BusinessProcessBPL")) {
264-
cmd = {
265-
title: "Open Low-Code Editor in Browser",
266-
command: "vscode-objectscript.openPathInBrowser",
267-
tooltip: "Open low-code editor in an external browser",
268-
arguments: [`/EnsPortal.BPLEditor.zen?BP=${className}.BPL`, document.uri],
269-
};
270-
} else if (
263+
if (
271264
(symbol.name == "RuleDefinition" &&
272265
superclasses.includes("Ens.Rule.Definition") &&
273266
gte(api.config.serverVersion, "2023.1.0")) ||
274267
(symbol.name == "DTL" &&
275268
superclasses.includes("Ens.DataTransformDTL") &&
276-
gte(api.config.serverVersion, "2025.1.0"))
269+
gte(api.config.serverVersion, "2025.1.0")) ||
270+
(symbol.name == "BPL" &&
271+
superclasses.includes("Ens.BusinessProcessBPL") &&
272+
gte(api.config.serverVersion, "2026.1.0"))
277273
) {
278274
cmd = {
279275
title: "Reopen in Low-Code Editor",

0 commit comments

Comments
 (0)