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     [Solved] Run fex for each value selected

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Run fex for each value selected
 Login/Join
 
Gold member
posted
I'm sure this is already covered somewhere in the forums, but I cannot find it in the past 2 hours. I appreciate any pointers.

#1 I would like to call the same fex over and over for each value a user selects from an html page.
#2 I would like to dynamically populate the available values to select by calling another fex.

More details on #2: I want to list all bills created in the past two months as available for the user to select. I have a fex that does this already. I just can't figure out how to get the parameter to actually call it. I selected for the parameter to dynamically populate with an external procedure and it imports the code just fine. However, when I run it the select box is blank.

Alternate to #2: Can a multiselect OR statement call a fex? Something like:
-SET &InputParameter.(OR(CallFexHereReturnMultipleValues.fex)).InputParameter.;

More details on #1. I have a fex that creates a printable bill for each grant, bill sequence number, and bill type. It masks out and correctly populates the three parameters so that I can call it with one parameter that has all that information concatenated. Example call with: Grant: 123456, SeqNo: 1, Bill Type: REG so my parameter is 1234561REG and the fex can correctly handle that. So I only need to pass one parameter rather than 3.

Alternate to #1: I could also do all the looping in the fex, but I cannot figure out how to pass in an array and step through it in the fex.

This message has been edited. Last edited by: Kevin Patterson,


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
Kev, 2 words: CAR FILE.

Do you have a launch page, with a dropdown list of grant numbers? and the user picks a grant number from the list, clicks the Run button, and the fex runs for that selected grant number and creates the bill? is that what you're doing? or want to do?

or do you want the launch page to have 3 dropdowns: 1st the grant number, then the 2nd box populates showing the SeqNos for that grant, then the 3rd list populates with the BillTypes for the selected grant and seq no?
(is BillType going to vary? or will it always be REG or something else ..and thus can just be a checkbox, not a chained drilldown)?
I assume SeqNo is grant segment year?




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
To answer your questions: I do have a launch page. Right now I've just stubbed in a few values, but I want those values to pull from another fex. I just want one parameter so the user can do a multiple select. I don't want to chain the three variables together (that was probably useless details to what I'm trying to do). Bill type will vary. SeqNo, is just a one-up number that gets created when the bills are run. Again, those details were probably not necessary.

Similar situation with CAR file: Let's say I want the user to be able to select multiple makes that have a certain level of sales (so I have a separate fex that handles getting the list of appropriate makes that meet a level of sales); then create a separate report for each one. I say "separate report" because in my real example I'm pulling information from a lot of tables that I cannot join together to have a final report that would allow me to just do a break-on. I need to loop through a fex for each value they select.

I hope that makes some sense. Thank you for your help.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
so you have some hold file of eligible countries, yes?
and you want to produce a separate report for each one of them, is that it?
TABLE FILE IBISAMP/CAR
BY COUNTRY
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE
END
-RUN
-SET &howmany = &LINES ;
-SET &kounter = 1 ;
-REPEAT end.loop &howmany TIMES
-READ SAVE NOCLOSE &country.&kounter.A10
-TYPE &country.&kounter
EXEC MYFEX MYCOUNTRY = &country.&kounter
-SET &kounter = &kounter + 1 ;
-end.loop

where MYFEX is your report
You don't even need the index numbers (&kounter)

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
Gold member
posted Hide Post
Can you give more details on &country.&kounter.A10? I guess that's how you reference the array right? What is A10?

Thanks so much!


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
A10 is the width of the field 'COUNTRY' in the car file.
the procedure is creating a flat alpha file, which i read line by line with -READ, and for each line, process the report fex .
If, for example, i had said
BY COUNTRY BY CAR
then the flat alpha file would have wider records. a10 + a16 (width of car field) = a26
so you could
-READ SAVE NOCLOSE &mycountry.A10 &mycar.a16
or
-READ SAVE NOCLOSE &myrecord.A26
and then edit like crazy the field &myrecord
your choice.
..
if you wanted all 5 reports to come out on the same document, then
TABLE FILE IBISAMP/CAR
BY COUNTRY  
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE
END
-RUN
-SET &howmany = &LINES ;
-SET &kounter = 0 ;

-REPEAT endloop &howmany TIMES
-READ SAVE NOCLOSE &MYCOUNTRY.A10  
-SET &kounter = &kounter + 1 ;
TABLE FILE IBISAMP/CAR
PRINT CAR BY COUNTRY
IF COUNTRY IS &MYCOUNTRY.QUOTEDSTRING
ON TABLE HOLD AS MYTAB&kounter FORMAT HTML
END
-RUN

-endloop
-SET &kounter = 0 ;
-HTMLFORM BEGIN
-REPEAT endreploop &howmany TIMES
-SET &kounter = &kounter + 1 ;
!IBI.FIL.MYTAB&kounter;
-endreploop 
-HTMLFORM END




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
Thank you so much for the help Susannah. I'm waiting to get this working to mark it as solved. I'm running into this error:
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: app/test_multiselect.fex

My line that does the calling is here:
EXEC app/test_multiselect.fex UNIQUE_ID = &Z_BILLS.&counter

I've tried it without the "app/" part and it does the same thing. I think this is something our admin can handle, but if you have a tip for this I'll take it too.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Expert
posted Hide Post
its pathing.
the word 'app' doesnt reference an actual app directory, and it should.
where is the fex you're calling?
you need to make sure its on your apppath
or call it with the app
eg:
if your fex is in the ibisamp app, then
EXEC ibisamp/myfex.fex

its like:
TABLE FILE IBISAMP/CAR vs TABLE FILE CAR
if you put the appname into the file reference, then you don't have to mess with APP APPENDPATH IBISAMP, if you're sitting in some other app.




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
I'm not sure I know where it is. When I look at the properties of the fex I see that I have 5 application paths selected. None of them find the fex when I put them like finance_dashboards/myfex.fex. I tried my working directory from the unix box this runs on as well.

Sorry to need so much help; but can you tell me how to find out where my fex is since none of the above seems to be it?


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Virtuoso
posted Hide Post
WHENCE test_multiselect FOCEXEC
should reveal its location.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Anywhich way I try that it still tells me it cannot be found.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Guru
posted Hide Post
I guess, you've created fex in MR, if so, you can find it under ..ibi/WebFOCUS76/basedir/domainname/app/yourfexfile.fex.
In WebFOCUS 8, there is no concept of basedir.


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Gold member
posted Hide Post
Try using MRNOEDIT


WF 8.1.04,Infoassist,Oracle, Excel, PDF,HTML.
 
Posts: 82 | Registered: January 06, 2014Report This Post
Gold member
posted Hide Post
Thanks for all the help. I still can't get it to find my executable. As a work around I think I can simply put all the code in this one fex. But if someone has any other ideas I'd love to be able to use the EXEC call.


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report This Post
Virtuoso
posted Hide Post
quote:
My line that does the calling is here:
EXEC app/test_multiselect.fex UNIQUE_ID = &Z_BILLS.&counter


If test_multiselect.fex resides in the MR repository, MR needs to realize that (at run-time) so it can upload a copy as part of the request.

I suggest you use the GUI editor to insert either an EX or a -INCLUDE, and let it take care of the syntactic details. (If you go the -INCLUDE routine, precede it with -SET of &UNIQUE_ID.)


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Gold member
posted Hide Post
Ah, that got it. Here is what my call looks like:
EX app/test_multiselect.fex UNIQUE_ID=&Z_BILLS.&counter

Which I think I had tried before. But I guess going through the GUI gets the code where it needs to be ready to run.

Thanks for all the help!


Kevin Patterson
Appalachian State University
WebFOCUS 7.7.03
Windows, All Outputs
 
Posts: 57 | Registered: February 29, 2012Report 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     [Solved] Run fex for each value selected

Copyright © 1996-2020 Information Builders