# Experimental Next-Gen Rules Engine Documentation 4 of : Writing Scripts

**URL:** <https://community.openhab.org/t/experimental-next-gen-rules-engine-documentation-4-of-writing-scripts/55963>\
**Category:** Documentation\
**Tags:** jsr223, ngre\
**Created:** [November 6, 2018, 7:47pm UTC](https://community.openhab.org/t/experimental-next-gen-rules-engine-documentation-4-of-writing-scripts/55963 "2018-11-06T19:47:28Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [November 7, 2018, 3:18pm UTC](https://community.openhab.org/t/experimental-next-gen-rules-engine-documentation-4-of-writing-scripts/55963/4 "2018-11-07T15:18:11Z")

</div>

> [@lewie](#):
>
> Added some “Call an Action” content. What do you mean with: “third party installed Actions”. Self installed or self written Actions?

I mean calling Actions that need to be installed and not the ones that come with OH, for example, `publish` from the MQTT Action.

There may not be any difference but I had the comment there to remind myself to test more than just the built in Actions.

> [@lewie](#):
>
> `getStateAs` should work, like all other public Functions of `org.eclipse.smarthome.core.items.GenericItem` .

The problem I had was trying to figure out how to pass the Class to the method. In Rules DSL I just need to pass OnOffType, for example. I was apparently having a slow brain day because it took me forever to remember there should be a .class on OnOffType.

I can already see that dealing with the differences between Java Types and JavaScript Types is going to be a problem, particularly for non-technical users.

Thanks for the edit and the info!

---

_[View the full topic](https://community.openhab.org/t/experimental-next-gen-rules-engine-documentation-4-of-writing-scripts/55963)._
