Here's a more illustrated example of how to do this:
1. I am using PRPC Data Page here: just for ease of generating some data (I just took the data from Wikipedia - used EXCEL to format as CSV and then used the handy (but a bit fussy) 'Import CSV' function to import the record data)
To test the HTM rule: I just hit preview (this will work because the input PAGE is already built and available):
Now we can convert this to PDF using a 'wrapper' activity - and then use the 'Code-Pega-PDF' activities to VIEW it (for testing) and then finally to attach it to an existing work item.
[Note: I have setup defaults params here: and that includes a InsHandle (mentioned later) - this will be different on your system]
Note: I'm using the option "Pass current parameter page" here for both calls to HTMLTOPDF and VIEW - and then I have created 'shadow' parameters for what I need on the wrapper activities PARAMETER itself.
This just makes thing a little easier (in my view) to put together.
First we test that we can generate the PDF - and just download it (no attaching going on here yet).
We have a param (ready for attachToWork) called 'InsHandle' : but we are not yet using it : leave it blank.
The PDF is created and can be viewed:
Now we need a Work Item to test with: I just logged into a User Portal and created one:
So we make a note of it's WORK ID (M-49) - so we can use it as the "InsHandle" for our Activity.
My Work Pool is "AT-TESTATTACH-WORK" - so we combine that with the specific work item to get the InsHandle we want : "AT-TESTATTACH-WORK M-49"
We modify our activity and change the VIEW call to AttachToWork (and add the default param in for InsHandle for convenience):
And re-run it : this time we do need an InsHandle.
This time, no PDF is downloaded from the BROWSER : instead we just get the standard 'Status: good' message:
(by the way: this is what you get even if the InsHandle was incorrect, so be careful of the false positive here when testing!)
Now we go back to the User Portal : and refresh the same work item: we can see it has an attachment (or in my case , several, since I have been testing!)
Thank you for posting your query on PSC. This looks like an inactive post and hence, we suggest you create a new post for your query. Click on the Write a Post button that’s available on the top right pane of this page. Once created, please reply back here with the URL of the new post.
We have also sent you a private message opening up a communication channel in case you have any further questions.