# 7.9.2 SDK Expression Functions Broken

**URL:** <https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481>\
**Category:** Module Development\
**Tags:** sdk, ignition79\
**Created:** [June 8, 2017, 8:19pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481 "2017-06-08T20:19:07Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [June 8, 2017, 8:19pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/1 "2017-06-08T20:19:07Z")

</div>

I’ve defined an expression function in one of my modules as:

```
public static class GetStackTraceFunction extends AbstractFunction{

    @Override
    protected String getFunctionDisplayName() {
        return "getStackTrace";
    }

    @Override
    public String getArgDocString() {
        return "";
    }

    @Override
    public Class<?> getType() {
        return String.class;
    }

    @Override
    public QualifiedValue execute(Expression[] expressions) throws ExpressionException {
        return new BasicQualifiedValue(Thread.currentThread().getStackTrace()[0].toString());
    }

}

```

I’m adding it to the client/designer scope by calling the following in my hook classes:

```
@Override
public void configureFunctionFactory(ExpressionFunctionManager factory) {
    super.configureFunctionFactory(factory);
    factory.addFunction("getUUID","Strings", new AbstractSystemUtils.GetUUIDFunction());
    factory.addFunction("getStackTrace","Strings", new AbstractSystemUtils.GetStackTraceFunction());
}

```

Now since the upgrade to 7.9.2+, my function can no longer be found from either the designer or client. Any info on this?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2017, 8:53pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/2 "2017-06-08T20:53:24Z")

</div>

Are you sure your client and designer hooks are being loaded and that `configureFunctionFactory` is being called in each scope?

There haven’t been any intentional changes that would break your module.

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [June 8, 2017, 9:46pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/3 "2017-06-08T21:46:17Z")

</div>

Yup it’s in both. I also had to the sdk version from 7.9.1 to 7.9.2 or the client/designer would hang on startup… I’ve got scripts and functions in other modules that didn’t seem to be affected.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 8, 2017, 9:55pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/4 "2017-06-08T21:55:52Z")

</div>

Something sounds very wrong with what you’re saying.

The SDK is just an API you compile against. None of it actually goes into your module or should effect the implementation. If anything, changing Ignition versions would make a difference, but not SDK versions (unless we changed an API in a way we shouldn’t have).

Do you have any logs, both from the gateway and from enabling the Java console and starting a client/designer?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 9, 2017, 2:54pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/5 "2017-06-09T14:54:57Z")

</div>

Alright, so the reason your module hangs on 7.9.1 is because of this error:

```auto
Exception in thread "Designer-Startup" java.lang.NoSuchMethodError: com.inductiveautomation.ignition.client.script.ClientTagUtilities.<init>(Lcom/inductiveautomation/ignition/client/model/ClientContext;)V
	at com.tamakicontrol.modules.scripting.client.scripts.ClientTagUtils.initialize(ClientTagUtils.java:31)
	at com.tamakicontrol.modules.scripting.designer.DesignerHook.startup(DesignerHook.java:34)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$LoadedModule.startup(IgnitionDesigner.java:1746)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.startupModule(IgnitionDesigner.java:961)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner.loadProject(IgnitionDesigner.java:839)
	at com.inductiveautomation.ignition.designer.IgnitionDesigner$StartupProjectDialogHandler$1.run(IgnitionDesigner.java:1818)
	at java.lang.Thread.run(Thread.java:748)

```

This is because we changed the constructor for our `ClientTagUtilities` between 7.9.1 and 7.9.2 from taking a `ClientTagManager` to taking a `ClientContext`. I’m not sure we consider any of our scripting utility classes to be part of the public API despite their reachability from 3rd party code, but either way what’s done is done.

To further complicate things, in 7.9.2 and 7.9.3 your module loads without error, but it appears we broke something and that client and designer hooks never get their `configureFunctionFactory()` methods called… so I’m going to look into that now.

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [June 9, 2017, 3:18pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/6 "2017-06-09T15:18:53Z")

</div>

Thanks Kevin! I’ll change it to access tag through the Client Context/Tag Manager. For now, if I fix this then build the module with the 7.9.1 SDK will that work?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 9, 2017, 3:33pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/7 "2017-06-09T15:33:28Z")

</div>

As things are now, your expression functions will only work on Ignition 7.9.1 (and that’s only after you change your SDK version to 7.9.1 and then fix the compilation error you get re: ClientContext vs ClientTagManager).

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [June 9, 2017, 3:47pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/8 "2017-06-09T15:47:18Z")

</div>

Ok I can work with that. Thanks for your help Kevin.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 9, 2017, 3:48pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/9 "2017-06-09T15:48:30Z")

</div>

No problem. I’m going to try to get this fixed for 7.9.4 if it’s not too late.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 15, 2017, 1:44pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/10 "2017-06-15T13:44:17Z")

</div>

If you have a chance, try 7.9.4-beta1 and verify that your custom expression functions work again.

---

<div class="post-metadata">

**Author:** ![cody.tamaki](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@cody.tamaki](https://forum.inductiveautomation.com/u/cody.tamaki)\
**Post date:** [June 22, 2017, 5:25pm UTC](https://forum.inductiveautomation.com/t/7-9-2-sdk-expression-functions-broken/14481/11 "2017-06-22T17:25:02Z")

</div>

That works. Thanks Kevin!
