Job scheduler in Pega: Generate Excel and as an attachment in email, tracing job scheduler

Описание к видео Job scheduler in Pega: Generate Excel and as an attachment in email, tracing job scheduler

PxGenerateExcel:    • OOTB Activity-2: How to read data fro...  

In jobscheduler use paramerter email and hardcode email address for sending the email.

Parameter Datatype
Email String

Local Variable
flowName string
attach Boolean
flowType string
ReferencePageName string
ReferenceClass string
ReferenceInsKey string
pyDraftMode Boolean
strFileData string

String strFileName = tools.getParamValue("OutputLocation");
PRFile objFile = new PRFile(strFileName); //some error checking
if (!objFile.exists())
{
attach = false;
} if(!objFile.isFile())
{
attach = false;
}
tools.putParamValue("OutputLocation",objFile.getName()); if (!objFile.canRead())
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. File \"" + strFileName + "\" is unreadable.");
} //read the file into a buffer.
java.io.DataInputStream dis = null;
byte buffer [] = null;
try
{
// dis = new java.io.DataInputStream(new java.io.FileInputStream(objFile));
dis = new java.io.DataInputStream(new PRInputStream(objFile));
buffer= new byte[dis.available()];
dis.readFully(buffer);
dis.close();
}
catch (Exception e)
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. Can't read File \"" + strFileName + "\"");
} //encode the file to Base64 so that we can store it on the database
strFileData = Base64Util.encodeToString(buffer);
if (strFileData == null)
{
attach = false;
throw new PRRuntimeException("Can't continue with file upload. Couldn't encode the file to Base64 so that we can store it on the database");
}

Комментарии

Информация по комментариям в разработке