Creating a Counter Strange Behavour
I just wanted to share this as I have struggled with this for about a day now.
If anybody has a better way of doing this then please let me know.
I wanted to create a counter that increments a property value every time a Boolean value on a different property changes.
I am using a subscription to do this.
So this is what I had.

I then create an additional property that will keep the values.

I created the subscription on data change as such

I went in circles trying to figure out why its not working. then I had a look at the application logs.

Throwable Error Executing Event Handler for event Type.Thing:Entity.Quality_demo_data:Event.DataChange:Property.sorting-quality-demo_PLC1_conveyorOn : Execution error in service script [Quality_demo_data Event.DataChange:Property.sorting-quality-demo_PLC1_conveyorOn] : ReferenceError: "one" is not defined.
This made no sense to me at all so I tried with track two and three. And got similar errors.
So,
I thought could it be the name of the parameter?
I created another parameter called track1 and did the same thing.


And now its working.
I don't know if its a bug or just my level of jsp skills but there you have it.

