Quit Breaking Functions with New Versions

Discuss RoboTask here

Quit Breaking Functions with New Versions

Postby photofrog » Wed Mar 04, 2020 5:37 pm

Hi,

The migration to CEF Web Page and taking out the Web plugin, broke a whole lot of tasks. Perhaps there is a smoother way to do it. I suppose that if you are replacing a legacy function with a new one and they are similiar in structure, there ought to be a way to write the conversion from old function to new function into the update process.

Now I see that the Evaluate function is the same way. That too you should be able to "convert" the legacy function to the new one during the update process.

Upgrading RoboTask is becoming very time consuming and labor expensive if we have to manually correct all the affected tasks.

Is there a better way?

Thanks.

David
photofrog
 
Posts: 7
Joined: Mon Apr 01, 2013 9:49 pm

Re: Quit Breaking Functions with New Versions

Postby photofrog » Wed Mar 04, 2020 7:50 pm

Now the VB Script syntax has changed?

Now I am getting Error: Line number 2 (71), Cannot use parentheses when calling a Sub

Is the VB RoboTaskApp part of the help file updated? I see one way being RoboTaskApp.AddVariableName() and RoboTaskApp().AddVariableName().

What is the syntax now of the following...

RoboTaskApp.AddUserVariable("G_DIR_IIS_PUBLIC", "\\MALCOM\Inetpub")
RoboTaskApp.AddUserVariable("G_DIR_IIS_PRIVATE", "\\MALCOM\Inetprivate")

Thank you.

David
photofrog
 
Posts: 7
Joined: Mon Apr 01, 2013 9:49 pm

Re: Quit Breaking Functions with New Versions

Postby Oleg » Thu Mar 05, 2020 11:28 am

What is the syntax now of the following...

RoboTaskApp.AddUserVariable("G_DIR_IIS_PUBLIC", "\\MALCOM\Inetpub")
RoboTaskApp.AddUserVariable("G_DIR_IIS_PRIVATE", "\\MALCOM\Inetprivate")


write this:
RoboTaskApp.AddUserVariable "G_DIR_IIS_PUBLIC", "\\MALCOM\Inetpub"
RoboTaskApp.AddUserVariable "G_DIR_IIS_PRIVATE", "\\MALCOM\Inetprivate"


Actions VB Script and VB Evaluate use system built-in script engine
Oleg Yershov
Oleg
Site Admin
 
Posts: 2511
Joined: Thu Jan 01, 1970 1:00 am

Re: Quit Breaking Functions with New Versions

Postby Oleg » Thu Mar 05, 2020 12:25 pm

The migration to CEF Web Page and taking out the Web plugin, broke a whole lot of tasks.

Web documents plugin is available up to version RoboTask 7.6. >>You can find necessary files here<<
We can no longer support this plugin because the necessary components and browser engine are no longer developing.
You can try to covert Web documents action to Chromium actions. But note that these actions are not fully compatible in terms of parameters
TSK files are simple text files, so you can make changes in text editor.

Do the following:
    1. Stop RoboTask
    2. Backup task folder
    3. Find tasks containing WEB documents actions. These tasks contains these strings A_WD_FILLFORM, A_WD_WAITFORDONE, A_WD_PAGEINFO.
    For example such line: ActionID=STRING|"A_WD_FILLFORM"
    4. Make such substitutions:
      A_WD_FILLFORM --> A_CEF_WEBFORM
      A_WD_WAITFORDONE --> A_CEF_WAITFORDONE
      A_WD_PAGEINFO --> A_CEF_PAGEINFO
    5. Start RoboTask and check changed tasks

Note again: Chromium and WEB documents actions are not fully compatible in terms of parameters. You have to re-check and re-test changed tasks and make necessary corrections
Oleg Yershov
Oleg
Site Admin
 
Posts: 2511
Joined: Thu Jan 01, 1970 1:00 am

Re: Quit Breaking Functions with New Versions

Postby photofrog » Thu Mar 05, 2020 3:06 pm

Hi Oleg,

Thank you very much. Anything you can do to convert legacy functions to newer functions in newer versions would be appreciated.

We have over 300 active tasks. Some of these changes wreaks havoc on our "robot".

Good day!

David W.
photofrog
 
Posts: 7
Joined: Mon Apr 01, 2013 9:49 pm

Re: Quit Breaking Functions with New Versions

Postby Oleg » Tue Mar 10, 2020 6:17 pm

I created the task which helps you to convert tasks and make necessary substitutions
The task saves corrected task files into separate folders.
Next you can import into RoboTask as additional tasks and review them in task editor.
You can test them and make necessary changes if needed.

The task is below. Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task249"
Hide=INTEGER|0
ID=INTEGER|-424157683
LogOnAsUser=INTEGER|1
Name=STRING|"convert ""WEB documents"" actions to ""Chromium"" actions"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|2
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action2=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 ""DEST"" with value ""{TempDir}\corrected-tasks"""
Params=FOLDER

[Actions\Action1\Params]
expand=STRING|"1"
varkind=STRING|"1"
varname=STRING|"DEST"
varvalue=STRING|"{TempDir}\corrected-tasks"

[Actions\Action10]
ActionID=STRING|"A_STR_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"STR Replace (A_WD_WAITFORDONE --> A_CEF_WAITFORDONE)"
Params=FOLDER

[Actions\Action10\Params]
case=STRING|"0"
mode=STRING|"0"
replacement=STRING|"A_CEF_WAITFORDONE"
source=STRING|"{#tsk}"
substring=STRING|"A_WD_WAITFORDONE"
variable=STRING|"tsk"

[Actions\Action11]
ActionID=STRING|"A_STR_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"STR Replace (A_WD_PAGEINFO --> A_CEF_PAGEINFO)"
Params=FOLDER

[Actions\Action11\Params]
case=STRING|"0"
mode=STRING|"0"
replacement=STRING|"A_CEF_PAGEINFO"
source=STRING|"{#tsk}"
substring=STRING|"A_WD_PAGEINFO"
variable=STRING|"tsk"

[Actions\Action12]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {Dest}\{ExtractFileName({TaskFile})}"
Params=FOLDER

[Actions\Action12\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{Dest}\{ExtractFileName({TaskFile})}"
line0=STRING|"{#tsk}"
linecount=STRING|"1"
suppress=STRING|"1"

[Actions\Action13]
ActionID=STRING|"A_VARIABLES_INCREMENT"
Enabled=INTEGER|-1
Name=STRING|"Increment variable ""cnt"""
Params=FOLDER

[Actions\Action13\Params]
incement=STRING|"1"
vaiable=STRING|"cnt"

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

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

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

[Actions\Action16\Params]
message=STRING|"found {cnt} tasks"
type=STRING|"3"

[Actions\Action17]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Found and corrected {cnt} files"""
Params=FOLDER

[Actions\Action17\Params]
icon=STRING|"1"
msg0=STRING|"Found and corrected {cnt} files"
msg1=STRING|"Corrected tasks are in folder:  {Dest}"
msg3=STRING|"You can import these tasks and test them"
msgcount=STRING|"4"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""CNT"" with value ""0"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varname=STRING|"CNT"
varvalue=STRING|"0"

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

[Actions\Action3\Params]
message=STRING|"************** begin **************"
type=STRING|"3"

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

[Actions\Action4\Params]
createmode=STRING|"1"
date1=STRING|"20200310"
date2=STRING|"20200310"
destvar=STRING|"TASKFILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{TaskFolder}\*.tsk"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER

[Actions\Action5\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
file=STRING|"{TaskFile}"
linecount=STRING|"0"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"(?i)ActionID=STRING\|""(A_WD_FILLFORM|A_WD_WAITFORDONE|A_WD_PAGEINFO)"""
savesubexpression=STRING|"0"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
ungreedy=STRING|"0"
useexternal=STRING|"1"
variable=STRING|"found"

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

[Actions\Action6\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{found}"

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

[Actions\Action7\Params]
message=STRING|"{taskFile}"
type=STRING|"3"

[Actions\Action8]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TSK"" with value ""{#TextFile({TaskFile})}"""
Params=FOLDER

[Actions\Action8\Params]
expand=STRING|"1"
varname=STRING|"TSK"
varvalue=STRING|"{#TextFile({TaskFile})}"

[Actions\Action9]
ActionID=STRING|"A_STR_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"STR Replace (A_WD_FILLFORM --> A_CEF_WEBFORM)"
Params=FOLDER

[Actions\Action9\Params]
case=STRING|"0"
mode=STRING|"0"
replacement=STRING|"A_CEF_WEBFORM"
source=STRING|"{#tsk}"
substring=STRING|"A_WD_FILLFORM"
variable=STRING|"tsk"

Oleg Yershov
Oleg
Site Admin
 
Posts: 2511
Joined: Thu Jan 01, 1970 1:00 am

Re: Quit Breaking Functions with New Versions

Postby photofrog » Wed Mar 11, 2020 4:06 pm

Nice! Thanks.

I have it all converted now. But this would be great for future version migrations.

Cheers!

David
photofrog
 
Posts: 7
Joined: Mon Apr 01, 2013 9:49 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 11 guests

cron