Accessing methods of other program objects?

I have a threadpool object and a threaduser object. Threapool (as it sounds) makes a threadpool for threaduser to use. The threaduser uses a query to get threadpool location. Once I have the location, I try to access a public method of the threadpool class. but i get an “Cannot find symbol” error.

public void onStart() throws Exception {
    BOrd location = getThreadpoolLocation();
    BITable result = (BITable)location.resolve().get();
    
    @SuppressWarnings({ "unchecked" })
    TableCursor<BProgram> cursor = result.cursor();
    
    
    while(cursor.next()){
        thread = cursor.get();
    }

    
}

public void onExecute() throws Exception {
    if (thread == null) {
        onStart();
    }
    
    // Create and enqueue a task to the shared thread pool
     
    thread.code.Source.enqueueTask(() -> {   // I get an error here
        executeTask();
    });
    
}

public void onStop() throws Exception {
    // Cleanup code if necessary
}

// Reference to the shared thread pool
  BProgram thread;

Edit: If you guys know a better way of finding the program object rather that doing the query, do let me know. Queries are way too slow to be used at a large scale.

I’m almost 99.9999% certain it cannot work that way in a Niagara Station. This can easily be done in a module because all the classes can be reference in different packages, but that’s not how this would work here. I’ll research and get back to you.

1 Like