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.
I'm a little unclear about how to control the flow of procedure execution and I would really appreciate some input.
I have a custom wfext plugin which is setting variables in (what I think is the) WebFOCUS variable table based on encrypted authentication parameters passed in the report request URL. When the Java plugin is called it is passed a String[] parameter called NewVars. I use
NewVars[0] = "ROLE=" + userRole
to set a variable showing the requestor's privileges. From what I understand this ROLE variable goes into the variable table. However, I'm not sure how to access this in my procedure. I want to kill / prevent execution of a procedure if ROLE is not a member of a short list.
I assumed I could use a DM IF statement and reference the ROLE variable, but it doesn't seem to have an effect. I created two DM Labels called 'AUTH_PASS' and 'AUTH_FAIL' and placed each of these in front of a different report within the procedure viewer, with the idea that only the relevant report would be generated, but the condition doesn't seem to be working. I always get the AUTH_FAIL report.
I have included the text of my procedure below (as you'll see this obviously isn't the final version, but rather for testing). Any help would be very much appreciated. I already tried 'IF ROLE==...' and 'IF &ROLE=...' but these either errored or made no difference.
-* File Role_Test.fex
SET EMPTYREPORT = ON
-IF ROLE='SysAdmin' THEN GOTO AUTH_PASS
- ELSE GOTO AUTH_FAIL;
-AUTH_FAIL
TABLE FILE RPT_ORG_ID_COMMON_NAME_VW
PRINT
RPT_ORG_ID_COMMON_NAME_VW.RPT_ORG_ID_COMMON_NAME_VW.COMMON_NAME
HEADING
"Auth: Failed"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K FORMULA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=HEADING,
LINE=1,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
STYLE=NORMAL,
$
TYPE=REPORT,
COLUMN=N1,
WRAP=6.000000,
$
ENDSTYLE
END
-AUTH_PASS
TABLE FILE RPT_ORG_ID_COMMON_NAME_VW
PRINT
RPT_ORG_ID_COMMON_NAME_VW.RPT_ORG_ID_COMMON_NAME_VW.COMMON_NAME
HEADING
"Auth: Passed"
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT EXL2K FORMULA
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = endeflt,
$
TYPE=HEADING,
LINE=1,
JUSTIFY=LEFT,
$
TYPE=HEADING,
LINE=1,
OBJECT=TEXT,
ITEM=1,
STYLE=NORMAL,
$
TYPE=REPORT,
COLUMN=N1,
WRAP=6.000000,
$
ENDSTYLE
END
WebFocus 7.7 Windows Server 2008 R2 HTML Reporting
&ROLE is proper but 2 other problems will cause this not to work.
1. The main problem is the use of "=" instead of the proper "EQ" on your branching line. This is a common error and I make it often enough.
2. You need to either add an "-EXIT" before the "-AUTH_PASS" or put in a "-GOTO " and add the label to the end. I prefer using "-GOTO". This is needed so if "-AUTH_FAIL" runs, "-AUTH_PASS" doesn't run.
First, ensure each of the two TABLE request run fine separately. Second, make sure your DM "&ROLE" variable is populated with the value you want. If good, then here is my suggestion for your code [Changes colored in RED]:
[CODE] -* File Role_Test.fex SET EMPTYREPORT = ON -IF &ROLE EQ 'SysAdmin' THEN GOTO AUTH_PASS - ELSE GOTO AUTH_FAIL; -AUTH_FAIL TABLE FILE RPT_ORG_ID_COMMON_NAME_VW PRINT RPT_ORG_ID_COMMON_NAME_VW.RPT_ORG_ID_COMMON_NAME_VW.COMMON_NAME HEADING "Auth: Failed" ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT EXL2K FORMULA ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=HEADING, LINE=1, JUSTIFY=LEFT, $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1, STYLE=NORMAL, $ TYPE=REPORT, COLUMN=N1, WRAP=6.000000, $ ENDSTYLE END -GOTO ENDTEST -AUTH_PASS TABLE FILE RPT_ORG_ID_COMMON_NAME_VW PRINT RPT_ORG_ID_COMMON_NAME_VW.RPT_ORG_ID_COMMON_NAME_VW.COMMON_NAME HEADING "Auth: Passed" ON TABLE SET PAGE-NUM NOLEAD ON TABLE NOTOTAL ON TABLE PCHOLD FORMAT EXL2K FORMULA ON TABLE SET HTMLCSS ON ON TABLE SET STYLE * INCLUDE = endeflt, $ TYPE=HEADING, LINE=1, JUSTIFY=LEFT, $ TYPE=HEADING, LINE=1, OBJECT=TEXT, ITEM=1, STYLE=NORMAL, $ TYPE=REPORT, COLUMN=N1, WRAP=6.000000, $ ENDSTYLE END -ENDTEST
In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
I have tried with your suggestions but I'm still having some issues - I currently have parameter prompting on (XMLPROMPT) and when I try to run my report I am prompted for the ROLE parameter. If I turn parameter prompting off I just get an error.
Do you know if I need to do anything else to transfer the ROLE parameter I set in my plug-in through
NewVars[0] = "ROLE=SysAdmin"
to be available to my report? I have seen the functions like CopyWFVarToSessionVar but I don't really understand the terminology enough to know if this is what I need
Any suggestions much appreciated!
WebFocus 7.7 Windows Server 2008 R2 HTML Reporting
Hi Tom, Glad it helped somewhat. Unfortunately, I'm not familiar with the IWAY environment or Java plugins so I can't answer you're question as to how to get your &ROLE variable populated so that the paramter prompting does not occur.
Any IWAY/Java experts out there willing to help Tom? If not, a call to the IBI Helpline is your best bet.
Good luck
David
In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
Thanks for your suggestion njsden but there was no change in my report. The syntax highlighting in Developer Studio did not recognise the default(h) statement or any of the variations I tried. Are you sure this syntax is valid for 7.7?
According to IBI support my problem is that I am creating an Application Server session variable in my plugin, which must then be copied to a WebFOCUS variable. They suggested I tried the CopySessionVarToWFVar method, but this is currently returning errors.
Here's hoping I get my problem solved before new year...
WebFocus 7.7 Windows Server 2008 R2 HTML Reporting