Genesys CTI User Forum
Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: runarM on May 25, 2007, 12:43:21 PM
-
Hi.
Is it possible to define an action where a certain stat-value could be exportet to a file or db from CCPulse? E.g every minute a certain statvalue is written to a file (which again could be exported via ftp or something)
We need a quick-fix for this, so I guess it would be easy to implement if possible in CCPulse.
RunarM
-
yes you can do that..
I have done similar setup in our company.
Basically I send Service Level to Oracle db. Whenever SL changes in CCpulse, threshold will trigger a script and update SL table in the DB.
You need to use VB Script code to do this....
Let me know if you need help.
-
To make your life easy... I have put a sample script.
Create a new Threshold and past the following script in it.
Action script doesn't need to have anything special, you can just change the color.
----------------------------------------------
if Threshold.StatValue >= 0 then
On Error Resume Next
Skill_Name="Employee_Phone"
Connection_String = "driver={Microsoft ODBC for Oracle};SERVER=<dbsid>;UID=<dbid>;PWD=<dbpassword>;"
Set conn = CreateObject("ADODB.Connection")
conn.Open Connection_String
set rs = CreateObject("adodb.recordset")
sql2="update service_level_table set service_level='"&Threshold.StatValue&"' where skill_name='"&Skill_Name&"'"
rs = conn.Execute(sql2)
Set rs = nothing
conn.close
set conn = nothing
Threshold.Result = true
end if
----------------------------------
-
Sorry to ask, but in which scenario you will want to do this? Why data on the DataMart DB is not enought?
Just curious ;D
-
cavagnaro - you could then build a softwallboard which can be displayed on desktops.
That is one scenario.
-
Mark is right.
Actually genesys recommended way is use GIS.
But you need license for GIS and...etc. but in this way you can do it in house.
Datamart and other stuffs are for historical, this is for real time.
-
Very good example :)
Thanks
-
Thanks a lot!
The scenario is actually what mentioned; we need realtime-statistics for displaying on a webpage. Actually, we have a GIS-license, but this is a short-term solution until we get it up running.
-
Runar, have you tried Quest wallboard server? I got it from this forum and because it is using an active X component which can be plugged into a webpage, we now have our wallboard functionality totally covered by it.
Jeff
-
[quote author=Jeff link=topic=2253.msg8200#msg8200 date=1180427843]
Runar, have you tried Quest wallboard server? I got it from this forum and because it is using an active X component which can be plugged into a webpage, we now have our wallboard functionality totally covered by it.
Jeff
[/quote]
Shockingly I never kept track of what was happening with Quest!
How easy is it to implement the plugin to a webpage?
Mark
-
[quote author=Jeff link=topic=2253.msg8200#msg8200 date=1180427843]
Runar, have you tried Quest wallboard server? I got it from this forum and because it is using an active X component which can be plugged into a webpage, we now have our wallboard functionality totally covered by it.
Jeff
[/quote]
No, I have not actually, but that could maybe work from what i read. Couldnt find a link or email?
-
Hi all, i ve tried to use Mark's code but it doesnt works for me :(
----------------------------------
if Threshold.StatValue >= 3 then
On Error Resume Next
Connection_String = "driver={Microsoft ODBC for Oracle};SERVER=GTRIT;UID=fioritom;PWD=a1b2c3d4;"
Set conn = CreateObject("ADODB.Connection")
conn.Open Connection_String
set rs = CreateObject("adodb.recordset")
sql2="Insert Into GTRIT.dbo.test (StatGuardado) Values ('"&Threshold.StatValue&"') "
rs = conn.Execute(sql2)
Set rs = nothing
conn.close
set conn = nothing
Threshold.Result = true
end if
----------------------------------------------
Ive tried to write servername as "2PEC0043\GTRIT" (Local pc name is 2PEC0043) and also ".\GTRIT" but it doesnt work either. Im using CCPulse on the same PC where i got the server. I use MS SQL Server 2008 and CCPulse+ 7.5.
Anyone have and idea ? Thanks !
-
Wait what?
If you have MSSQL then why use an Oracle driver??
-
OMG, my bad. But used this one already and is the same:
Connection_String = "driver={SQL Server Native Client 10.0};SERVER=2PEC0043\GTRIT;DATABASE=GTRIT;UID=fioritom;PWD=a1b2c3d4;"
And also tried "SQL Server".
-
So ODBC libraries are installed?
Via ODBC on Control Panel, does it work?
-
I've been working on something similar whilst we work on getting SDK installed. I've ended up with the following Excel Macro that I use to save all the active CCPulse windows in .HTML format. After that you can import these into whatever format you prefer for your final report.
[code]
Sub CCPulse_Save_Windows()
'should add a check that only one CCPulse instance is running
'set a variable as CCP_window so we can run a loop and count repeats
Dim CCP_window As Integer
CCP_window = 1
'move focus to CCPulse
AppActivate "CCPulse+"
'run loop to save all 8 windows
'do until used in case of a problem so we don't get an infinite loop
Do Until CCP_window = 10
'on 9th loop we want to go back to excel so we add this here
If CCP_window = 9 Then GoTo RESET
'save windows 1-8 in the loop
SendKeys "%W", True
Delay 400
SendKeys CCP_window, True
Delay 400
SendKeys "%F", True
Delay 400
SendKeys "H", True
Delay 400
SendKeys "%S", True
Delay 400
SendKeys "%Y", True
Delay 400
'add one to the counter so next loop triggers next window
CCP_window = CCP_window + 1
Loop
'exit command in case we reach loop 10 and exit loop
'clear variable
CCP_window = vbNullInteger
Exit Sub
'on 9th loop we call this section of code instead of saving a window
RESET:
'move focus back to Excel
'AppActivate ("Microsoft Excel")
Workbooks("CCPulse Mailer Test.xlsm").Activate
Delay 250
Range("A1").Select
Delay 250
'reset NUMLOCK on as this is turned off by a bug with multiple sendkey commands
SendKeys "{NUMLOCK}", True
'clear variable
CCP_window = vbNullInteger
End Sub
[/code]
Notes:
- will work with up to 8 windows which is the maximum that Pulse will show in a single list
- if you have less than 8 windows adjust all the numbers in the 'Do....Loop' part of the code to match
- the code re-writes the files over existing files (that's what the 'SendKeys "%Y", True' is for) so you'll need to manually save them first for the script to work
-
Thanks a lot !, that helped a lot. I didnt know it was possible to test.
Ive found a way to do it and i share because maybe it could help another noob like me :P. My problem is at login time... i dnot know why but ill investigate a little more. THANKS A LOT AGAIN !
[i]"One way to create a quick test query in Windows via an ODBC connection is using the DQY format.
To achieve this, create a DQY file (e.g. test.dqy) containing the magic first two lines (XLODBC and 1) as below, followed by your ODBC connection string on the third line and your query on the fourth line (all on one line), e.g.:
XLODBC
1
Driver={Microsoft ODBC for Oracle};server=DB;uid=scott;pwd=tiger;
SELECT COUNT(1) n FROM emp
Then, if you open the file by double-clicking it, it will open in Excel and populate the worksheet with the results of the query."[/i]
-
[quote author=Wombat link=topic=2253.msg42396#msg42396 date=1456484576]
I've been working on something similar whilst we work on getting SDK installed. I've ended up with the following Excel Macro that I use to save all the active CCPulse windows in .HTML format. After that you can import these into whatever format you prefer for your final report.
[code]
Sub CCPulse_Save_Windows()
'should add a check that only one CCPulse instance is running
'set a variable as CCP_window so we can run a loop and count repeats
Dim CCP_window As Integer
CCP_window = 1
'move focus to CCPulse
AppActivate "CCPulse+"
'run loop to save all 8 windows
'do until used in case of a problem so we don't get an infinite loop
Do Until CCP_window = 10
'on 9th loop we want to go back to excel so we add this here
If CCP_window = 9 Then GoTo RESET
'save windows 1-8 in the loop
SendKeys "%W", True
Delay 400
SendKeys CCP_window, True
Delay 400
SendKeys "%F", True
Delay 400
SendKeys "H", True
Delay 400
SendKeys "%S", True
Delay 400
SendKeys "%Y", True
Delay 400
'add one to the counter so next loop triggers next window
CCP_window = CCP_window + 1
Loop
'exit command in case we reach loop 10 and exit loop
'clear variable
CCP_window = vbNullInteger
Exit Sub
'on 9th loop we call this section of code instead of saving a window
RESET:
'move focus back to Excel
'AppActivate ("Microsoft Excel")
Workbooks("CCPulse Mailer Test.xlsm").Activate
Delay 250
Range("A1").Select
Delay 250
'reset NUMLOCK on as this is turned off by a bug with multiple sendkey commands
SendKeys "{NUMLOCK}", True
'clear variable
CCP_window = vbNullInteger
End Sub
[/code]
Notes:
- will work with up to 8 windows which is the maximum that Pulse will show in a single list
- if you have less than 8 windows adjust all the numbers in the 'Do....Loop' part of the code to match
- the code re-writes the files over existing files (that's what the 'SendKeys "%Y", True' is for) so you'll need to manually save them first for the script to work
[/quote]
Hey !, nice solution. If cant solve it using the ODBC connection ill use this one !
Thanks a lot !
-
Well, solved it. My problem was login system. Thanks !
-
'grats ;D
Just realised that I need to add the other sub for the delay timer in that script, will do that later
-
Im interested on your script too.
How do you set it to keep running all the day ?, and also, how you set 15min of delay ?
Thanks !
-
Glad you like it. Here's the code for the delays;
[code]
'public sub to allow delayed timings to be used in other code
Public Declare Sub Delay Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
[/code]
So the sub itself is called "Delay" and the number is a wait time in Milliseconds. To pause for one second you enter a line as "Delay 1000".
If you want this to run every 15 minutes there are two options;
1. use Task Scheduler
You can use windows task scheduler to set the Excel workbook to run at a particular time of day, and every 15 minutes after. Because the CCPulse reading macro needs to interact with the screen it has to run within a normal user session. For this reason you can't have Task Scheduler call the Excel sheet directly as it runs in a hidden session. Instead use Task Scheduler to call a batch file and use that batch file to run the Excel workbook.
Batch file; open Notepad and type in 'call', then the full path to your excel book. Save this with the extension .bat and then point Task Scheduler to this file to run it.
[code]
call "c:\ProgramData\Reporting\CCPulse Reader.xlsm"
[/code]
Hint: you'll also need to set the macro up to run when the workbook is opened ;)
2. use the delay code and call the macro from within itself
Instead of using Task Scheduler you could end the earlier macro with
[code]
Delay 900000
Call CCPulse_reader
[/code]
A note of caution though... This will need to be tuned to subtract the time it takes for the main macro to run on your machine. If you don't tune it the code will run, then it will wait 15 minutes, then it will run again you will quickly lose sync with the intervals.
Remember also that the main macro will [b]overwrite[/b] the saved files so you will need to hive these off between the intervals or you'll lose them.
-
Thanks man, ill give it a try.
I couldnt make CCPulse to regulary save stats so this will save me =)
-
[quote author=Wombat link=topic=2253.msg42396#msg42396 date=1456484576]
I've been working on something similar whilst we work on getting SDK installed. I've ended up with the following Excel Macro that I use to save all the active CCPulse windows in .HTML format. After that you can import these into whatever format you prefer for your final report.
[code]
Sub CCPulse_Save_Windows()
'should add a check that only one CCPulse instance is running
'set a variable as CCP_window so we can run a loop and count repeats
Dim CCP_window As Integer
CCP_window = 1
'move focus to CCPulse
AppActivate "CCPulse+"
'run loop to save all 8 windows
'do until used in case of a problem so we don't get an infinite loop
Do Until CCP_window = 10
'on 9th loop we want to go back to excel so we add this here
If CCP_window = 9 Then GoTo RESET
'save windows 1-8 in the loop
SendKeys "%W", True
Delay 400
SendKeys CCP_window, True
Delay 400
SendKeys "%F", True
Delay 400
SendKeys "H", True
Delay 400
SendKeys "%S", True
Delay 400
SendKeys "%Y", True
Delay 400
'add one to the counter so next loop triggers next window
CCP_window = CCP_window + 1
Loop
'exit command in case we reach loop 10 and exit loop
'clear variable
CCP_window = vbNullInteger
Exit Sub
'on 9th loop we call this section of code instead of saving a window
RESET:
'move focus back to Excel
'AppActivate ("Microsoft Excel")
Workbooks("CCPulse Mailer Test.xlsm").Activate
Delay 250
Range("A1").Select
Delay 250
'reset NUMLOCK on as this is turned off by a bug with multiple sendkey commands
SendKeys "{NUMLOCK}", True
'clear variable
CCP_window = vbNullInteger
End Sub
[/code]
Notes:
- will work with up to 8 windows which is the maximum that Pulse will show in a single list
- if you have less than 8 windows adjust all the numbers in the 'Do....Loop' part of the code to match
- the code re-writes the files over existing files (that's what the 'SendKeys "%Y", True' is for) so you'll need to manually save them first for the script to work
[/quote]
Hello. I try to test this script in my Microsoft Exclel 2010(CCPulse+ 8.0.0.36), but this solution is not work. No error in script. Macros security disabled. Do I understand correctly, contents windows of the CCPulse is saved in html file? In what the folder on disk located html file ?
Script
Public Declare Sub Delay Lib "kernel32" Alias "Sleep" (ByVal dwMillisecond As Long)
Sub CCPulse_Save_Windows()
'should add a check that only one CCPulse instance is running
'set a variable as CCP_window so we can run a loop and count repeats
Dim CCP_window As Integer
CCP_window = 1
'move focus to CCPulse
AppActivate "CCPulse+"
'run loop to save all 8 windows
'do until used in case of a problem so we don't get an infinite loop
Do Until CCP_window = 10
'on 9th loop we want to go back to excel so we add this here
If CCP_window = 9 Then GoTo RESET
'save windows 1-8 in the loop
SendKeys "%W", True
Delay 400
SendKeys CCP_window, True
Delay 400
SendKeys "%F", True
Delay 400
SendKeys "H", True
Delay 400
SendKeys "%S", True
Delay 400
SendKeys "%Y", True
Delay 400
'add one to the counter so next loop triggers next window
CCP_window = CCP_window + 1
Loop
'exit command in case we reach loop 10 and exit loop
'clear variable
CCP_window = vbNullInteger
Exit Sub
'on 9th loop we call this section of code instead of saving a window
RESET:
'move focus back to Excel
'AppActivate ("Microsoft Excel")
Workbooks("CCPulse Mailer Test.xlsm").Activate
Delay 250
Range("A1").Select
Delay 250
'reset NUMLOCK on as this is turned off by a bug with multiple sendkey commands
SendKeys "{NUMLOCK}", True
'clear variable
CCP_window = vbNullInteger
End Sub
-
Hi Portal
When you lauch CCPulse and set the views you need then...
Manually go through the file > save as HTML options in CCPulse to save the first window. After that all other windows saved by the macro will go to the same folder. You need to repeat this manual save each time CCPulse is restarted otherwise the files will save to the default location.
-
Also....
Whilst my macro works really well I need to make a step change improvement to handle more windows. Is there an action script that will save all open veiws? I can use either save to html or an odbc (oracle) command.
Basic requirements are that at 'x' interval CCPulse will save the contents of all open windows (more correctly views) as .html files. If .html files are tricky is there an ODBC option?
Teaser; if I get a solution that works I'll share some extensions to my macro which extend capacity to ten views and how to import these files into excel ;-)