Experimental Next-Gen Rules Engine Documentation 1 of : Introduction

ngre
Tags: #<Tag:0x00007f1e6baab190>
(Angelos) #21

really ???

0 Likes

(Greg) #22

I assumed I could take what is there and modify it and put it in default.rules.

0 Likes

(Angelos) #23

I assumed that you spend 2-5 minutes reading the info that others spend hours to make

1 Like

(Greg) #24

Reading is one thing. Comprehending is another.

0 Likes

(Angelos) #25

The text is very clear and precise
You didn’t ask a clarification on the answer. You asked a question that had been already answered in the text.
Drop it :stuck_out_tongue:

0 Likes

(Rich Koshak) #26

The NGRE is completely separate and different from Rules DSL. There is pretty much nothing in common between the two. You cannot just copy the code from NGRE into a .rules file. The code is written in a completely different language.

NGRE isn’t just a new way to write old style Rules DSL Rules, it is a wholly new and separate way to write Rules.

0 Likes

(Mick Smothers) #27

Has anyone else had their NGRE (via Paper UI) rules stop working with the last two snapshots? Just curious before I start digging around to see if I broke something. I haven’t changed the rules, just updated my Docker image to the latest snapshots.

Thanks!

Update: I “edited” each rule (changed nothing) and re-saved it and it seems to be working now. I’ll keep an eye on it and make sure things are working correctly over the next day or two.

0 Likes

(Scott Rushworth) #28

Hey @rlkoshak, good news… I’ve got Jython and Groovy scripted actions and conditions working! I’m holding up putting in the PR until ESH is migrated.

3 Likes

(Rich Koshak) #29

Great news. Will the PR also contain what ever is requires so we can select the other languages when creating the Action through PaperUI? Right now the drop down list only has JavaScript.

Presumably Jython and Groovy will need to be installed before those languages can work, or will the PR also include that? It seems reasonable to me that they ship with OH by default from an NGRE perspective. But I don’t know the full implications of doing that. I suspect the reason JavaScript “ships” is because Nashorn is part of the JRE by default.

I’m sorry I missed this comment earlier.

If you have a “before” of the JSONDB file and an “after” of the JSONDB file you should see some difference in the files (format, different entries, something like that). That should tell you what changed.

It’s the fun of using an experimental project. :slight_smile:

0 Likes

(Scott Rushworth) #30

Like this :wink:

Ignore Xtend… that’s a WIP.

They will need to be manually installed. There is not any way, currently, to restrict the list to languages supported by the system.

I stongly agree. Automating installation of the languages will come in another PR. If I do it, it may take a while, but I think JSR223 bundles are important to have.

You got it… it’s already in there!

2 Likes

(Mick Smothers) #31

Yep - good point, Rick. However I’ve found that I need to do this on every OpenHAB restart, even when I don’t update the code, so I suspect more it is something on initialization that is not working right. If I get some time I’ll try turning up logging and see if I can determine what is going on.

Thanks for the hints!

0 Likes

(Tobias) #32

I thought to invest some time and to convert some of my rules to NGRE. Will I be able to copy the rules to any new OH installation (i.e. does this automation_rules.json file work as a backup)?

And will that file be read from upcoming versions of OH, say OH 3.x using NGRE as primary rule engine?

0 Likes

(David Graeff) #33

It is very likely at the moment that NGRE will be the primary rule engine. There are no changes to the syntax expected right now.

Please be aware that we have one serious bug in NGRE which prevents rules to get initialized on startup. That is expected to be fixed for OH 2.5 release.

0 Likes

(Scott Rushworth) #34

In addition to what David said, there is also a change that needs to be made to the JSON rules file after upgrading to 2.5.

0 Likes