I am able to parse the PDF and have the Data-WorkAttach-File with the correct pyAttachStream.
However, as the parse-Structured logic occurs before the creation of the case object, the pyWorkPage.pzInsKey has not been created and therefore the Link-Objects activity method or the call to Activity Work-.AttachFile does not work because the pyWorkPage (or MyServicePage) does not have the .pzInsKey value. Doing the file listener tracing, the .pzInsKey is not set until well after the Parse-Structured logic is invoked/completed. Can someone provide any guidance on what small thing I am missing?
So I am clear, this is the scenario I would like to happen.
1. PDF is dropped in pick up folder.
2. File Listener is configured to look at that folder.
3. Upon seeing that file, File Listener will create a new case and attach the PDF to that case.
thank you for your response. That makes sense. See I figured it was something I wasn't thinking of/missing. Therefore, (for me and others to understand) In the Service File that invokes the Parse-Structured, it currently states in the processing epilog to invoke the activity (svcAddWorkObject); which as I determined gets called after the Parse-Structured (and is not linked). Therefore, I don't need the call there but rather, as you pointed out, I should probably make that call after step 4 of the Parse-Structured code. This way, I would have the proper pyWorkPage.pzInsKey value to properly link the objects and the linking would occur properly, and the attachment would show up as expected.
Ran through the steps as described above and as you pointed out and expected. Works like a charm!