My first module

Hello, thank you very much for accepting me in this community.

I share my experience in creating my first module for Niagara Optimizer Supervisor Version 4.14.0.162.9.

Thanks to Charles_Johnson I saw that in the page https://learninghub.lynxspring.com is where they have free courses (current videos). I enrolled in the niagara-developer-series course which is where they teach about module creation.

I followed the instructions to the letter, but when I wanted to open my module I got an error, the error was as follows:

β€œjava.lang.ClassCastException: javax.baja.sys.BString cannot be cast to javax.baja.sys.BComplex
at javax.baja.io.ValueDocDecoder.parseSlots(ValueDocDecoder.java:568)
at javax.baja.io.ValueDocDecoder.parseSlot(ValueDocDecoder.java:830)
at javax.baja.io.ValueDocDecoder.parseSlots(ValueDocDecoder.java:568)
at javax.baja.io.ValueDocDecoder.parseSlot(ValueDocDecoder.java:830)
at javax.baja.io.ValueDocDecoder.decode(ValueDocDecoder.java:292)
at javax.baja.io.ValueDocDecoder$BogDecoderPlugin.decodeDocument(ValueDocDecoder.java:1321)
at javax.baja.io.ValueDocDecoder.decodeDocument(ValueDocDecoder.java:275)
at javax.baja.io.ValueDocDecoder.decodeDocument(ValueDocDecoder.java:264)
at com.tridium.sys.module.BModulePaletteNode.(BModulePaletteNode.java:144)
at com.tridium.sys.module.BModulePaletteNode.make(BModulePaletteNode.java:80)
at javax.baja.sys.BModule.initNavChildren(BModule.java:792)
at javax.baja.sys.BModule.getNavChild(BModule.java:665)
at com.tridium.workbench.sidebars.BPaletteSideBar.doUpdateTree(BPaletteSideBar.java:252)
at com.tridium.workbench.sidebars.BPaletteSideBar$Open.doInvoke(BPaletteSideBar.java:339)
at javax.baja.ui.Command.doInvoke(Command.java:313)
at javax.baja.ui.Command.invoke(Command.java:283)
at javax.baja.ui.BButton.doInvokeAction(BButton.java:148)
at javax.baja.ui.BAbstractButton.mouseReleased(BAbstractButton.java:541)
at javax.baja.ui.BWidget.fireMouseEvent(BWidget.java:1369)”

I solved the error with the help of claude ia, I only had to change the part of module.palette this was the change that was made:

{

Use the traducotr deepl, in case you find some incosistencia in the previous text.

Can we see the details of the screenshot?

I went back to check the code, and I noticed that I had made a mistake in one letter, hahahaha, an apology. I had put myFirstComponent instead of MyFirstComponent, as I was only watching the video and after finishing the practice I got confused.

1 Like

I have a doubt, what would be the difference of the structure proposed for the module.palette in the video 5 against the structure that calude.ia recommended me?

For example I am creating a new module and this is my structure for the module.palette


β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”-

The differences don’t really mean too much here. If all components are from the same module, you only need the reference once until you change the module. Some people keep the module m= throughout their whole palette, and that’s fine. There are a few ways in which it could work. If you built it in claude and you were able to get the palette correct, then it shows you that both ways would work.

1 Like