# Problem with parent project and SDK module

**URL:** <https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382>\
**Category:** Module Development\
**Created:** [February 27, 2023, 7:11pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382 "2023-02-27T19:11:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 27, 2023, 7:11pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/1 "2023-02-27T19:11:10Z")

</div>

Hi, I have a project named test, which inherits some scripts and sfc from another project called global, so to make this work configure in Gateway Stettings in the Gateway Scripting Project part with the name "global", working correctly, however, I also have installed a SDK module that contains some additional scripts and with this configuration I can no longer call the methods inside the module, but if in Gateway Scripting Project I leave it empty "" it calls the module working correctly but I lose the sfc sequences, what could I do to make both work at the same time?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 7:37pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/2 "2023-02-27T19:37:15Z")

</div>

> [@Sebastian\_Munoz\_Vasq](#):
>
> also have installed a SDK module that contains some additional scripts

Explain. SDK modules generally do not contain or supply _scripts_. They supply scripting **functions** , exposed to all projects, but implemented in java. What exactly are you doing in this SDK module?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 27, 2023, 7:49pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/3 "2023-02-27T19:49:01Z")

</div>

the module is performing a query in the database and is organizing the information to show what I want to see.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 7:51pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/4 "2023-02-27T19:51:17Z")

</div>

I meant, what exactly are you doing with scripts and/or script functions in this module? Show the related code, sanitized if necessary.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 27, 2023, 8:16pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/5 "2023-02-27T20:16:12Z")

</div>

the sdk module contains this function script

system.yieldCalcMillA.data("scales\_simulator", 0, system.date.getDate(2023, 0, 25), system.date.getDate(2023, 0, 23), 1)

and when running this in the console script as follows it comes out correctly

 ![vacio](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec3fde7ceb4adedf37cb856762696b04b039430f.png)

 ![script console sin global](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/5/85958b2c3a47078f80c6222e5a89da1d83bc59c6.png)

while when configuring it with the global name, the following is displayed

 ![global](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/a/8a045350110a31915a62bb34ee9519fa325bf12e.png)

```
Java Traceback:
Traceback (most recent call last):
File "<input>", line 1, in <module>
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.moduleInvokeSafe(GatewayInterface.java:917)

at com.inductiveautomation.ignition.client.gateway_interface.ModuleRPCFactory$DynamicRPCHandler.invoke(ModuleRPCFactory.java:53)

at com.sun.proxy.$Proxy58.data(Unknown Source)

at com.inductiveautomation.ignition.examples.scripting.client.ClientScriptModule.dataImpl(ClientScriptModule.java:24)

at com.inductiveautomation.ignition.examples.scripting.AbstractScriptModule.data(AbstractScriptModule.java:22)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: class com.inductiveautomation.ignition.common.script.ProjectScriptModule cannot be cast to class com.inductiveautomation.ignition.common.Dataset (com.inductiveautomation.ignition.common.script.ProjectScriptModule and com.inductiveautomation.ignition.common.Dataset are in unnamed module of loader 'app')

at org.python.core.Py.JavaError(Py.java:547)

at org.python.core.Py.JavaError(Py.java:538)

at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:192)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. __call__ (ScriptManager.java:549)

at org.python.core.PyObject. __call__ (PyObject.java:433)

at org.python.core.PyObject. __call__ (PyObject.java:437)

at org.python.pycode._pyx11.f$0(<input>:1)

at org.python.pycode._pyx11.call_function(<input>)

at org.python.core.PyTableCode.call(PyTableCode.java:173)

at org.python.core.PyCode.call(PyCode.java:18)

at org.python.core.Py.runCode(Py.java:1687)

at org.python.core.Py.exec(Py.java:1731)

at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:277)

at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:130)

at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:611)

at com.inductiveautomation.ignition.designer.gui.tools.jythonconsole.JythonConsole$ConsoleWorker.doInBackground(JythonConsole.java:599)

at java.desktop/javax.swing.SwingWorker$1.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.desktop/javax.swing.SwingWorker.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: class com.inductiveautomation.ignition.common.script.ProjectScriptModule cannot be cast to class com.inductiveautomation.ignition.common.Dataset (com.inductiveautomation.ignition.common.script.ProjectScriptModule and com.inductiveautomation.ignition.common.Dataset are in unnamed module of loader 'app')

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.moduleInvokeSafe(GatewayInterface.java:917)

at com.inductiveautomation.ignition.client.gateway_interface.ModuleRPCFactory$DynamicRPCHandler.invoke(ModuleRPCFactory.java:53)

at com.sun.proxy.$Proxy58.data(Unknown Source)

at com.inductiveautomation.ignition.examples.scripting.client.ClientScriptModule.dataImpl(ClientScriptModule.java:24)

at com.inductiveautomation.ignition.examples.scripting.AbstractScriptModule.data(AbstractScriptModule.java:22)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction. __call__ (PyReflectedFunction.java:190)

... 19 more

Caused by: java.lang.ClassCastException: class com.inductiveautomation.ignition.common.script.ProjectScriptModule cannot be cast to class com.inductiveautomation.ignition.common.Dataset (com.inductiveautomation.ignition.common.script.ProjectScriptModule and com.inductiveautomation.ignition.common.Dataset are in unnamed module of loader 'app')

at com.inductiveautomation.ignition.examples.scripting.GatewayScriptModule.dataImpl(GatewayScriptModule.java:71)

at com.inductiveautomation.ignition.examples.scripting.AbstractScriptModule.data(AbstractScriptModule.java:22)

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(null)

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(null)

at java.lang.reflect.Method.invoke(null)

at com.inductiveautomation.ignition.gateway.servlets.gateway.functions.ModuleInvoke.invoke(ModuleInvoke.java:167)

at com.inductiveautomation.ignition.gateway.servlets.Gateway.doPost(Gateway.java:431)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

at com.inductiveautomation.ignition.gateway.bootstrap.MapServlet.service(MapServlet.java:86)

at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)

at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:548)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)

at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)

at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)

at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at com.inductiveautomation.catapult.handlers.RemoteHostNameLookupHandler.handle(RemoteHostNameLookupHandler.java:121)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)

at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:59)

at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)

at org.eclipse.jetty.server.Server.handle(Server.java:516)

at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)

at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)

at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)

at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)

at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)

at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)

at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)

at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)

at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)

at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)

at java.lang.Thread.run(null)

Traceback (most recent call last):
File "<input>", line 1, in <module>
at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:351)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:325)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:278)

at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.moduleInvokeSafe(GatewayInterface.java:917)

at com.inductiveautomation.ignition.client.gateway_interface.ModuleRPCFactory$DynamicRPCHandler.invoke(ModuleRPCFactory.java:53)

at com.sun.proxy.$Proxy58.data(Unknown Source)

at com.inductiveautomation.ignition.examples.scripting.client.ClientScriptModule.dataImpl(ClientScriptModule.java:24)

at com.inductiveautomation.ignition.examples.scripting.AbstractScriptModule.data(AbstractScriptModule.java:22)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.base/java.lang.reflect.Method.invoke(Unknown Source)

com.inductiveautomation.ignition.client.gateway_interface.GatewayException: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: class com.inductiveautomation.ignition.common.script.ProjectScriptModule cannot be cast to class com.inductiveautomation.ignition.common.Dataset (com.inductiveautomation.ignition.common.script.ProjectScriptModule and com.inductiveautomation.ignition.common.Dataset are in unnamed module of loader 'app')

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 8:19pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/6 "2023-02-27T20:19:27Z")

</div>

You are going to have to work with the creator of this SDK module to resolve this. Whoever it is didn't bother to create their own package hierarchy after copying the scripting examples, so there's no indication where to look.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 27, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/7 "2023-02-27T20:37:29Z")

</div>

the module was developed by ourselves from the example for creating sdk modules from ignition example scripting function

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 8:41pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/8 "2023-02-27T20:41:59Z")

</div>

- Change the example package and module ID to your own hierarchy.

- Show your SDK code for that function.

If you cannot share the code, you will probably need to arrange for commercial assistance under an NDA.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 27, 2023, 8:49pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/9 "2023-02-27T20:49:11Z")

</div>

could you show me an example of what you mention? because we change the id of the module

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 27, 2023, 9:25pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/10 "2023-02-27T21:25:17Z")

</div>

> [@Sebastian\_Munoz\_Vasq](#):
>
> because we change the id of the module

But you didn't change your package hierarchy. So your backtrace is full of `com.inductiveautomation.ignition.examples`. Your module ID and your package hierarchy should both start with your company's domain name, reversed.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 1:33pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/11 "2023-02-28T13:33:46Z")

</div>

I was testing by changing all that, however, it still has the same problem, the sdk module works perfectly when it is empty without any project, but as soon as I link one it stops working

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2023, 1:39pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/12 "2023-02-28T13:39:37Z")

</div>

So, you've followed the first of my recommendations. It is intended to make the second recommendation most useful, by uniquely correlating further backtraces against the **code you share**. _ **I** _ can't tell what's wrong with your code without _ **seeing it** _.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 1:50pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/13 "2023-02-28T13:50:19Z")

</div>

I understand, the code has several components, some pom, some hooks, among others, I think the problem may be related to the scope of execution of the module, what part of the code should I share to visualize this?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2023, 2:09pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/14 "2023-02-28T14:09:19Z")

</div>

Start by sharing:

- Your gateway hook class

- Your class submitted to `.addScriptModule()` that exposes `system.yieldCalcMillA.data`

- Any class that has any use of `ScriptManager.runCode()` or `.runFunction()` (because you almost certainly should **not** be using those)

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 2:21pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/15 "2023-02-28T14:21:51Z")

</div>

Gateway Hook

```
package com.dautom.yieldcalc.mill.a;

import com.inductiveautomation.ignition.common.licensing.LicenseState;
import com.inductiveautomation.ignition.common.script.ScriptManager;
import com.inductiveautomation.ignition.common.script.hints.PropertiesFileDocProvider;
import com.inductiveautomation.ignition.gateway.clientcomm.ClientReqSession;
import com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook;
import com.inductiveautomation.ignition.gateway.model.GatewayContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class GatewayHook extends AbstractGatewayModuleHook {

    private final Logger logger = LoggerFactory.getLogger(getClass());
    private final GatewayScriptModule scriptModule = new GatewayScriptModule();

    private static GatewayContext gatewayContext;

    @Override
    public void setup(GatewayContext gatewayContext) {
        logger.info("setup()");
        GatewayHook.gatewayContext = gatewayContext;
    }

    @Override
    public void startup(LicenseState licenseState) {
        logger.info("startup()");
    }

    @Override
    public void shutdown() {
        logger.info("shutdown()");
    }

    @Override
    public void initializeScriptManager(ScriptManager manager) {
        super.initializeScriptManager(manager);

        manager.addScriptModule(
                "system.yieldCalcMillA",
                scriptModule,
                new PropertiesFileDocProvider());
    }

    @Override
    public Object getRPCHandler(ClientReqSession session, String projectName) {
        return scriptModule;
    }

    public static GatewayContext getGatewayContext() {
        return gatewayContext;
    }
}

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2023, 2:25pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/16 "2023-02-28T14:25:03Z")

</div>

Ok. Singleton script module pattern with RPC. (Does not support identifying calling clients--this pattern throws that information away.)

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/17 "2023-02-28T14:41:19Z")

</div>

OK, so how can I make it work?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2023, 3:13pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/18 "2023-02-28T15:13:56Z")

</div>

Make what work? We haven't yet determined what you've done that makes your code sensitive to the global scripting project setting. You have more to share.

---

<div class="post-metadata">

**Author:** ![Sebastian\_Munoz\_Vasq](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sebastian\_Munoz\_Vasq](https://forum.inductiveautomation.com/u/Sebastian_Munoz_Vasq)\
**Post date:** [February 28, 2023, 3:21pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/19 "2023-02-28T15:21:13Z")

</div>

it would be easier for me if you could provide me with an address or a way to share the complete code privately.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 28, 2023, 3:22pm UTC](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382/20 "2023-02-28T15:22:43Z")

</div>

I don't do private for free, sorry.

[Next page](https://forum.inductiveautomation.com/t/problem-with-parent-project-and-sdk-module/70382.md?page=2)
