Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Single instance of Assembly Line

45 views
Skip to first unread message

ave...@gmail.com

unread,
Sep 29, 2014, 5:23:27 PM9/29/14
to
We use the TDI CLI (tdisrvctl) pretty extensively to stop/start ALs, set properties, etc. No problem there, it works great.

However, there are times when someone will, inadvertently or due to error in a script, start the same AL TWICE. That is, config-1/assembly-line1 is started twice and there are two running instances of 'assembly-line1'.

Is it possible to configure and AL such that only one instance is allowed? That is, if these two commands were issued the 2nd would fail?

a) start -c myConfig -r myAssemLine // works
b) start -c myConfig -r myAssemLine // fails, AL already running

Eddie Hartman

unread,
Sep 30, 2014, 8:53:35 AM9/30/14
to
Add a script to be included on all ALs that are singleton. I'd even call it Singleton.
Then in this script you do the following:

ALisRunning = main.getTask(alName);
if (ALisRunning) {
msg = "AL already running: " + alName + " exiting...");
task.logmsg("ERROR", msg);
java.lang.System.out.println("ERROR: " + msg);
task.shutdown();
}

As you probably know, you can pass the alName in as a parameter: from -0 thru -9
Then grab the argument value using main.commandlineParam(paramNum)

alName = main.commandlineParam("0");

Hope this helps!
Eddie

Eddie Hartman

unread,
Sep 30, 2014, 9:41:41 AM9/30/14
to
Forgive me trying to multi-task and answer an email while writing this reply. Of course you get alName from the running AL:

alName = task.getShortName();
// task.getName() gives you the full path: AssemblyLines/ALName

-Eddie
0 new messages