I am currently performing an assignment and entering some details. On submit of the assignment I want a word document to be generated capturing all the details entered in the previous assignment. It should also get attached to the work object.
Call the pega_appdefinition_documentapp.pzGenerateDocument pass template,class names.Above function returns the url of the file generated in server temp folder path then
write java logic to read file stream using file url
Get the filename from the returned i.e pega_rules_string.whatComesAfterLast(url, '/');
Open file using pega.getStaticContentUtils().getServiceExportRoot(); + filename and read the stream.
Use filestream as your pyAttachStream for your attachment page and set other properties for attachment page