OUTSPCORELIB
This library develops the component code and flows for web services and general applications. It includes functions with date and time processing and string processing capabilities, as well as database and file operations.
This section provides a list of the functions included in the library, along with their usage details.
setVariable
Stores/sets the value provided in the test data Value1 column into a global variable specified in the OP Variable Name column, so it can be used across the flow.
Example:
setVariable (String valueToBeStored)
 
Input Parameters:
valueToBeStored - value to be set/stored into a variable
Return Type: String
getCurrentTimeInMilliSeconds
Gets the time in milliseconds.
Example:
getCurrentTimeInMilliSeconds ()
 
Input Parameters : <none>
Return Type : Sting
Randomstring
Generates a random string of random size and stores it into a global variable specified in the OP Variable Name column.
Example:
randomstring ()
 
Input Parameters : <none>
Return Type : String
compare2Strings
Compares two strings and returns a boolean result based on the result of comparison which gets stores it into a global variable specified in the OP Variable Name column.
Note: This function returns “True” if strings provided are same. Else, it returns ‘False’.
Example:
compare2Strings (String_stringA, String_stringB)
 
stringA - The first String to be compared
stringB - The second String to be compared to stringA
Return Type: String
randomNumberUsingDateTime
Generates a random string with date and time in it and stores it into a global variable specified in the OP Variable Name column.
Example:
randomNumberUsingDateTime()
 
Input Parameters : <none>
Return Type : String
getCurrentDateTimeWithGivenDateFormat
Gets the current date and time in the specified format and stores it into a global variable specified in the OP Variable Name column.
Example:
getCurrentDateTimeWithGivenDateFormat(String dFormat)
dFormat- Java date formats are supported
 
dFormat - The format of the date output by the function
Return Type: String
getDateDiffInSecsWithGivenDateFormat()
Takes a start date and end data as and the corresponding data format as input parameters and calculates the difference between the dates in seconds and stores it into a global variable specified in the OP Variable Name column.
Example:
getDateDiffInSecsWithGivenDateFormat("12-13-2014", "12-29-2014", "mm-dd-yyy")
 
Input Parameters:
dateStart - The start date for calculating the difference
dateEnd - The end date for calculating the difference
dFormat - the format of the date in which start and end dates have been specified.
 
Return Type: String
getAdjustedTimeWithGivenDateTime
Calculates a date based on the specified date and an offset(adds or subtracts to the specified date) along with the dateformat, gets the adjusted time and stores it into a global variable specified in the OP Variable Name column.
Usage:
getAdjustedTimeWithGivenDateTime(String dateTime, String offset, String dFormat)
 
Example:
getAdjustedTimeWithGivenDateTime("12-13-2014", "-02:30","mm-dd- yyyy")
 
Input Parameters:
dateTime - The datetime to which the offset needs to be added. offset - The offset of time in hh:mi format that needs to be added to the given datetime.
dFormat - The format of the dateTime input parameter
 
Return Type: String
getAdjustedTimeWithCurrentDateTime
Calculates the date and time after adding the specified offset to the current date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Example:
getAdjustedTimeWithCurrentDateTime(String offset, String dFormat)
getAdjustedTimeWithCurrentDateTime("-2.30", "mm-dd-yyyy")
 
Input Parameters: String dateTime, String offset, String dFormat
Return Type: String
getAdjustedTimeWithGivenDateAndTime
Calculates the date and time after adding the specified offset to specified date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Usage:
getAdjustedTimeWithCurrentDateTime(String offset, String dFormat)
 
Example:
getAdjustedTimeWithCurrentDateTime("-2.30", "mm-dd-yyyy")
 
Input Parameters:
Offset - The offset to be added to the current date time, specified in hh:mi format
dFormat - The format in which the function should output the datetime
 
Return Type: String
getAdjustedTimeWithGivenDateAndTime
Calculates the date and time after adding the specified offset to specified date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Usage:
getAdjustedTimeWithGivenDateAndTime(String cuDate,String cuTime,String offset, String dFormat)
 
Example:
getAdjustedTimeWithGivenDateAndTime("12-13-2014","12:15:00","-
2.30", "mm-dd-yyyy")
 
Input Parameters:
cuDate - The date provided as input
cuTime - Time provided as input
offset - Offset to be added to the date time
dFormat - The format of the date time that the function needs to output in
 
Return Type: String
addDaysToCurrentDateWithGivenFormat
Calculates the date and time after adding the specified number of days to current date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Example:
addDaysToCurrentDateWithGivenFormat(String noOfDays, String dFormat)
addDaysToCurrentDateWithGivenFormat("45", "mm-dd-yyyy")
Input Parameters: String noOfDays, String dFormat
Return Type: String
waitForTime
Pauses the flow run for the time duration specified, in minutes.
Usage:
waitForTime(String strWaitTimeInMinutes)
 
Example:
waitForTime("15")
 
Input Parameters:
String strWaitTimeInMinutes - The duration to pause a flow run, specified in minutes.
Return Type: void
addDaysToAGivenDate
Adds days to the specified date and stores the output into a global variable specified in the OP Variable Name column.
Usage:
addDaysToAGivenDate(String date, String noOfDays)
 
Example:
addDaysToAGivenDate("12-13-2014", "19")
 
Input Parameters:
Date - The date to which the number of days have to be added noOfDays - number of days to be added to the provided date
 
Return Type: String
randomNumber
Adds days to the specified date and stores the output into a global variable specified in the OP Variable Name column.
Example:
randomNumber()
Input Parameters: <none>
Return Type: String
setVariableValueUsingListIndex
Handles the retrieval of individual values from repeating elements in a comma separated list. The function retrieves the value based on the list index passed. It retrieves the value from the list which matches the specified index and stores the output into a global variable specified in the OP Variable Name column. The parameters passed are global variable (gVar1)/comma separated list and index value. This function is designed to be used in conjunction with other functions that allow for retrieving repeating elements from the response XML.
Usage:
setVariableValueUsingListIndex(String listVariableName,String index)
 
Example:
setVariableValueUsingListIndex("data1,data2,data3", 2) - Retrieves data2
 
Input Parameters:
listVariableName - List of values separated by comma
index - Index number of the value in the list that needs to be retrieved
 
Return Type: String: Value
appendStrings
Concatenates strings provided in the parameters and stores the output into a global variable specified in the OP Variable Name column. The default input values to this function are 6 parameters. To concatenate less than 6 strings, provide #EMPTY against the parameters which do not hold any string.
Usage:
appendStrings (String strValue1, String strValue2, String strValue3, String strValue4, String strValue5, String strValue6
 
Input Parameters:
strValue1 - The base string
strValue2 - The string to be appended to strValue1
strValue3 - The string to be appended to strValue1+strValue2 strValue4 - The string to be appended to strValue1+strValue2+strValue3
strValue5 - The string to be appended to strValue1+strValue2+strValue3+strValue4 strValue6 - The string to be appended to
strValue1+strValue2+strValue3+strValue4+strValue5
Return Type: String
getCurrentMonth
Retrieves the current month and stores the output into a global variable specified in the OP Variable Name column.
Example:
getCurrentMonth()
 
Input Parameters: none
Return Type: String
readAttachmentAsString
Retrieves the content of the attachment file whose name is specified as the input parameter and stores the content into a global variable specified in the OP Variable Name column.
Example:
readAttachmentAsString(String Filename)
 
Input Parameters: Name of the attachment file that needs to be read
Return Type: String