Check for holiday

Post comments and suggestions for RoboTask here
Post Reply
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Check for holiday

Post by Rukbunker »

Hai Oleg,

I have a question related to http://robotask.com/forum/viewtopic.php ... days#p1815.

We have a task which runs every day, except the weekends. But, the task should not be executed on a holiday. Ofcourse, Robotask doesn't know when a holiday "takes place", so I solved it by a simple If date = DD-MM-YYYY then stop task. Works fine, but I have to edit it every time a new holiday will come.

For sure there is an option that he checks a text or XML file for any content (= holidays for a whole year) and if the date of today is a date which is in the file mentioned, he should stop the task.

Can you please explain ?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Check for holiday

Post by Oleg »

See this example (see below):
You can create the list of holidays and simply stop the task if today is holiday date.

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
ExternalName=STRING|"Task88"
Hide=INTEGER|0
ID=INTEGER|1750422847
LogOnAsUser=INTEGER|1
Name=STRING|"exclude holidays"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0

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

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create local variable ""HOLIDAYS"" with value ""01-01-2016{EOL}08-01-2016{EOL}24-08-2016"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"0"
varkind=STRING|"1"
varname=STRING|"HOLIDAYS"
varvalue=STRING|"01-01-2016{EOL}08-01-2016{EOL}24-08-2016"

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

[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"6"
type=STRING|"0"
value1=STRING|"{DateTimeToFormat({Date},dd-mm-yyyy)}"
value2=STRING|"{holidays}"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Today is holiday. Exiting."""
Params=FOLDER

[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"Today is holiday. Exiting."
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_FLOW_EXIT"
Enabled=INTEGER|-1
Name=STRING|"Exit"

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

[Actions\Action6]
ActionID=STRING|"A_ROBOTASK_ALERT"
Enabled=INTEGER|-1
Name=STRING|"Show Notification"
Params=FOLDER

[Actions\Action6\Params]
defh=STRING|"1"
defw=STRING|"1"
duration=STRING|"5"
height=STRING|"76"
icon=STRING|"3"
kind=STRING|"0"
message=STRING|"Place your actions here"
position=STRING|"3"
title=STRING|"Normal working"
width=STRING|"330"

Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Oleg Yershov
Rukbunker
Posts: 192
Joined: Mon Feb 22, 2016 4:06 pm
Location: Netherlands

Re: Check for holiday

Post by Rukbunker »

Many thanks, it works perfectly.
Post Reply