CLI notification
hi,
we have recently acquired a PPI license and are working on Some Automation System using RC.
unfortunately, i can't find any docs or tutorials on how to get reports of processing steps using CLI.
are there any ways we can achieve this?
regards
-
Hello,
you can find all Command Line commands in the help in RC under ''All CLI Commands''.
The command to export a report is -exportReport .I'll give you an example.
-exportReport C:\Users\overviewreport.html Reports\Overview.html
First parameter is a path where you want to save your report together with its name.
Secon parameter is a report template, which can be found in RC folder in your computer. Just make sure to choose the right template.
Regards. -
It is possible to change Progress End Notification settings in RC. You can set up the RC to create a sound after finishing a process or to call an external program or piece of code (i.e. to write your process into an external text document). You can find more in In-App help in the section Application Settings / Progress End Notification and the setting can be found in Workflow tab / Application / Settings.
There is also a CLI command ''writeProgress'' which writes progress into an external document. -
-
How to set Progress end notification
You don’t have to check the progress bar every time, to know that the computation is done. You can tell RC to notify you by playing a sound or writing the process result into a file. You can define it in the Application settings, section “Progress end notification”.
A very simple example is to write executed file ‘my_file.bat’ like this:
echo Process %1 has finished with result code %2 in %3 seconds. > %4
And then in the “Command-line process” call the ‘my_file.bat’ file with parameters:
C:\\Users\\zuduri\\Desktop\\my_file.bat $(processId) $(processResult) $(processDuration:d) C:\\Users\\zuduri\\Desktop\\my_results.txt
Note: Use your own paths for the files.
Results will be written into the file ‘my_results.txt’. If the process finishes correctly, processResult will be 0. You can also adjust executed file to write result only for the processes finished with an error.
You can find more info in the Help, section “Application settings”.
E-mail notification
Simple example: How to send an email from Gmail after process is finished either with „success“ or „error“.
Create file ‚my_file.bat‘ like this (in the first line enter the path to your files):
cd C:\Users\user\Desktop\
if /i "%1" NEQ "0" (
PowerShell.exe -ExecutionPolicy Bypass -file ".\email.ps1" -argument "ERROR"
) else (
PowerShell.exe -ExecutionPolicy Bypass -file ".\email.ps1" -argument "SUCCESS"
)
Create file ‚email.ps1‘ like this (change your credentials):
param($argument="none")
$EmailFrom = "emailFrom@gmail.com"
$EmailTo = "emailTo@gmail.com"
$Subject = "RealityCapture process"
$Body = ("Computation finished with result:",$argument)
$SMTPServer = "smtp.gmail.com"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("username", "password");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)
In the Application settings, section Progress end notification - Command line process call the ‘my_file.bat’ like this (change to your path):
C:\Users\user\Desktop\my_file.bat $(processResult)
NOTE: You might need to change your Gmail settings allowing less secure apps to access your account.
Alternatively, you can add more parameters to the message such as process ID or process duration.
-
Please sign in to leave a comment.
Comments
5 comments