You are on page 1of 2
CGLNTECH Advisory Note Custom Error handling with webMethods webMethods native server logging is a mandatory part of any webMethods support solution. However, when it comes to correlating business data of a particular context, a custom error handling solution can offer many benefits. This paper aims to provide some technical and architectural suggestions for such a solution. Introduction to Custom Error Handling “This wtapape is ot description of the webMthods ero handing ‘wamenark which i discussed in “GEAR 6 Enor Hsnlng White Pape This paper walinsead capture, dseminate and support evors/exceptons Logging with webMethods ‘Tha natne webMatnods logging fer ategration Saver faltates: + Logging of various ears + Seve statue + Various system occurences (the loading ofa package) Inthe context of simplistic single-user development envionment his shoul suffice; however this is net ofacve gven more practical stations Ge. production seen wth many and vated message pes). “This atv logging provides mer capaity when Medla/Montor a sod. Modeler Processes (PRT) can persist pipeline variables ina database and aon for he inspectionresubmisson fom the WnMonitornterlace. “This canbe futher erhanced by logging speci lis uch as aunque |@)ich lows forthe ability to search a particular process instance (xecated model by ust keying itn the search fait in Monit. Howover,not al of hese add up to ttal err handing solution This is ‘hore a custom logging standards requited ‘Custom Logging Fundamentals ‘Thveevory basic ements found in mest custom exer hating nplementstions ae: + custom logging database: vinrea unique, appcabe business data, stack taco information and eros are corded + Custom email slerts: wher the unique and the enor description i ent as ntiliation to support + Custom error handling code webMsthods code developed special for err handing and placed in a Common Senices package " nican te nan he eed baiage t ‘The Custem Error handing code can prove lo be amato prablem for most inplmantatons Theroore, a development guises document need to be estabished, detain how the ror handing series are to work in usage, eet) ‘These seecee must be eal legible and robust. Donat shy away from proving some code samples (in a Samples drectony of you Conon Senices) At glans, these wl lutte how the [sericea tobe used, instead of having to reference tha more specie evelopment guidelines. Custom Logging in Practice ‘The following sections doa with pragmatic and simple examples of how such custom eror handling canbe implemented in webllatbods 1. Toprievel Service coding ‘The Topslov!senices the on, which so be invoked external by an ‘vent rca (or internal as part of a Modeler press) it wil capture any recursive ear calla therein and handle thom appropriately, ‘Acommon template must be spped to each Topeve sence forthe purpose of consistency in logging. Asa recommendation, I shoul conta Beginning, ending and error logs: by ising a fogging uy (ie loga) you can expt log the various points of execaton (and any athe data you may wish) rom a fw sarvico to 8 ft le ora rumbar of thar mediums) + Try/Cateh with sequence loge and eror hang legit \webMathode Monitor fe being ured, then changeProcese Stave should be called to sel the status fo PAL (cota tisvisble in meritn) cae o set the stats to FAIL (so hat tis vit noni) 1 commen series Lonestar hg ery pont 5 $ saereoxansiccess) 5 seocace(en rare) > butane Sanca (cove eg) > butting Seen eae iter ng) 5 $ seoxaKe (ent core) > pueowaetsctr |p suet cranerecessStee ‘=> commen serve her center ‘> conan sereesLeaatesr Loge en jae tt) $e 097 ac FALE > commen sereesoggea bse hag et et) CGLNTECH Advisory Note 2 Subsequent Services [Al subcequont svios called by tho Teplve sonice (end recursively called dono equ aty/eatch asin the Toptvel sence, Alhough you ays wish Yo do 3, to eaptre exes that may velale to a certain scope (or instance when performing aJOBC Adgpter transaction). Instead they ae to thro exceptions ang have them caught bythe Topevel sence For nstanceif Serge! (seen nour Topevel erie) ware to have the folowing code > pub te gare = pub sting ytesTosting Where gate has alana” valve st toclestat and sucha fle doos not eit onthe server, an ero il oc and al subsequent sep in Semic! (in his cate bytesToSting) wil rot be executed Insta the exception willbe caught and handles by ou Teptve snien, We demonstrate this inthe trace mode example belo (ove nor etaog og ery pore) 15 # Secuence exter success) 1B Secuence exten FALURE) SP ootaut nyeserviet (seo) > cetaut eServices tthe ope) (6 seoLENCE fext on DONE) oss tow peace > put pt stb crangeProcessStatus = ones nndetrar tender 6 ub tr cetunbea Loa et on fare ot) 1 ewosonestnkog (ages ort) 3 Trepping Constraints in Business Logie Inthe case of fang business log you may wish fo frce an exception occu sing the method SerresExceptot) wiaped in a joa sens? er EXIT ‘Sow signal and Fale with hae ceding the enor code (or you pret err to). Forinslance the following branch found in Serves wil check oso if strt and te ae populate 8 eS eee 8 ¥ sett ett 88 tr2ltuk SEQUENCE Perform Cones) oP mar © E setrtsemtnu watrze=strndt SEQUENCE (Throw Exception) BAT stow! ond signal FALURE hey sre populates. then std anc str wl be concatenated if hey are not hen a pupocetl exception willbe town resulting inthe catch being invoked in the Toptovel service Depending onthe sophistication of your eer handing, you may wish 10 ‘colopeustomErrerHandler io cecem vrious fren ror by parang the let of the ertor message you receive, 4 Custom Eiror Handler Obtaining ts deta fom getLastEmar tis sevice wl take a cenbnation ofthe wobMethods itera ata suchas system te, cal stack, pple) and the user coated error message, This error message mentanes bret nthe previous secon) might canta a ple et decrpon or anentre formats message wth deal prtaning to + Enorexception codes + Categories (stem, busines, aplication connect ror) + Sevety status, content information, projet ame 2 Tha nl cote ste wh sme eons to scm ip ee ie marge act mie) ten ot ace capone ern enc ecagten coe sre sree es ‘Thisinfomaton can thon b published to wabMethods Brckar nd handle by any nantes of itered sbecibers each ith an interest is the spec Take fer netance vat ertor suber ight perf the obowing 1 Log a Business Exception nthe exception tabla 2 Emailthe data enty persone! team leader responsible fr authoring the patulr data set 2 Eimathe webMethods support stat ‘What otows would bean aplication ofthe above scaate: 1 Thetears leader recive an ema alte sage with vain enor 2. Aare team leader has ewe he excptn textinthe database andes sited he pobim wi the righ mczage sen thay can hen comespore ‘aha he da shoul ave bee othe wetiMetheds suppor erscnna Support can then find the request in Moir given the uique i sent to ‘ham inthe ema 4 Moke th agustments directly to the Modeler process slep nthe pipeline. Then repay the Mosel slop with the new dala Custom Logging Suggestions ‘Working extend the povided suppor framework canbe an extensive ‘tort nse. Depending onthe Enters, and speccly the nature of how wetMathods fe used as a midcleware soln, the supper framework ‘oui inl: + Routing of natieations:«esor connecting to DE? Apection Dstatase notifies webMathods support anc DB OBA, “+ Aweb frontend to the custom logging database: co tat erors aro Accesste wh ot the need (and complication) of thick fen thal he covetive msntentnce can be logged detaling the satus and action taken bythe sssigned persenna ‘+ Integration with other support mechanisms: this can vay but consider, logging an entry in Systm Event logs (where Windows Event Log mentoring tools 6 aready place) orang a Proeet {Configuration Managernt (PCM) request wih Two or eevant ‘Systems Management Console) ‘The extent of the support scien wil depend ona) the level of granular In th custom logging b) the leveraging of euitng software infastructure and) the lve of coropration across the ener, ABOUT GLINTECH {GLINTECH offers a comprehensive st of consuling sores, which locus ‘on complex and statgl techacogies. Our senices beni companies that se underging significant structural and tecbacogial changes. Founded in 2000, the GLINTECH team has had sgnticant exposure to broad vel of technologies whichis escent or he implementation ‘of software syst integration Couple wth our experiance in vatous indstieg GLNTECH has but set of competncies ard vondor nership, whch adress the implementation cks associated with complex project. GLNTECH conourant are sill in a range of aenaoogis Including, IBM Websphere Pom products, webMethods Microsoft and ‘ober emerging products, such as Stns SOA sue of eoitions To fin aut hw GLINTECH cn hep your business it httpy/wwwglintech.com, call +61 2 0290 3009, ‘renal us at infowgintechcom. [GLINTECH, 65 York Steet, yay, NSW 2000, stata Main Tet 461 2099 2009 Main Fax 461 2 0090 2111 Eni: infoalintechcom ©2006 GLINTECH, ‘A hts Revere, GUNTECH andthe GLINTECH ag ee ade of ‘ictal ItagratenTechelgy- Other brands andr product ams a0

You might also like