BBx-Kitchen / bbj-language-server

BBj Language Server
MIT License
6 stars 6 forks source link

The web.bbj launcher doesn't ensure the app is enabled for BUI/DWC before launching #119

Closed ndecker-basis closed 1 week ago

ndecker-basis commented 10 months ago

Situation: You have an app that's already registered for BUI, but not enabled for the DWC. You then edit it in VSCode and try to launch it in DWC. You end up with this error:

!ERROR=60  (Cannot invoke "String.length()" because "this.input" is null)
[44] BBjAPI().getThinClient().browse(url!)

That's because the app was enabled for BUI, but not for the DWC and so the DWC URL is null:

>? app!.getBuiUrl(0)
http://nick-mbp.local:8888/apps/BBjMessageBox
>? app!.getDwcUrl(0)
null

To prevent this error, the web.bbj launcher program should explicitly ensure that the app is enabled for DWC before launching it in DWC. This can be accomplished by adding the last line of code below, just before the app is committed with the updated parameters:

app!.setString(app!.NAME, name!)
app!.setString(app!.PROGRAM, programme!)
app!.setString(app!.WORKING_DIRECTORY , wd!)
if (isDWC!) then app!.setBoolean(app!.DWC_ENABLED, 1)

When that line is added to the web.bbj launcher program, then the error 60 is avoided.

StephanWald commented 1 week ago

verified, OBE