robotask starts task 3 times unwanted..?

Discuss RoboTask here
Post Reply
jeroen123
Posts: 25
Joined: Wed Feb 15, 2012 5:35 pm

robotask starts task 3 times unwanted..?

Post by jeroen123 »

Dear Oleg,
pls see my task below:
do you see any reason why I should get 3 emails out of this? we get 3 emails when this task is run, sometimes just 2... :shock:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|878771735
Comment=STRINGLIST
ContinueOnError=INTEGER|1
Events=FOLDER
ExternalName=STRING|"Task36"
Hide=INTEGER|0
ID=INTEGER|242455673
LogOnAsUser=INTEGER|1
Name=STRING|"S07 voorraad lijst NL from SQL"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action18=FOLDER
Action19=FOLDER
Action2=FOLDER
Action20=FOLDER
Action21=FOLDER
Action22=FOLDER
Action23=FOLDER
Action24=FOLDER
Action25=FOLDER
Action26=FOLDER
Action27=FOLDER
Action28=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FILE"" with value ""E:\DATA\robotask\lijsten\voorraadlijst"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FILE"
varvalue=STRING|"E:\DATA\robotask\lijsten\voorraadlijst"

[Actions\Action10]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|0
Name=STRING|"Create text file {file}.txt"
Params=FOLDER

[Actions\Action10\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{file}.txt"
line0=STRING|"{value(0)};{value(1)};{value(3)};{value(2)};{value(4)};{value(5)};{value(6)};{value(7)};{value(8)};{value(9)};{value(10)};{value(11)};{value(12)};{value(13)};{value(14)};{value(15)}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action11]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""FILE2"" with value ""E:\DATA\robotask\lijsten\onderweg"""
Params=FOLDER

[Actions\Action11\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"FILE2"
varvalue=STRING|"E:\DATA\robotask\lijsten\onderweg"

[Actions\Action12]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action12\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{file2}*.txt"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"1"

[Actions\Action13]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action13\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{file2}*.csv"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"1"

[Actions\Action14]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {file2}@{date}.txt"
Params=FOLDER

[Actions\Action14\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{file2}@{date}.txt"
line0=STRING|"Item#;Item description;vrrd"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action15]
ActionID=STRING|"A_LOOP_DATASET"
Enabled=INTEGER|-1
Name=STRING|"Dataset Loop"
Params=FOLDER

[Actions\Action15\Params]
commatext=STRING|"0"
connectionstring=STRING|"DSN=Unit 4 Multivers;UID=Oxxx;PWD=xxx;DB=MVL00650;SRVR=MVSERV"
override=STRING|"0"
password=STRING|"xxx"
sql=STRING|"""SELECT ARTIKEL.CDARTIKEL, ARTIKEL.OMSCHR, VOORRADEN.VOORRAAD"",""FROM SYSADM.ARTIKEL ARTIKEL, PUBLIC.VOORRADEN VOORRADEN"",""WHERE ARTIKEL.CDARTIKEL = VOORRADEN.CDARTIKEL AND ((VOORRADEN.CDMAGAZIJN='50'))"",""ORDER BY ARTIKEL.CDARTIKEL"""
timeout=STRING|"60"
var1=STRING|"FIELD"
var2=STRING|"VALUE"
withmemo=STRING|"0"

[Actions\Action16]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|0
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action16\Params]
expression=STRING|"{value(8)}-{value(9)}-{value(10)}"
variable=STRING|"ECO"

[Actions\Action17]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {file2}@{date}.txt"
Params=FOLDER

[Actions\Action17\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{file2}@{date}.txt"
line0=STRING|"{value(0)};{value(1)};{value(2)}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action18]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""Result = {ECO}"""
Params=FOLDER

[Actions\Action18\Params]
icon=STRING|"1"
msg0=STRING|"Result = {ECO}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action19]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action2]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action2\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{file}*.txt"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"1"

[Actions\Action20]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|0
Name=STRING|"Create text file {file}.txt"
Params=FOLDER

[Actions\Action20\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{file}.txt"
line0=STRING|"{value(0)};{value(1)};{value(3)};{value(2)};{value(4)};{value(5)};{value(6)};{value(7)};{value(8)};{value(9)};{value(10)};{value(11)};{value(12)};{value(13)};{value(14)};{value(15)}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action21]
ActionID=STRING|"A_FILE_RENAME"
Enabled=INTEGER|-1
Name=STRING|"Rename File"
Params=FOLDER

[Actions\Action21\Params]
count=STRING|"1"
file0=STRING|"{file2}@{date}.txt"
ifexists=STRING|"1"
mask=STRING|"{file2}@{date}.csv"
subdirs=STRING|"0"

[Actions\Action22]
ActionID=STRING|"A_FILE_RENAME"
Enabled=INTEGER|-1
Name=STRING|"Rename File"
Params=FOLDER

[Actions\Action22\Params]
count=STRING|"1"
file0=STRING|"{file}@{date}.txt"
ifexists=STRING|"1"
mask=STRING|"{file}@{date}.csv"
subdirs=STRING|"0"

[Actions\Action23]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER

[Actions\Action23\Params]
destvar=STRING|"VERT"
file=STRING|"E:\DATA\robotask\Lijsten\Vertegenwoordigers.txt"
linecount=STRING|"0"
sourcetext=STRING|"0"

[Actions\Action24]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""EMAIL"" with value ""{VERT(0)}"""
Params=FOLDER

[Actions\Action24\Params]
expand=STRING|"1"
varname=STRING|"EMAIL"
varvalue=STRING|"{VERT(0)}"

[Actions\Action25]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""VNAAM"" with value ""{VERT(1)}"""
Params=FOLDER

[Actions\Action25\Params]
expand=STRING|"1"
varname=STRING|"VNAAM"
varvalue=STRING|"{VERT(1)}"

[Actions\Action26]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""ANAAM"" with value ""{VERT(2)}"""
Params=FOLDER

[Actions\Action26\Params]
expand=STRING|"1"
varname=STRING|"ANAAM"
varvalue=STRING|"{VERT(2)}"

[Actions\Action27]
ActionID=STRING|"A_INET_SENDMAIL"
Enabled=INTEGER|-1
Name=STRING|"Send Email"
Params=FOLDER

[Actions\Action27\Params]
attach0=STRING|"{file}@{date}.csv"
attach1=STRING|"{file2}@{date}.csv"
attachcount=STRING|"2"
auth=STRING|"1"
charset=STRING|"iso-8859-1"
from=STRING|"YYY"
host=STRING|"YYY"
html=STRING|"1"
msg0=STRING|"Beste {VNAAM},<br><br>"
msg1=STRING|"Zie svp bijgaande lijst<br><br>"
msg12=STRING|"RBT-S07"
msg2=STRING|"Deze zijn in CSV formaat: en kunnen in excel worden geopend. SVP eerst excel openen, dan vanuit excel deze lijst openen."
msg3=STRING|"<br><br>"
msg4=STRING|"Vanaf nu krijgt u dagelijks een actuele voorraadlijst toegestuurd & een lijst 'onderweg': hierin staat welke goederen er per vandaag onderweg zijn: deze zijn binnen 3-4 weken hier."
msg5=STRING|"Zo heeft u meer inzicht in  'dat wat komen gaat'; helaas kunnen beide lijsten niet worden gecombineerd."
msg6=STRING|"<br><br>"
msg7=STRING|"Best regards,<br>"
msg8=STRING|"Jeanette"
msgcount=STRING|"13"
password=STRING|"XXX"
passwordmode=STRING|"0"
port=STRING|"25"
SSL=STRING|"0"
subject=STRING|"voorraadlijst {date}  {time}H voor {VNAAM} {ANAAM}"
to=STRING|"{EMAIL}"
user=STRING|"jeroen"

[Actions\Action28]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action3]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action3\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
file0=STRING|"{file}*.csv"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {file}@{date}.txt"
Params=FOLDER

[Actions\Action4\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{file}@{date}.txt"
line0=STRING|"Item#;Item description;P1;Cons;Inn;Out;vrrd;ECO"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_LOOP_DATASET"
Enabled=INTEGER|-1
Name=STRING|"Dataset Loop"
Params=FOLDER

[Actions\Action5\Params]
commatext=STRING|"0"
connectionstring=STRING|"DSN=Unit 4 Multivers;UID=XXX;PWD=XXX;DB=MVL00650;SRVR=MVSERV"
override=STRING|"0"
password=STRING|"XXX"
sql=STRING|"""SELECT ARTIKEL.CDARTIKEL, ARTIKELOMSCHR.OMSCHR, ARTIKEL.PRIJSEXCL, ARTIKEL.VVCONSPRIJS, ARTIKEL.VVINNERQPCEVERKOOP, ARTIKEL.VVOPPRIJSLIJST, ARTIKEL.VVOUTERQPCE, VOORRADEN.CDMAGAZIJN, VOORRADEN.VOORRAAD, VOORRADEN.BESTELD, VOORRADEN.GERESERVEERD"",""FROM SYSADM.ARTIKEL ARTIKEL, SYSADM.ARTIKELOMSCHR ARTIKELOMSCHR, PUBLIC.VOORRADEN VOORRADEN"",""WHERE ARTIKEL.CDARTIKEL = VOORRADEN.CDARTIKEL AND ARTIKELOMSCHR.CDARTIKEL = ARTIKEL.CDARTIKEL AND ((ARTIKELOMSCHR.CDTAAL='N') AND (ARTIKEL.VVOPPRIJSLIJST>0) AND (VOORRADEN.CDMAGAZIJN='1'))"",""ORDER BY ARTIKEL.CDARTIKEL"""
timeout=STRING|"60"
var1=STRING|"FIELD"
var2=STRING|"VALUE"
withmemo=STRING|"0"

[Actions\Action6]
ActionID=STRING|"BASIC_EVALUATE"
Enabled=INTEGER|-1
Name=STRING|"Evaluate"
Params=FOLDER

[Actions\Action6\Params]
expression=STRING|"{value(8)}-{value(9)}-{value(10)}"
variable=STRING|"ECO"

[Actions\Action7]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {file}@{date}.txt"
Params=FOLDER

[Actions\Action7\Params]
encode=STRING|"0"
fileexists=STRING|"1"
filname=STRING|"{file}@{date}.txt"
line0=STRING|"{value(0)};{value(1)};{value(2)};{value(3)};{value(4)};{value(6)};{value(8)};{ECO}"
linecount=STRING|"1"
suppress=STRING|"0"

[Actions\Action8]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""Result = {ECO}"""
Params=FOLDER

[Actions\Action8\Params]
icon=STRING|"1"
msg0=STRING|"Result = {ECO}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action9]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Events]
Event1=FOLDER

[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_SHEDULER"
Params=FOLDER
UnigueID=INTEGER|17166849

[Events\Event1\Params]
id=STRING|"40XQ3P4V"
periodicity=STRING|"1"
periodparameter=STRING|"0111110"
startdate=STRING|"41383"
time0=STRING|"61200000"
timecount=STRING|"1"
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: robotask starts task 3 times unwanted..?

Post by Oleg »

You send email in the text loop (file E:\DATA\robotask\Lijsten\Vertegenwoordigers.txt) step #27
Unfortunately I don't see where you create the file E:\DATA\robotask\Lijsten\Vertegenwoordigers.txt.

Maybe you forgot this?
Amount of emails should be equal to amount of lines in the text E:\DATA\robotask\Lijsten\Vertegenwoordigers.txt
Oleg Yershov
jeroen123
Posts: 25
Joined: Wed Feb 15, 2012 5:35 pm

Re: robotask starts task 3 times unwanted..?

Post by jeroen123 »

Dear Oleg,

The file 'vertegenwoordigers.txt' is always in that directory; thats where I keep the names and emails. so this is available.
it contains 6 lines with emails; but each emailadres receives the email 3 times..
any idea how this can happen?
(other tasks with email function not seems to have this problem..)

in step 3 there is a header created for the TXT file: but sometimes we not see that header.
could it be that robotask jumps over tasks, or is too fast for tasks?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: robotask starts task 3 times unwanted..?

Post by Oleg »

in step 3 there is a header created for the TXT file: but sometimes we not see that header.
But I see that step #3 is "Delete file"...
step3.png
step3.png (22.47 KiB) Viewed 22796 times
Also I see that you use global variables. All variables are global by default and can be changed in another task.
I strongly recommend you to declare all necessary variables as local
You can do this at Local variables tab (see screenshot below)
Add the declaration of loop variables
Add the declaration of loop variables
localvars.png (23.05 KiB) Viewed 22796 times
Oleg Yershov
jeroen123
Posts: 25
Joined: Wed Feb 15, 2012 5:35 pm

Re: robotask starts task 3 times unwanted..?

Post by jeroen123 »

Dear Oleg,
still tasks run unwanted..

could it be that there is multiple versions of ROBOTASK running simultaniously?

in my taskmanager I see 3 lines:
ScreenShot045.jpg
ScreenShot045.jpg (11.12 KiB) Viewed 22495 times
how to check?
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: robotask starts task 3 times unwanted..?

Post by Oleg »

It seems you use RDC (remote desktop connection) and you have 3 sessions of user "administrator". Correct?

I recommend you to use different users for different sessions.
RoboTask can be started only once within one session. If you have several separated sessions then RoboTask can be started in each session.

We'll investigate the problem, probably we will add some mechanism to avoid of running RoboTask on one computer within separate sessions under the same user.
Oleg Yershov
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: robotask starts task 3 times unwanted..?

Post by Oleg »

I recommend you to use such command line of RDC client:
mstsc /admin

In this case you will have only one administrative connection.
Oleg Yershov
Post Reply