How to stop Robotask execution...

Discuss RoboTask here
Post Reply
jarlatheoin
Posts: 4
Joined: Mon Jan 24, 2011 12:56 am

How to stop Robotask execution...

Post by jarlatheoin »

Hi All,

I'm a bit of a newbie cutting my teeth in RoboTask and i
have come upon a bit of a gap in my knowledge...

I would like to run a pre-cursor check before continuing
with the remainder of the RoboTask steps...

The pre-cursor is a batch file which will write a text
file called Failure.txt or Success.txt in a specified
location dependent upon a Microsoft.Build routine...

I want to be able to check the .txt files in the
directory C:\BuildStatus and where Failure.txt exists
stop the execution of RoboTask... If Success.txt exists
however just continue with the steps...

Below is the task...

Thank you in advance for your help...

I do not know if my approach is correct or even logical,
any help at all would be great...

Jarlath

Code: Select all

;*******************************
;* RoboTask Task  file         *
;* Do not edit in text editor! *
;*******************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|0
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task12"
Hide=INTEGER|0
ID=INTEGER|1634644416
Name=STRING|"00 PreBuild Check"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER

[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""master.bat"""
Params=FOLDER

[Actions\Action1\Params]
program=STRING|"C:\ProConBuildCheck\master.bat"
runas=STRING|"0"
wait=STRING|"0"

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

[Actions\Action2\Params]
createmode=STRING|"1"
date1=STRING|"20101207"
date2=STRING|"20101207"
destvar=STRING|"{BUILDSTATUS}"
DuringDays=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"C:\ProConBuild\*.txt"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
subdirs=STRING|"1"
timesize=STRING|"0"
WithoutPath=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"0"
value1=STRING|"{BUILDSTATUS}"
value2=STRING|"{Failure.txt}"

[Actions\Action4]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file C:\Documents and 
Settings\8over8qa\Desktop\RoboTaskPreBuildStatus.txt"
Params=FOLDER

[Actions\Action4\Params]
fileexists=STRING|"0"
filname=STRING|"C:\Documents and 
Settings\8over8qa\Desktop\RoboTaskPreBuildStatus.txt"
line0=STRING|"Status : {{BUILDSTATUS}}"
line1=STRING|"Date : {DateTime}"
linecount=STRING|"2"

[Actions\Action5]
ActionID=STRING|"A_TASKS_STOP"
Enabled=INTEGER|-1
Name=STRING|"Stop Task ""Full Install Task"""
Params=FOLDER

[Actions\Action5\Params]
taskid=STRING|"960106963"

[Actions\Action6]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to stop Robotask execution...

Post by Oleg »

Look at the 3-d step, please.
1-st operand: {BUILDSTATUS}
it's correct

2-nd operand should be: Failure.txt
without brackets {}
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to stop Robotask execution...

Post by Oleg »

You should use {} only if you need to use some variable in expression.
jarlatheoin
Posts: 4
Joined: Mon Jan 24, 2011 12:56 am

How to stop Robotask execution...

Post by jarlatheoin »

Hi Oleg,

Thank you for this, much appreciated...

This now seems to be entering the "if" logic as i would
expect but it will not halt the execution of the robotask
even though a "Stop Task" step has been used...

I am maybe a little confused in the best approach to halt
the whole execution process...

Regards,

Jarlath
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

How to stop Robotask execution...

Post by Oleg »

Stop task action only stops the specified task.
If you want to close RoboTask at all, look at "Exit RoboTask" action (in the RoboTask Commands group)
jarlatheoin
Posts: 4
Joined: Mon Jan 24, 2011 12:56 am

How to stop Robotask execution...

Post by jarlatheoin »

Thank you once again Oleg..

I believe i at one time or another had all of the
ingredients to make this step work but managed to avoid
getting them in place all at the one time...

Regards,

Jarlath
Post Reply