HI,
I have upgraded from OH 3.4.4 to OH 4.0.1 and immediately I found all my JavaScript transformation stops working. I found some discussion in this post and tried to modify my script/things configuration however still can’t make it work hence need some advice here.
Below is how it looks like in Things:
However the transformation doesn’t work and I see lots of errors like this:
2023-08-12 07:57:34.825 [WARN ] [s.internal.SingleValueTransformation] - couldn't transform response because transformationService of type 'SCRIPT' is unavailable
I have JavaScript scripting and JavaScript Scripting (Nashorn) installed.
What is the right approach to migrate JavaScript transformation to OH 4? If JavaScript is not going to be supported is there any other/better way to implement the transformation?
Thank you in advance!
Read the thread you mentioned till the end.
It looks like you just used what was marked as the solution.
There was a change in an other Milestone release afterwards so the syntax changed.
SCRIPT transformation syntax has changed in OH4. Instead of writing SCRIPT:graaljs:yourtransformation.script, you would write: JS:yourtransformation.js and note the file name should be changed from .script to .js
Hi @jimtng : thank you for your reply! I have restarted multiple times and eventually it started to work. The start up of OH 4 becomes very indeterministic, I have seem strange issues like things configurations not loaded randomly during startup, clearing cache doesn’t help. Thank you very much for helping with the transformer issue!