Stoppig threads

ohcysp

Client
Регистрация
21.02.2012
Сообщения
28
Благодарностей
0
Баллы
1
My template is getting lines from a text file and when there is no lines in the file I want threads to stop. Is it possible? The first part can be done by two ways - with an counter matching the lines count or with File.Exists since when there is not lines the file gets deleted. So is this possible?
 
Регистрация
26.03.2012
Сообщения
44
Благодарностей
6
Баллы
0
Absolutely - you seem to have basically answered your question.

Just use either of those methods and when the counter runs out or the file doesn't exist anymore use a logic step to break out of the loop.
 

ohcysp

Client
Регистрация
21.02.2012
Сообщения
28
Благодарностей
0
Баллы
1
Yes but when I break out of the loop, whats next? It will successfully execute the template and it will run again. This is the missing part. I don't want ZP to restart the template.
 
Регистрация
26.03.2012
Сообщения
44
Благодарностей
6
Баллы
0
Ah, okay. Then this is not a problem with the template itself but with the settings in ZP. If you don't want ZP to restart the template then you need to either limit the number of "Attempts" or "How many are needed?" Once you add the template to ZP, those are two of the columns listed by the template.

If you set a number under "How many are needed?" it will continue running the template until it has successfully completed that many times.

If you set a number under "Attempts" it will limit the number of retries whether they are successful or not.

If you only want it to run once, just put a 1 under either of those and you're set :-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)