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  iWay Software Product Forum on Focal Point    Conditional fex execution based on variable table

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Conditional fex execution based on variable table
 Login/Join
 
Silver Member
posted
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
 
Posts: 32 | Registered: September 19, 2011Report This Post
Platinum Member
posted Hide Post
&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
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Silver Member
posted Hide Post
Thanks very much for the info DavSmith

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
 
Posts: 32 | Registered: September 19, 2011Report This Post
Platinum Member
posted Hide Post
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
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Virtuoso
posted Hide Post
Tom, couldn't you just default &ROLE to "something" at the beginning of the procedure to avoid DM complaining about the non-existence of it?

-DEFAULTH &ROLE='NONE'
SET EMPTYREPORT = ON
-IF &ROLE EQ 'SysAdmin' THEN GOTO AUTH_PASS
- ELSE GOTO AUTH_FAIL;
...


If this procedured is EXEC'd later on and passed a value for &ROLE this new value will take precedence and will override 'NONE' anyway.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Silver Member
posted Hide Post
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
 
Posts: 32 | Registered: September 19, 2011Report This Post
Silver Member
posted Hide Post
Thanks again for all the suggestions on this.

In the end a solution was found by the IBI support people.

The Java plugin is still setting the ROLE variable in the same way (NewVars[0] = "ROLE=SysAdmin") and the site.wfs needed to look like this:

<VER 1>
# $Revision: 1.5 $ 
# place any variables here from cgivars.wfs that you wish to override.

<call> checkAuth()
<SET>ROLE(PASS)


WebFocus 7.7
Windows Server 2008 R2
HTML Reporting
 
Posts: 32 | Registered: September 19, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    Conditional fex execution based on variable table

Copyright © 1996-2020 Information Builders