Question
Unitedhealth Group, Inc.
US
Last activity: 14 Oct 2017 15:58 EDT
Displaying a Document from Documentum within PRPC 7.2.2 application
I am calling a Documentum SOAP Service to get a document back (MTOM) and I want to display this document in the proper windows tools so for example if it is a text file then display in notepad from Pega.
I have tried used tools.sendfile() but it doesn't seem to do anything. No window pops up from my application. I have a button on the harness and it calls an activity that calls tools.sendfile()
I have also tried using Open URL in window as a click action on the button. A window pops up but it displays an error saying there is no content even though the property I specify on the action for window name does have the document contents.
Anyone know how I can achieve what I need to here?
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Optum
US
We are having a similar problem. We tried checking the encoding of the document, still no luck. Also we are able to open the document using SOAP UI. Have you tried that?
Our issue isn't resolved yet...
Pegasystems Inc.
US
The "Window name" field does just as it says. It is for setting the name of the window that pops up, not for putting the contents into!
You should try doing open URL in window, and set the activity name field to be your activity that calls tools.sendFile(...)
Unitedhealth Group, Inc.
US
Yes you are right . I received the wrong advice but I've also been trying to use send file and it does nothing. I run an activity in studio that does send file and it pops a window up displaying contents in ie. It doesn't ask if I want to open the doc or save it. In my application I trigger it from a button click and the send file does absolutely nothing as far as visible eye can see.
So on the clicking of a row in a grid I call an activity from the action of the click and the activity calls a webservice and gets a document which I place in a property. I then execute a java step as follows:
String strFileData = myStepPage.getString("DocumentImage");
// If you hit save before upload, then upload with no save, you get here.
if (strFileData.length()==0) {
tools.getThread().getThreadPage().putString("pyXMLStream", "<b>This file is empty; you must hit save after upload.</b>");
pega.terminateActivity();
}
String strFileName = myStepPage.getString("FileName");
String sErrorMessage = tools.sendFile(strFileData.getBytes(),strFileName, false, null, false);
if (sErrorMessage != null){
tools.getThread().getThreadPage().putString("pyXMLStream", sErrorMessage);
}
Yes you are right . I received the wrong advice but I've also been trying to use send file and it does nothing. I run an activity in studio that does send file and it pops a window up displaying contents in ie. It doesn't ask if I want to open the doc or save it. In my application I trigger it from a button click and the send file does absolutely nothing as far as visible eye can see.
So on the clicking of a row in a grid I call an activity from the action of the click and the activity calls a webservice and gets a document which I place in a property. I then execute a java step as follows:
String strFileData = myStepPage.getString("DocumentImage");
// If you hit save before upload, then upload with no save, you get here.
if (strFileData.length()==0) {
tools.getThread().getThreadPage().putString("pyXMLStream", "<b>This file is empty; you must hit save after upload.</b>");
pega.terminateActivity();
}
String strFileName = myStepPage.getString("FileName");
String sErrorMessage = tools.sendFile(strFileData.getBytes(),strFileName, false, null, false);
if (sErrorMessage != null){
tools.getThread().getThreadPage().putString("pyXMLStream", sErrorMessage);
}
I've tried many different variations and never does a window pop nor a dialog at the bottom asking if I want to open or save it. I've also tried some simpler scenarios where I hard code the document and don't call a webservice and still nothing.
Pegasystems Inc.
US
I believe one of the boolean arguments to sendFile signifies if the file is being sent for download. You currently have all arguments set to null/false, so you are telling Pega "this is not meant for downloading."
Therefore, if you're using Internet Explorer, Pega is sending the bytes, telling IE "this is a Word document that this application wants you to see." From the sounds of it, IE is being "smart" and displaying the document to you within itself.
If you correct your logic to send the bytes "for download," then pega will set the HTTP header that tells your browser "this is a file meant for download instead of display." Your browser may then offer the "open or download?" prompt.
Unitedhealth Group, Inc.
US
I've tried many variations including setting that flag to true and still it makes absolutely no difference. Nothing comes up. My next step is to try to get fiddler I suppose and see if I can figure anything out.
I also check the return value from sendfile() and it is "null" so it looks like it thinks it worked.
I did submit an SR with Pega but the came back and said my SR is about "how to" so they will not look at it although I disagree. So that's why I'm on the forum looking for help.
Pegasystems Inc.
US
Having that flag set to 'true' and using Open URL in Window is the only way I have seen this work.
Pegasystems Inc.
US
Step 1: Make Activity
As we're calling it from the client, we'll also have to do this:
Step 2: Configure control Action to call Activity
Don't forget to add the "Click" event to the action set!
Then have a single action of "Open URL in Window" and specify the name of your Activity in the "Activity" field.
Make sure to check the "use page" option to let the Activity use the data from the Case you are clicking on.
Step 1: Make Activity
As we're calling it from the client, we'll also have to do this:
Step 2: Configure control Action to call Activity
Don't forget to add the "Click" event to the action set!
Then have a single action of "Open URL in Window" and specify the name of your Activity in the "Activity" field.
Make sure to check the "use page" option to let the Activity use the data from the Case you are clicking on.
Step 3: Check for pop-up blocker or other security blocks.
Configure browser's pop-up blocker to allow pop-ups from Pega server, if not already done.
Make sure the browser is configured to prompt for downloads or accept them.
Step 4: Click the control
In the application, open the item that has the control (button/link, etc), and click it
If you did everything correctly, your browser will pop up a new window, and that window will attempt the file download.
Unitedhealth Group, Inc.
US
Alright. I'll give this a shot. Thanks.
Pegasystems Inc.
US
Remember to check the "use page" option on Open URL in Window. That could be how you ended up with the "no content" problem.
Unitedhealth Group, Inc.
US
-
Dharanitharan Ravindran
Unitedhealth Group, Inc.
US
Hmmm.
My activity does other things like calling a webservice to get the document back.
When I isolated your sendfile code in a separate activity with just one java step that worked.
So something else that I'm doing in my activity might be causing an issue. I'll have to narrow it down
Unitedhealth Group, Inc.
US
So I have a grid and I click on a row in the grid so it is displaying a pagelist of pages. When I specify my acitivity in OpenURLInWindow and my activity is in the class that my page is of it won't call my activity. It always looks for my activity in @baseclass which of course its not there. When I copy my activity to @baseclass it then finds that activity but ignores my activity that is in my own class. Perhaps rule resolution is messed up. I'll clear cache and restart.
Unitedhealth Group, Inc.
US
OK so I got it to work. I had to run activity before open url in window to call a webservice and then the activity on the open url in window called send file. I am quite confused why the primary page switches to the parent page seemingly when calling the activity on open url in window. I would have expected the primary page to be the page of the row on the grid I'm clicking on. Doesn't seem right. I do have a question though. It pops open a window temporarily and it disappears and then pops open the dialog at the bottom to open or save. Does it have to work that way where a window temporarily pops open?
Pegasystems Inc.
US
Unfortunately we've gone outside my area of expertise with your 2 questions:
- Does it have to work that way where a window temporarily pops open?
- Why does Open URL in Window uses the Primary page context when the control was in a row of a grid layout?
The answers to these are worth knowing.
I hope someone else can chime in here. I'll see if I can bring these to someone's attention.
Pegasystems Inc.
IN
I seemed to have this behavior when I forgot to check the "Use page" checkbox in the "Open URL in Window" configuration. Once I checked the checkbox, the Activity got properly picked up from the grid row page class. Can you check the configuration once?
Unitedhealth Group, Inc.
US
So when performing open URL in Window it appears there is no way to call the activity on it relative to the page corresponding to the row I am on on the grid/pagelist which I find bizarre. So only way I can make this work I think is to first call an activity that populates some property on a global page and then have the activity on open url in window reference this global page property to sendfile() with. I will have to try this tomorrow. It really does not seem intuitive the way this works.