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.
Each time a user runs a report, I want to log that action into a table. I am not happy with the way I have it working at the moment.
I have an Access database with the tables DUAL (with one row) and tblReportLog This is the fex I call for logging:
-* File Log_Report.fex -DEFAULTS &sReport='UNDEFINED'; -DEFAULTS &sSystem='UNDEFINED'; DEFINE FILE DUAL INSERTDATE/HYYMDS = HGETC(10, 'HYYMDS'); USER/A8 = GETUSER(USER); REPORT/A50V='&sReport'; SYSTEM/A20V='&sSystem'; END TABLE FILE DUAL PRINT INSERTDATE USER REPORT SYSTEM BY X NOPRINT ON TABLE HOLD AS LOGGING END -RUN MODIFY FILE TBLREPORTLOG FIXFORM FROM LOGGING MATCH INSERTDATE USER REPORT SYSTEM ON MATCH UPDATE * ON NOMATCH INCLUDE DATA ON LOGGING END
From the report procedures, I call this procedure like this:
EX PassportReporting/Log_Report sSystem='&sSystem',sReport='WorksMgt_LabourHours_ByDate'
Things that I'd like to fix:
1. I am achieving the insert using the long winded MODIFY command and an Access table called DUAL. The table is needed so I can get one row into a hold table. I am hoping someone can tell me a better row of doing this. Even replacing the Access table with a Focus table would be a step forward, however I dont know how to get data into a Focus table in the first place.
2. I am passing the procedure name from the calling procedure. I am hoping there is a way that the procedure can know its own filename, so that I dont have to explicitly identify the procedure. something like GETFILENAME().
Thanks in advance.This message has been edited. Last edited by: Kerry,
Robert Billing Programmer Loy Yang Power Victoria, Australia.
Posts: 9 | Location: Victoria, Australia | Registered: September 27, 2005
Robert, i do this with a focus file. to start, each of my fexes has at its top an &var set called fexname -SET &FEXNAME = 'salesrep'; (This is handy because i use it in my report footers, dump it to the agent dir so if something crashes,i know what fex was running, etc) then i use the time of day and then, very important, a random variable ( i don't track the username..could, but dont) My random variable separates two simultaneous hits to the same fex . To make a focus db out of thin air, one way is to type up the master file description as you would want it to be, and then use CREATE FILE filename, one time only, before your first MODIFY -SET &FXCOMP = SUBSTR(8,&COMPANY | ' ',1,8,8,'A8'); // another variable i use -SET &FXNAME = SUBSTR(8,&FEXNAME | ' ',1,8,8,'A8'); -SET &FXNAME = UPCASE(8,&FXNAME,'A8'); -SET &FDFEX = 'FEX' | &FXNAME || '.FTM'; -SET &RAND = RDUNIF(D8.6) * 10000; -SET &RANDOM = SUBSTR(8,&RAND | '0000000',1,8,8,'A8'); -RUN USE D:\IBI\APPS\FEXUSAGF.FOC END -* getting warning on match include includes duplicate segments; don't care -* CREATE FILE FEXUSAGEF // only on your first execution MODIFY FILE FEXUSAGF FIXFORM DATE/8 X1 FEXNAME/A8 X1 TIME/8 X1 RANDOM/A8 X1 COMPANY MATCH DATE ON MATCH CONTINUE ON NOMATCH INCLUDE MATCH FEXNAME ON MATCH CONTINUE ON NOMATCH INCLUDE MATCH TIME ON MATCH CONTINUE ON NOMATCH INCLUDE MATCH RANDOM ON MATCH REJECT ON NOMATCH INCLUDE DATA &YYMD &FXNAME &TOD &RANDOM &FXCOMP END -RUN USE CLEAR * END -eoj.fexusage -RUN When i email a report by caster, i switch off the include of this usagetracking fex. There is a variable for the fexname &FOCFOCEXEC but i've never gotten it to retun anything but 'adhoc'...i just don't know how to make it usable. Someone will come along and tell us, tho.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, 2003
The following sits in a standard -INCLUDE fex: -SET &STARTTIME = &TOD; -SET &STOPTIME = HHMMSS('A8'); MODIFY FILE USELOG MATCH * KEYS SEG 01 ON NOMATCH INCLUDE ON MATCH CONTINUE MATCH * KEYS SEG 02 ON NOMATCH INCLUDE DATA UDATE = '&YYMD', USERID = '&SET_USER', IPADDRESS = '&SET_IP', UTIME = '&STARTTIME', FEXNAME = '&RAPP', STOPTIME = '&STOPTIME',$ END
IBI also sells a product called Resource Analyzer which will do all this and much more for you. The thing to watch out for doing a MODIFY is to make sure you are licensed to do this. Also, you may currupt your tracking database if it is not under the sync machine and more than one person trys to add a record to it.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003
We modify the site.wfs so that it remembers the "IBIF_ex" value, and then redirects all requests to a "security" (call it SECURITY) fex that performs the logging and does security stuff. The last thing the SECURITY fex does is to -INCLUDE the original fex that the requestor wants run.
This way of doing things avoids having -INCLUDE code in each fex, and is therefore less error prone and more secure.
WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003
Here is a simple stripped down example of code that could be placed in a site.wfs:
MYFOCEXEC=&IBIF_ex
IBIF_ex=SECURITY
MYFOCEXEC(pass)
The requestors fex is assigned to MYFOCEXEC, and IBIF_ex is assigned the name of the SECURITY fex. Then MYFOCEXEC is passed into fex SECURITY as it is run. You do your logging and other security stuff inside the SECURITY fex, and finally the last lines of your SECURITY fex are something like:
which causes the requestors fex to run. We use this in "self-serve" mode. Haven't done this with "Diabolical Studio". There were problems using this with DS :-(.
WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003
I cannot get the &IBIF_ex parameter value. I have tried making these changes to the site.wfs file in the srv71\wfs\etc directory.
1. RAPP=&IBIF_ex
2. RAPP=&IBIF_ex RAPP(pass)
3. RAPP=&IBIF_ex {SET}RAPP(pass)
4. {SET}IBIF_ex(pass)
5. {sendvar} RAPP=&IBIF_ex {endsendvar}
note: I used angle bracket, but they dont seem to post here, so I changed them to curly brackets.
None of these gave me a value for &RAPP or &IBIF_ex when referenced in my report header. I am running via developer studio.
However.. I did find out I could just reference &FOCFOCEXEC in my report which gave me the foc name, plus a leading underscore.
If anyone can help with getting site.wfs to do *anything*, I would be grateful.
note, I call the foc from html using a form with the action "/ibi_apps/WFServlet". I have a field with the name IBIF_ex with the value set to the procedure name. I also have some other custom fields that I am able to easily refer to in my reports by sticking an ampersand in front of their name. This makes it even more frustrating that IBIF_ex comes through blank (although webFocus runs the right report, of course).This message has been edited. Last edited by: Robert Billing,
Robert Billing Programmer Loy Yang Power Victoria, Australia.
Posts: 9 | Location: Victoria, Australia | Registered: September 27, 2005
The value for the IBIF_ex parameter does not get passed through on our site.
As silly as this seems, try placing a space between the {set} and the variable name. The "language" used in the site.wfs is scantly documented, and as you are discovering - in need of improvement.
WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003
I am developing in a stand alone environment with Dev Studio (711).
I edited the site.wfs in C:\ibi\DevStudio71\srv71\wfs\etc. There is no 'client' in a stand alone Dev Studio install.
I added the following line (using angle brackets where curly ones are shown): {SET} IBIF_ex (pass)
I have found that clicking the 'memory cache' button in the Admin Console (/ibi_html/wfconsole.htm) after making a change to the site.wfs helps in refreshing the settings.
hope this helps someone else.
Robert Billing Programmer Loy Yang Power Victoria, Australia.
Posts: 9 | Location: Victoria, Australia | Registered: September 27, 2005
Would someone be able to post the code to their master file because the one I created doesn't seem to be working properly. Instead of creating a new row it appends to an existing row.
dev: WF 7.6.5 w/IIS + Tomcat
prod: WF 7.6.5 w/IIS + Tomcat
Posts: 153 | Location: Chicago, IL | Registered: February 24, 2006
We use an sql passthrough the insert our lines into a log table
ex.
SQL SQLORA BEGIN SESSION SQL SQLORA INSERT INTO MIS_LOG (USR,REPNAME,AUTH) VALUES (upper('&&UNAME'),upper('&MR_FULL_FEXNAME'),upper('&&AUTH_LVL')); END
this routine is in a seperate fex so that we just have to include in a the fexes we want to log
P.
D: WF 7.6.2 P. : WF 7.6.2 on W2003 ------------------------------------------------------------------ I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.