Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     reuse data between reqests within session

Read-Only Read-Only Topic
Go
Search
Notify
Tools
reuse data between reqests within session
 Login/Join
 
Member
posted
Hi, guys

I have some slow reports, and when data is retreived, I'd like to reuse it to display in differnet format, like pdf, excel or just different html presentation, i.e. different request from user.
I've got to be sure saved data will not be shared with other users, because the same fex could be called with different parameters and produce completely different data. I found some articles on techsupport site like 'How to reuse HOLD data and output to different formats?' (Case: 81541105), but it saves output in hardcoded file. Looks like it could be overriten by other session.
Is it possible to share saved file only between requests that belong to the same session?

Thanks
Victorov
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
Each agent on the WebFOCUS server has its own temporary workspace. You cannot guarantee that a new request will run with the same agent, hence with the same temporary workspace. That's why you need to save the data in a file outside the temporary workspace. The file name does not have to be "hardcoded". It could be based on the User ID, program name, or something else that can be determined the next time the request is made.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
<JG>
posted
For a particular WebFocus request the Work directory is unique.

Providing that your filedef is of the form

FILEDEF file DISK file.format

then the file will be created in that unique work area. (This does not apply for pooled deployement)

Do not filedef with Directory/Path details and you should not have a problem.

ALSO note YOU MUST NOT use the setting
SET TEMPERASE=OFF
as this means old user/temp files could still exist in the working directory.

JG
 
Report This Post
<JG>
posted
quote:
Originally posted by JG:
For a particular WebFocus request the Work directory is unique.

Providing that your filedef is of the form

FILEDEF file DISK file.format

then the file will be created in that unique work area. (This does not apply for pooled deployement)

Do not filedef with Directory/Path details and you should not have a problem.

ALSO note YOU MUST NOT use the setting
SET TEMPERASE=OFF
as this means old user/temp files could still exist in the working directory.

If you want a persistant connection then you need to call the reports via Maintain, which will keep your hold files in place and dedicated to the user.

JG
 
Report This Post
Member
posted Hide Post
Thanks for reply


JG: If I understand correctly, data will be saved the same request only, i.e. if user press button 'PDF', and another fex will run (or the same one, but with different parameters), another request wiil be issued, hence saved data will not be available?

Francis: I'm not sure if I can get session id as variable, but if it's possible I see a problem with cleanup: normally server will remove files when session ends. Is it possible to determine when files could or should be deleted?

Thanks

Victorov
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
You will need a clean-up routine. It could be Report Caster, a Windows Server utility or a UNIX utility.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Member
posted Hide Post
I see. I thought that temp directory associated with session, in this case it could be possible. I'll evaluate solution with external clean-up utility, if it's feasible.

Victor
 
Posts: 9 | Registered: November 14, 2005Report This Post
Master
posted Hide Post
Try using individual user hold directories along with the APP PREPEND command. to pre pend the users own directory onto the app path.




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Member
posted Hide Post
Is IBIC_user available inside procedure? Is there SessionID variable?
I can see a problem if user opens two sessions and run the same reports with different parameters.
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
i have the following line added to my site.wfs on the client
IBIMR_user(PASS)
in file {}:\ibi\client52\wfc\etc\site.wfs
That line addition, it seems, allows me to
reference a variable from any of my fexes, eg:
-TYPE &IBIMR_user
which will contain the user login.
I think when a .wfs is edited, you have to restart something to make it effective, but i can't quite recall;




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
What if user have more then one instance of browser open on the same report but with different parameters?
It will be same userid and fex name, but different data. I think combination of sessionid and fex should be used. I understand it will require external cleanup utility, but I can't see anything better. If so, is there any way to get session id inside fex?

Thanks
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
yes
use the TEMPPATH command




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Great, this should work. I'll try it again later
 
Posts: 9 | Registered: November 14, 2005Report This Post
Member
posted Hide Post
After I put code in place and made it work I realized it just won't work, TEMPPATH points to agent's temp directory. Agent could be changed between requests and also it might serve different sessions/users. Variable &IBIMR_user is not enough, user might have more then one instance of browser open at the same time. Session id should work, but is it possible to get it inside fex?
If not, random number generator might work, but it looks like overkill.
 
Posts: 9 | Registered: November 14, 2005Report This Post
Member
posted Hide Post
Here is how my code looks like:
-*
-*
-SET &CI_TEMP = 'd:\ibitemp\';
-*
-SET &TPATH = TEMPPATH(80, 'A80');
-* -TYPE TPATH - &TPATH
-SET &SID = GETTOK (&TPATH, 80, -2, '\', 20, 'A20V');
-* -TYPE SID - '&SID'
-SET &LEN = ARGLEN (20, &SID, 'I2');
-* -TYPE LEN - &LEN
-SET &FMT = 'A' | &LEN;
-* -TYPE FMT - '&FMT'
-SET &SID = SUBSTR (20, &SID, 1, &LEN, &LEN, '&FMT');
-TYPE SID - '&SID'
-*
-SET &HOLDDIR = &CI_TEMP | &SID | '\';
-TYPE HOLDDIR - &HOLDDIR
-*
-* Check if Directory already exists
-*
-SET &DIR_EXISTS = 0;
-*
-SET &DLIST = &CI_TEMP | &SID |'.txt' ;
DOS DIR /ABig Grin /B &CI_TEMP > &DLIST
FILEDEF INPUT DISK &DLIST
-RUN
-LOOP
-READ INPUT, &DATA
-IF &IORETURN NE 0 GOTO CONT_DIR;
-IF &DATA NE &SID GOTO LOOP;
-*
-SET &DIR_EXISTS = 1;
-*
-CONT_DIR
-*
DOS del &DLIST
-*
-IF &DIR_EXISTS EQ 1 GOTO DIR_CREATED;
-*
-TYPE Create &HOLDDIR
DOS mkdir &HOLDDIR
-*
-DIR_CREATED
-*
-*
-SET &DATFILE = &HOLDDIR || 'h_chdl.ftm';
-SET &MASSRC = &TPATH || 'h_chdl.mas';
-SET &MASDEST = &HOLDDIR || 'h_chdl.mas';
-TYPE DATFILE - &DATFILE
-*
FILEDEF HOLDMAST DIR &HOLDDIR
FILEDEF H_CHDL DISK &DATFILE
-*
-* Retreive data...
-*
TABLE FILE H_TMP
PRINT *
ON TABLE HOLD AS H_CHDL FORMAT ALPHA
END
-*
-TYPE copy /a /y &MASSRC &MASDEST
DOS copy /a /y &MASSRC &MASDEST
-*
-DATA_READY
-*
-* -TYPE DOS copy /a /y &MASDEST &MASSRC
DOS copy /a /y &MASDEST &MASSRC
-*
-* TABLE FILE H_CHDL
-* PRINT *
-* END
-*
-EXIT
-*
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
Victor
make a directory for each user
copy a final hold file (carefully named) into that user's directory.
You'ld have to make sure that the master for that hold file was on the path.
so you'ld have to tightly standardize your file and nameing conventions.
and each night, perhaps, loop thru all your user directories and erase *.*
The temppath name is the same as the tscom id, if you look at the server console.
i would recommend not using filedef holdmast
Were you to direct it to the users directory,
it would copy way too much stuff.
imho, i would copy only the final extract file,
and if you have, say, a certain fexname (eg invex01.fex)
that creates a certain extract file (say, hinvex01.ftm) then you can put the master for that standardized extract file into yourpath, and every user would than have access to their own extract file, using that standard master,
provided that you filedef it at the beginning of the fex, and check its existence.
I use
CMD STATE D:\IBI\..\{userdir}\hinvex01.ftm
-RUN
-IF &RETCODE NE 0 GOTO createit;
so..if the file doesn't exist, then branch to thepart of your program that creates it.
If it does exist, then filedef it, and branch to the part of your program that reads it.

This message has been edited. Last edited by: susannah,




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
User-specific directory is not enough - user might have more then one open session.
The best id should be browser session id. Here is another solution, using random generated id. It's overkill, as I said, but should work. In this case, I'll have to run external clean-up. It's not necessary if you use user id, temp dir size will be limited (it could be huge though).
Anyway, it not a final code, but I tested it a little bit:

-*
-*-DEFAULT &SID = 942195
-DEFAULT &SID = -1
-SET &OLD_SID = &SID;
-*
-SET &CI_TEMP = 'd:\ibitemp\';
-SET &FNAME = 'h_chdl';
-SET &TPATH = TEMPPATH (80, 'A80');
-*
-IF &SID GT -1 GOTO CHECK_DIR;
-*
-* Generate new SID
-*
-SET &SID = RDUNIF ('D6.2') * 1000000;
-TYPE SID - '&SID'
-*
-CHECK_DIR
-*
-SET &HOLDDIR = &CI_TEMP | &SID | '\';
-TYPE HOLDDIR - &HOLDDIR
-*
-* Check if Directory already exists
-*
-SET &DIR_EXISTS = 0;
-*
-SET &DLIST = &CI_TEMP | &SID |'.txt' ;
DOS DIR /ABig Grin /B &CI_TEMP > &DLIST
FILEDEF INPUT DISK &DLIST
-RUN
-LOOP
-READ INPUT, &DATA
-IF &IORETURN NE 0 GOTO CONT_DIR;
-IF &DATA NE &SID GOTO LOOP;
-*
-SET &DIR_EXISTS = 1;
-*
-CONT_DIR
-*
DOS del &DLIST
-*
-IF &DIR_EXISTS EQ 1 GOTO DIR_CREATED;
-*
-TYPE Create &HOLDDIR
DOS mkdir &HOLDDIR
-* new directory created - make sure report will be rerun
-SET &OLD_SID = -1;
-*
-DIR_CREATED
-*
-* could not make HOLDMAST work - copy master files instead
-*
-SET &DATFILE = &HOLDDIR || &FNAME || '.ftm';
-SET &MASSRC = &TPATH || &FNAME || '.mas';
-SET &MASDEST = &HOLDDIR || &FNAME || '.mas';
-*
-*FILEDEF HOLDMAST DIR &HOLDDIR
FILEDEF H_CHDL DISK &DATFILE
-*
-*
-* should not go there yet, make sure file exists first
-*
-SET &DATFILEMAME = &FNAME || '.ftm';
-SET &FILE_EXISTS = 0;
-*
DOS DIR /B &DATFILE > &DLIST
FILEDEF INPUT DISK &DLIST
-RUN
-*
-LOOP_FILE
-READ INPUT, &DATA
-*
-IF &IORETURN NE 0 GOTO CONT_FILE;
-IF &DATA NE &DATFILEMAME GOTO LOOP_FILE;
-*
-SET &FILE_EXISTS = 1;
-*
-CONT_FILE
-*
DOS del &DLIST
-*
-IF &FILE_EXISTS EQ 1 GOTO DATA_READY;
-*
-TYPE rerun report
-*
-* Retreive data
-*
TABLE FILE H_TMP
PRINT *
ON TABLE HOLD AS H_CHDL FORMAT ALPHA
END
-*
-TYPE copy /a /y &MASSRC &MASDEST
DOS copy /a /y &MASSRC &MASDEST
-*
-DATA_READY
-*
-TYPE DOS copy /a /y &MASDEST &MASSRC
DOS copy /a /y &MASDEST &MASSRC
-*
TABLE FILE H_CHDL
PRINT *
END
-*
-*
 
Posts: 9 | Registered: November 14, 2005Report This Post
Expert
posted Hide Post
so many ways to do anything you need; that's whats so great about focus.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     reuse data between reqests within session

Copyright © 1996-2020 Information Builders