Check Status of Tasks

Discuss RoboTask here
Post Reply
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Check Status of Tasks

Post by Rukbunker »

Hey Oleg,

Sometimes it happens (due to maintenance or testing or whatever) that a task is being disabled. This is fine, however sometimes a person forgets to re-enable it. This can have serious consequences ;)
Through the action "Task status" this can be checked, which is really cool. We have 1 specific folder in Robotask where all the tasks located in there should be enabled.

Is it possible to check a whole folder for all the tasks or do we have to specify them one by one? Do you have some good ideas?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Check Status of Tasks

Post by Oleg »

Look at my example
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Put it into some task folder and run it

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1349"
Hide=INTEGER|0
ID=INTEGER|-1106023643
LogOnAsUser=INTEGER|1
Name=STRING|"check enabled"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

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

[Actions\Action1]
ActionID=STRING|"A_SCRIPT_VBSCRIPT"
Enabled=INTEGER|-1
Name=STRING|"VB Script"
Params=FOLDER

[Actions\Action1\Params]
expandvars=STRING|"0"
line00000000=STRING|"c = cstr(RoboTaskApp.ExpandText(""{TaskCategoryID}""))"
line00000001=STRING|"'logmessage(c)"
line00000002=STRING|"cnt = RoboTaskApp.TaskCount"
line00000003=STRING|"txt = """""
line00000004=STRING|"for i=0 to cnt-1 step 1"
line00000005=STRING|"  c1 = cstr(RoboTaskApp.TaskInfoFolderID(i))"
line00000006=STRING|"  if c1 = c then"
line00000007=STRING|"    'logmessage(c1)"
line00000008=STRING|"    ext = RoboTaskApp.TaskInfoExtname(i)"
line00000009=STRING|"    if not RoboTaskApp.TaskEnabled(ext) then"
line0000000A=STRING|"      nam = RoboTaskApp.TaskInfoName(i)"
line0000000B=STRING|"      txt = txt + nam + VbCrLf"
line0000000C=STRING|"    end if"
line0000000D=STRING|"  end if"
line0000000E=STRING|"next"
line00000010=STRING|"RoboTaskApp.setuservariable ""disabled"", txt"
linecount=STRING|"19"
savescript=STRING|"0"

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

[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"7"
type=STRING|"0"
value1=STRING|"{disabled}"

[Actions\Action3]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action3\Params]
message=STRING|"All tasts in folder are enabled"
type=STRING|"3"

[Actions\Action4]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action5]
ActionID=STRING|"A_ROBOTASK_LOG"
Enabled=INTEGER|-1
Name=STRING|"Log Message"
Params=FOLDER

[Actions\Action5\Params]
message=STRING|"Disabled tasks: {eol}{disabled}"
type=STRING|"2"

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

Oleg Yershov
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Check Status of Tasks

Post by Rukbunker »

Wow, that works great! Thanks!
Post Reply