Discussion:
Run an AL on other exported XML project
(too old to reply)
a***@gmail.com
2017-04-19 21:31:49 UTC
Permalink
Raw Message
I have one project exported to run as a windows service with a daily schedule. But sometimes I need to start some of the ALs on demand.
So I am thinking to do a project with a REST service for a PHP application run these ALs, but I am stuck on how to call these ALs that is on other project and exported as XML, I can run an AL on the same project but I can't find how to do on a external.
Eddie Hartman
2017-04-20 09:01:51 UTC
Permalink
Raw Message
Post by a***@gmail.com
I have one project exported to run as a windows service with a daily schedule. But sometimes I need to start some of the ALs on demand.
So I am thinking to do a project with a REST service for a PHP application run these ALs, but I am stuck on how to call these ALs that is on other project and exported as XML, I can run an AL on the same project but I can't find how to do on a external.
You could either use the tdisrvctl commandline tool (found in the $TDI_INSTALLDIR$/bin folder) or set up your own HTTP Service using an AL with the HTTP Server Connector. Then you can make requests to it, parse these and execute ALs as you want. Here is a simple example of an AL providing a web service:


a***@gmail.com
2017-04-21 19:49:07 UTC
Permalink
Raw Message
This is not exact what I need because the assembly line I need to run is not in the same project of the http server connector. It is on a exported XML. Anyone have a way to call this exported AL?
Eddie Hartman
2017-04-22 17:32:01 UTC
Permalink
Raw Message
Yessir. You have a couple of choices. You could use the 'session' object, documented in the javadocs installed with TDI under the docs/api sub-folder of the installation directory. The index.html is in my browser favorites bar :) Stephen Swann's copy looks like this:

https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html

Here you can see handy functions like getAssemblyLines() and and getConfigInstance(). The config instance (CI) is the object representing the project running on the server. So a single configuration xml can be loaded multiple times to create multiple instances.

With the CI you can do stuff like getAssemblyLineNames() and getAssemblyLines, this latter returning a collection of running ALs, from which you can check state, get the current Work Entry and more.

Apart from starting and stopping ALs using the CI, you can also do things like reload configs and change properties settings.

You also have the 'main' object, which is the TDI Server itself:

https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html

This is the guy you typically use to launch ALs: main.startAL().

Hope this helps!
Eddie Hartman
2017-04-23 17:54:53 UTC
Permalink
Raw Message
Post by Eddie Hartman
https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html
Here you can see handy functions like getAssemblyLines() and and getConfigInstance(). The config instance (CI) is the object representing the project running on the server. So a single configuration xml can be loaded multiple times to create multiple instances.
With the CI you can do stuff like getAssemblyLineNames() and getAssemblyLines, this latter returning a collection of running ALs, from which you can check state, get the current Work Entry and more.
Apart from starting and stopping ALs using the CI, you can also do things like reload configs and change properties settings.
https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html
This is the guy you typically use to launch ALs: main.startAL().
Hope this helps!
Also note that you can include another Config xml under References, after which you can access Resources components and AssemblyLines from this Config in your own project.
a***@gmail.com
2017-04-24 16:21:08 UTC
Permalink
Raw Message
Post by Eddie Hartman
Post by Eddie Hartman
https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html
Here you can see handy functions like getAssemblyLines() and and getConfigInstance(). The config instance (CI) is the object representing the project running on the server. So a single configuration xml can be loaded multiple times to create multiple instances.
With the CI you can do stuff like getAssemblyLineNames() and getAssemblyLines, this latter returning a collection of running ALs, from which you can check state, get the current Work Entry and more.
Apart from starting and stopping ALs using the CI, you can also do things like reload configs and change properties settings.
https://www.stephen-swann.co.uk/javadoc/tdi7.1.1/index.html
This is the guy you typically use to launch ALs: main.startAL().
Hope this helps!
Also note that you can include another Config xml under References, after which you can access Resources components and AssemblyLines from this Config in your own project.
Thanks, with References I can do what I need!!!

Loading...