var dataStruct = StructNew();
// Get the job data for the ID
var jobDataQry = application.ptImport.JobDAO.getJob(jobID=arguments.jobID);
// Get the job error data
var jobErrorQry = getJobErrors(jobID=arguments.jobID);
dataStruct.name = jobDataQry.name;
dataStruct.totalRecords = jobDataQry.recordsToRun;
dataStruct.curRecords = jobDataQry.currentRecord;
dataStruct.errors = jobErrorQry.RecordCount;
dataStruct.status = jobDataQry.status;
dataStruct.percent = ROUND((dataStruct.curRecords/dataStruct.totalRecords) * 100);
return dataStruct;
// Get the job data
var jobData = application.ptImport.JobDAO.getJob(jobID=arguments.jobID);
// Set to CE Data array
var jobDataArray = application.ptImport.cedata.buildCEDataArrayFromQuery(ceDataQuery=jobData);
// Build the new data struct
var jobStruct = StructNew();
if ( ArrayLen(jobDataArray) ){
// Update the data fields with the new data
jobStruct = jobDataArray[1].Values;
jobStruct.datapageid = jobDataArray[1].pageid;
jobStruct.status = arguments.status;
// Check if we need to set the current record
if ( arguments.currentRecord GT 0 )
jobStruct.currentRecord = arguments.currentRecord;
// Check if the job is complete
if ( jobStruct.recordsToRun EQ jobStruct.currentRecord )
jobStruct.status = "Complete";
// if the status is complete, then set the end date/time
if ( jobStruct.status EQ "Complete" ){
jobStruct.endDateTime = request.formattedTimeStamp;
}
// Set the job data
return application.ptImport.JobDAO.setJob(jobData=jobStruct);
}
else {
// TODO - Update the error caught
return false;
}
return true;
// Get the job item data
var jobItemQry = application.ptImport.JobDAO.getJobItem(jobID=arguments.jobID, dataID=arguments.dataID);
var jobItemStruct = StructNew();
// Check if we have item data to update
if ( jobItemQry.RecordCount ){
// Update the data fields with the new data
jobItemStruct.ID = jobItemQry.ID;
jobItemStruct.jobid = jobItemQry.jobid;
jobItemStruct.dataID = jobItemQry.dataID;
jobItemStruct.StatusID = arguments.status;
jobItemStruct.complete = 0;
// Set the job item data
return application.ptImport.JobDAO.setJobItem(jobItemData=jobItemStruct);
}
return false;
var itemData = StructNew();
var jobItemQry = QueryNew("null");
if ( LEN(arguments.jobID) AND LEN(arguments.dataID) ) {
// Loop over the list of dataIDs
for (j=1; j LTE ListLen(arguments.dataID); j=j+1){
// Set the data
itemData = StructNew();
itemData.jobID = arguments.jobID;
itemData.dataID = ListGetAt(arguments.dataID, j);
itemData.statusID = "scheduled";
itemData.complete = 0;
// Set the job item record
application.ptImport.JobDAO.setJobItem(jobItemData=itemData);
}
return true;
}
return false;
var jobItemQry = application.ptImport.JobDAO.getJobItem(jobID=arguments.jobID);
var jobItemErrQry = QueryNew("null");
SELECT *
FROM jobItemQry
WHERE (statusID LIKE 'Error:%') OR (statusID LIKE 'error:%')
// Get the job data
var jobDataQry = application.ptImport.JobDAO.getJob(jobID=arguments.jobID);
// Check if we have data
if ( jobDataQry.RecordCount ){
// Return the job type data
return application.ptImport.JobDAO.getJobType(typeID=jobDataQry.typeID);
}
// No data so return an empty query
return QueryNew("null");
var jobTypeData = ArrayNew(1);
var jobDataQry = QueryNew("null");
// Get the job type ID for the job type name
jobTypeData = application.ptImport.JobDAO.getJobType(typeName=arguments.jobTypeName,typeID=arguments.jobTypeID);
// Check that we got the job filter
if ( jobTypeData.RecordCount )
jobDataQry = application.ptImport.JobDAO.getJob(jobType=ValueList(jobTypeData.ID));
return jobDataQry;
// Call the job controller to get the data out
var jobDataQry = getFilteredJob(jobTypeName=arguments.jobTypeName);
var filterDataQry = QueryNew("null");
SELECT *
FROM jobDataQry
ORDER BY startDateTime DESC
var retMsg = arguments.currMsg;
if ( LEN(retMsg) ){
// Append the new message
retMsg = retMsg & "
" & arguments.newMsg;
}
else {
retMsg = arguments.newMsg;
}