Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Asynchronous handling of server procedures: How to catch errors?
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Asynchronous handling of server procedures: How to catch errors?
 Login/Join
 
Virtuoso
posted
I'm playing around with EX CMASAP, but I have a few questions.

Say, I have these procedures:
wrapper.fex:
-SET &ECHO = ON;
-TYPE Start of wrapper procedure

EX CMASAP REQ_NAME=wrapper_error, APPDIR=baseapp, CM_SETERR=ON, CM_ASYNC=OFF
-RUN

-TYPE End of wrapper procedure: &RETCODE


wrapper_error.fex:
TABLE FILE CART
PRINT CAR
BY COUNTRY
END
-RUN


You may have noticed the error in the2nd script. That's on purpose, as I am looking for a method to detect errors in the inner fex.

The kicker is, I don't want to rely on anything custom-made in the inner fex (wrapper_error).

I notice that generated flows use global variables, such as &&CM__RETURN, but I want my wrapper procedure to be fail-safe enough that even unexpected errors in wrapper_error get flagged.
I get the impression that &&CM_RETURN instead relies on setting it from within the wrapper_error fex?

Next, I would prefer to run this procedure asynchronously, BUT I do need some processing when the wrapped procedure completes.
Is that possible? Is there, for example, some kind of trigger or event that can be fired (with some context information from the wrapper fex) when wrapper_error completes?

The end goal is to wrap our ETL procedures in a parameterised fex that also logs (among other things) start and finish times and the return code of the ETL procedure.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1643 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Wep,

CMASAP is a DataMigrator process so you might be better off (a more knowledgable audience?) asking on the iWay Forum?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5601 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Hi Wep,

This has been bugging me as I am sure that you should be able to capture it!

Try something like this in your wrapper.fex
-SET &ECHO = ON;
-DEFAULTH &&DEP_1_RC
-TYPE Start of wrapper procedure

EX CMASAP REQ_NAME=wrapper_error, APPDIR=baseapp, CM_SETERR=ON, CM_ASYNC=OFF, DEP_ALIAS=DEP_1
-RUN

-TYPE End of wrapper procedure: &&DEP_1_RC


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5601 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Oh, indeed! That returns 8 for my faulty procedure and 0 for a proper one!
Good One

Now I wonder what RC=8 means... It's clearly not "FOC008: THE NUMBER OF IN-GROUPS-OF/IN-RANGES-OF FIELDS EXCEEDS 128", as I don't have any of those.

Perhaps it is this (DSTRUNER)?: https://infocenter.information...m#dAArcapiweb1037438

But even if it is... HTTP post error?!? I don't think so.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1643 | Location: Enschede, Netherlands | Registered: August 12, 2010Reply With QuoteReport This Post
Expert
posted Hide Post
If memory serves, the RC is the &RETCODE from the REQ_NAME procedure. So, as an error during parsing of the procedure would return 8, this is what your RC=8 is inferring?

I'm sure Danny or Waz etc. will correct me if I'm remembering incorrectly Smiler

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5601 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Asynchronous handling of server procedures: How to catch errors?

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.