Cisco Cisco Agent Desktop 8.0 信息指南

下载
页码 2
Obtain the Current Date When Writing a Cisco CRS
Script
Document ID: 48141
Contents
Introduction
How to obtain the current date when you write a CRS script?
Related Information
Introduction
This document discusses how to obtain the current date when you develop a script with the help of the Cisco
Customer Response Solutions (CRS) Application Editor in a Cisco IP Contact Center (IPCC) Express Edition
environment.
Refer to Cisco Technical Tips Conventions for more information on document conventions.
Note: Cisco recommends that you have basic knowledge of CRS scripting.
Q. How to obtain the current date when you write a CRS script?
A. Java objects can be used for date comparisons. However, to do this, it is necessary to
obtain the current date. Here is the step−by−step procedure to obtain the current date:
Add a Create Java Object step (see Step 1 in Figure 1). The variable name is
dateObject
 and data type is 
Date
. The constructor is 
java.util.Date()
.
1. 
Add an Execute Java Method step to get the current year (see Step 2 in Figure 1). The
method is 
getYear()
. The result is assigned to 
currentYear
, which is an
integer variable.
Note: The getYear(0) method returns a value, which is 1900 less than the calendar
year. In order to correlate to the correct calendar year, 1900 should be added to the
returned value. This step is not shown in the sample script.
2. 
Add an Execute Java Method step to get the current month (see Step 3 in Figure 1).
The method is 
getMonth()
. The result is assigned to 
currentMonth
, which is
an integer variable.
Note: The 
getMonth(0)
 method returns 0−11 for month value. In order to
correlate to 1−12 calendar month value, 
currentMonth
 is increased by 1.
3. 
Add an Execute Java Method step to get the current date (see Step 4 in Figure 1). The
method is 
getdate()
. The result is assigned to 
currentDate
 which is an integer
variable.
4. 
Figure 1  Sample Script