Simultaneous flows using the same application

Post Reply
JohnPCS
Newbie
Posts: 10
Joined: Thu Sep 15, 2011 9:46 pm

Simultaneous flows using the same application

Post by JohnPCS »

If I had, say, a dozen or more different active Flows all using the same application (InDesign), would there be any inherit problems processing jobs? All the Flows would have to get in line to use it...



Just curious before I get too deep into this Fullswitch trial. Thanks!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Simultaneous flows using the same application

Post by dkelly »

As a general rule, any GUI application that you are trying to automate with Switch can only be called by a single flow. This limitation would include Acrobat, Photoshop and Indesign. These applications were designed to interact with a real user.



This limitation would not apply if the application supported hot-folders or is available as a 'server' application.



There is a server version of Indesign for building high-volume workflows but it is much more expensive than Indesign CS5.



Dwight Kelly

Apago, Inc.

dkelly@apago.com
JohnPCS
Newbie
Posts: 10
Joined: Thu Sep 15, 2011 9:46 pm

Simultaneous flows using the same application

Post by JohnPCS »

That is definitely not the answer I was hoping for. InDesign server is WAY out of my price range. Even Axio is.



My only hope then is to have Switch launch an InDesign script that handles the rest of the logic. To date, I have had zero luck getting Switch to do this. I keep getting blank error messages that point me nowhere.



I really want to like Switch, but I'm having a heckuva hard time making it work with what we have.



Thanks for your input!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Simultaneous flows using the same application

Post by dkelly »

John, you could prevent multiple flows from calling Indesign at the same time by using a "mutex". A mutex is a lock that your flows will read & write. It can be a file or a database entry.



Basically, a process will check for the presence of the mutex lock, say the file "/tmp/indesign.lock", and it does not exist it will immediately create it and then call Indesign. When finished, the script would delete the lock file.



There can be an issue using mutexes -- a race condition. This is when two or more scripts check for the lock at the exact same time or another script checks for the lock before the first script created it. It's a complex timing issue but may never occur in your workflow.



Another idea would be to determine if the Indesign process already running. If not, the script would wait until Indesign quits.



Dwight Kelly

Apago, Inc.

dkelly@apago.com


JohnPCS
Newbie
Posts: 10
Joined: Thu Sep 15, 2011 9:46 pm

Simultaneous flows using the same application

Post by JohnPCS »

So with a Mutex or process check, each flow would basically line up and attempt to isolate the application to process the workflow. That would work fine for our situation. Thanks for the info!



I do think it may be safer to simply check for the InDesign process, but whatever is easiest to program is probably best. I have the Fullswitch version of Switch - would either of these tasks (process, mutex) be doable without the additional scripting capabilities of Powerswitch?



Thanks again - very useful information!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Simultaneous flows using the same application

Post by dkelly »

With FullSwitch you can't use Switch's Javascript; however, you can call an external program or script.
Post Reply