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     [CLOSED] Logging procedure (FEX) calls to a database

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Logging procedure (FEX) calls to a database
 Login/Join
 
Member
posted
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, 2005Report This Post
Expert
posted Hide Post
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, 2003Report This Post
Guru
posted Hide Post
This is the way we do it.

From site.wfs we send this:


HTTP_HOST=&HTTP_HOST
SET_IP=&REMOTE_HOST
RAPP=&IBIF_ex
AUTH_USER=&AUTH_USER



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

/Håkan


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
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, 2003Report This Post
Expert
posted Hide Post
oooo. very interesting . thanks stockholm!




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
Gold member
posted Hide Post
This is how we do it:

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, 2003Report This Post
Expert
posted Hide Post
jb,
would you be kind enough to show us the line in your site.wfs?




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
Master
posted Hide Post
jb

if you want a site fex to execute prior to the uses focexec look at setting the _site_profile in the site.wfs somthing like this

_site_profile = -INCLUDE SECURITY




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Gold member
posted Hide Post
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:

-SET &INCLUDE = '-INCLUDE' | &MYFOCEXEC;
&INCLUDE.EVAL

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, 2003Report This Post
Gold member
posted Hide Post
The bulletin board trashed my last reply.

MYFOCEXEC(pass)

is incorrect. Should read:

.set. MYFOCEXEC(pass)

substitute angle brackets for periods (.)


WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Report This Post
Gold member
posted Hide Post
quote:
Originally posted by TexasStingray:
jb

if you want a site fex to execute prior to the uses focexec look at setting the _site_profile in the site.wfs somthing like this

_site_profile = -INCLUDE SECURITY


Interesting. Thank you.


WF 7.1.6 moving to WF 7.7, Solaris 10, HTML,PDF,XL
 
Posts: 83 | Location: Dartmouth Hitchcock Medical Center | Registered: April 17, 2003Report This Post
Member
posted Hide Post
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, 2005Report This Post
Virtuoso
posted Hide Post
You may also use &FOCFEXNAME which is the name of the FOCEXEC without the leading underscore.

the following works fine for us.

<SENDVAR>
THEFEX=&IBIF_ex
<ENDSENDVAR>


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
 
Posts: 995 | Location: Gaithersburg, MD, USA | Registered: May 07, 2003Report This Post
Gold member
posted Hide Post
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, 2003Report This Post
Member
posted Hide Post
I have it working.

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, 2005Report This Post
Platinum Member
posted Hide Post
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, 2006Report This Post
Platinum Member
posted Hide Post
Hi

the way we went about it is :

1. we altered the cgivars file so we could use the fex full name description

ex.

IBIMR_action EQ "MR_SIGNON"
httpsession=_ibpass
CopyWFVarToSessionVar(IBIMR_pass,httpsession)


IBIC_user=&IBIMR_user
wfvar=IBIC_pass
httpsession=_ibpass
CopySessionVarToWFVar(httpsession,wfvar)

IBIWF_language(pass)
IBIMR_fex(pass)
IBIMR_domain(pass)
MR_FULL_FEXNAME(pass)


2.

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.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Silver Member
posted Hide Post
Hi,

We are desperate in implementing this functionality.

Can you please send the step by step process to acheive this?

Thanks,
Amarnath


WebFOCUS 7.6.7
Unix
Excel/Html
 
Posts: 46 | Registered: January 27, 2009Report This Post
Master
posted Hide Post
this topic is is 3 years old. please open a new post and specify exactly what you want




Scott

 
Posts: 865 | Registered: May 24, 2004Report 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     [CLOSED] Logging procedure (FEX) calls to a database

Copyright © 1996-2020 Information Builders