Hello,
I have two projects running. At a certain point (file was succesfully closed in the 1st project) I want to start a script in the 2nd project.
What is the best way to do it? How do I pass the information and trigger the script in the 2nd project?
thanks
Richard
Triggering a script in 2nd Project
- mkoller
- Posts:741
- Joined: Fri Sep 17, 2010 9:03 am
Re: Triggering a script in 2nd Project
In a distributed system, you would set a datapoint and the other script would dpConnect() to this.
- RudiKreiner
- Posts:198
- Joined: Mon May 16, 2011 2:10 pm
Re: Triggering a script in 2nd Project
but if you don't have a distributed system, then you could write a script in the second siystem with a timer that periodically checks for the existence of the file you are waiting for.
To make sure that your second system doesn't start to read the file before the first system is finished writing to it,
it is good practice to have the first system write to a temporary file name, then rename the file when done.
Passing the info in a datapoint in a distributed system is definitely more elegant but if you don't want to go to the trouble of setting that up, then this could be a cheap and dirty but sufficient way to do it, depending on your use case.
To make sure that your second system doesn't start to read the file before the first system is finished writing to it,
it is good practice to have the first system write to a temporary file name, then rename the file when done.
Passing the info in a datapoint in a distributed system is definitely more elegant but if you don't want to go to the trouble of setting that up, then this could be a cheap and dirty but sufficient way to do it, depending on your use case.