I have a requirement where I am developing a application which will be deployed to cloud PaaS or SaaS.
I need this application to interact with the Creo Parametric and perform actions such as - retrieving and loading a design in a new Creo Session. My first though was to use JLink asynchronous method and deploy the code as Rest API. But this is giving issues related to loading libraries, which I can't seem to resolve.
Please help with this requirement. It doesn't matter if this is done synchronously or asynchronously, I just need to establish some sort of connectivity from cloud to on-prem Creo.
I think your only way is to use assynchronous jlink application because any application "listening" any triggers will block jlink thread.
As said in creo jlink guide:
When you run a synchronous Creo Object TOOLKIT Java program, you should
configure your program so it does not interfere with the main thread of the Creo
program. Because the Java API allows you to run with multiple threads, you
should be cautious of using certain Java routines in your program.
The most obvious restriction involves the use of Java language user interfaces.
Any Java window that you create must be a dialog box that is blocking (or modal).
Creating a nonblocking frame causes a new thread to begin, which can have
unexpected results when running with Creo application. For example, you can use
the javax.swing.JDialog class and set modal true. You cannot use
javax.swing.JWindow, however, because it starts a thread.
To communicate with your cloud app I would use websockets: here is nice tutorial
This cannot be used in synchronnous app because websocket create TCP socket listening on specific port which will block creo until socket is not closed.
You can also periodically connect and disconnect to your cloud app but you will no longer be able to trigger from cloud.