Index: BL/Flow/Offerte/Parser/AbstractParserXML.cls.xml =================================================================== diff -u -r1683 -r1863 --- BL/Flow/Offerte/Parser/AbstractParserXML.cls.xml (.../AbstractParserXML.cls.xml) (revision 1683) +++ BL/Flow/Offerte/Parser/AbstractParserXML.cls.xml (.../AbstractParserXML.cls.xml) (revision 1863) @@ -20,11 +20,12 @@ Set DirRead=$S(..DirRead="":"",$E(..DirRead,$L(..DirRead))'="\":..DirRead_"\",1:..DirRead) Set FileName=..FileName Set DirTemp=$S(..DirTemp="":"",$E(..DirTemp,$L(..DirTemp))'="\":..DirTemp_"\",1:..DirTemp) - + Do ..ImportXML(DirRead, FileName, DirTemp) // Now convert the generic XML to a proxy object structure If '$IsObject(..pxOfferte) { + Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Warning("ImportEDI","Geen offertes in het bestand") Set ParserStatus=##class(ParseStatus).%New(100,"Geen offertes in het bestand") ; geen inhoud } Else { @@ -50,19 +51,29 @@ Set TempDirByFOP=$$$ConvertToFop(TempDir) // Get the XSLT to use (implemented by specific parsers) Set XSLT=..getXSLT() - If $G(XSLT)="" Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", "","Xml wrong filename "_FileName) Quit + If $G(XSLT)="" Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Error("ImportEDI","Geen XSLT gespecifieerd. ImportXML wordt afgebroken. ") + If $G(XSLT)="" Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", "","Xml wrong filename "_FileName) Quit // De XSL Transform on the input-xml Set sc=##class(BL.Sys.FOP.Interface).TransformXML(XSLT, ##class(TECH.Files).AppendFile(DirByFOP,FileName), $LB($$$Replace(FileName,".xml",""), TempDirByFOP) ) - H 5 ; 65 ; Allows the DocBase process to release the file-lock + H 5 ; Allows the DocBase process to release the file-lock + + If $$$ISERR(sc) Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Error("ImportEDI","TransformXML is mislukt voor "_##class(TECH.Files).AppendFile(Dir,FileName)_" "_$$ParseStatus^vhLib(sc)) If $$$ISERR(sc) Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", sc,"XSLTransform "_##class(TECH.Files).AppendFile(Dir,FileName)_" XSLT:"_XSLT) Quit ; Else + Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Info("ImportEDI","TransformXML geslaagd; output file="_##class(TECH.Files).AppendFile(TempDir,FileName)) // De gegenereerde xml (=output van XSLT) inlezen in Caché Set sc=..ReadXML(TempDir,FileName) ;d WL^vhDBG("Result van Read XML : "_$$ParseStatus^vhLib(sc)) + If $$$ISOK(sc) { + Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Info("ImportEDI","ImportXML geslaagd; output file="_##class(TECH.Files).AppendFile(TempDir,FileName)) + } + Else { + Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Error("ImportEDI","ImportXML is mislukt; ") + } Set:($$$ISOK(sc)) Status=$$DELFILE^vhDEV(TempDir,FileName) ; Delete the file after succelful processing Quit ]]> @@ -78,6 +89,7 @@ // Begin processing of the XML input Set FullFileName=##class(TECH.Files).AppendFile(Dir,FileName) Set sc=reader.OpenFile(FullFileName) + If $$$ISERR(sc) Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Error("ImportEDI","XML2Offerte OpenFile "_FullFileName_" "_$$ParseStatus^vhLib(sc)) If $$$ISERR(sc) Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", sc,"Openfile: "_FullFileName) Quit sc Do reader.Correlate("ORDER","BL.Flow.Offerte.pxHoofding") ;Associate a class name with the XML element name @@ -87,7 +99,10 @@ . Set ..pxOfferte=pxOfferte . Set sc=..PostprocessProxy() . If $$$ISERR(sc) Set Info = "PostprocessProxy: "_FullFileName Quit - if $$$ISERR(sc) Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", sc,$get(Info)) + + If $$$ISERR(sc) Do ##class(vhLib.Logger).%New(..#EDILoggerGroep).Error("ImportEDI","XML2Offerte "_$G(Info)_" "_$$ParseStatus^vhLib(sc)) + If $$$ISERR(sc) Do AddErrorToLog^BL.EC.Common("EDI", "XML2Offerte", sc,$get(Info)) + Quit sc ]]>