AnsweredAssumed Answered

XOG error format

Question asked by vitor.sakaguti on Apr 5, 2012
Latest reply on Sep 1, 2017 by giriraj.gupta1
Hello,

I'm writing an integration module in an external system to communicate with CA Clarity via XOG. The goal is to insert and update Project objects in CA Clarity with information provided by the external system.
Things are going great, but I do need to prepare my system for XOG errors. Here is where I'm stuck: is there a formal definition of the error messages returnet by XOG?
Until now I have seen two distinct formats, one with ErrorInformation contained inside Records and one with ErrorInformation directly under XOGOutput.

Example 1: with Record tags:
<XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="project"/>
    <Status elapsedTime="0.583 seconds" state="FAILURE"/>
    <Statistics failureRecords="1" insertedRecords="0"
        totalNumberOfRecords="1" updatedRecords="0"/>
    <Records>
        <Record>
            <KeyInformation>
                <column name="ID">5002038</column>
                <column name="name">Test project 001</column>
                <column name="UNIQUE_NAME">a_test_instance</column>
            </KeyInformation>
            <ErrorInformation>
                <Severity>FATAL</Severity>
                <Description>Project Object insert failed</Description>
                <Exception><![CDATA[
com.niku.union.odf.exception.ODFValidationException: Validation failure. Attribute: a_test_attribute. Cause: range

at com.niku.odf.object.xbl.XOGCustomObjectInstanceHandler.getTypedValue(XOGCustomObjectInstanceHandler.java:1385)

at com.niku.odf.object.xbl.XOGCustomObjectInstanceHandler.populateColumnValuesToObjectInstance(XOGCustomObjectInstanceHandler.java:1238)

at com.niku.odf.object.xbl.XOGCustomObjectInstanceHandler.getObjectInstance(XOGCustomObjectInstanceHandler.java:898)

at com.niku.odf.object.xbl.XOGCustomObjectInstanceHandler.importCustomObjectInstance(XOGCustomObjectInstanceHandler.java:648)

at com.niku.odf.object.xbl.XOGCustomAttributesWriteHandler.postProcess(XOGCustomAttributesWriteHandler.java:161)

at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1354)

at com.niku.union.xml.dom.DOMWalker.postProcess(DOMWalker.java:210)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:94)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.MatchHandler.preProcess(MatchHandler.java:129)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1341)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.TryHandler.preProcess(TryHandler.java:50)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1341)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:161)

at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:91)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1341)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:161)

at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:91)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1341)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.LoopHandler.processObject(LoopHandler.java:161)

at com.niku.xql2.handlers.LoopHandler.preProcess(LoopHandler.java:91)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1341)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:36)

at com.niku.xog.service.XOGXBLHandler.processXBL(XOGXBLHandler.java:248)

at com.niku.xog.service.XOGXBLHandler.process(XOGXBLHandler.java:154)

at com.niku.xog.service.ObjectHandler.processRequest(ObjectHandler.java:191)

at com.niku.xog.service.ObjectHandler.process(ObjectHandler.java:99)

at com.niku.xog.service.XOGDispatch.processMessage(XOGDispatch.java:113)

at com.niku.xog.service.XOGSOAPServlet.processMessage(XOGSOAPServlet.java:302)

at com.niku.xog.service.XOGSOAPServlet.doPost(XOGSOAPServlet.java:91)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.niku.union.web.filter.CharsetFilter.doFilter(CharsetFilter.java:56)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:619)
]]></Exception>
            </ErrorInformation>
        </Record>
        <Record>
            <KeyInformation>
                <column name="a_test_instance"/>
            </KeyInformation>
            <ErrorInformation>
                <Severity>warning</Severity>
                <Description>XOG-9007: Entradas inválidas nas associações de matriz de encargos indiretos ou matriz de encargos indiretos inválida utilizada. É necessária uma associação por tipo de transação! Linhas padrão inseridas.</Description>
            </ErrorInformation>
        </Record>
    </Records>
</XOGOutput>
Example 2: no Record tags:
<XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="project"/>
    <Status elapsedTime="0.0010 seconds" state="FAILURE"/>
    <Statistics failureRecords="0" insertedRecords="0"
        totalNumberOfRecords="0" updatedRecords="0"/>
    <ErrorInformation>
        <Severity>FATAL</Severity>
        <Description>[Error] :0:0: element "Project" is missing "name" attribute
</Description>
        <Exception type="java.lang.Exception"><![CDATA[
java.lang.Exception: Invalid xml data

at com.niku.xog.service.ObjectHandler.processRequest(ObjectHandler.java:129)

at com.niku.xog.service.ObjectHandler.process(ObjectHandler.java:99)

at com.niku.xog.service.XOGDispatch.processMessage(XOGDispatch.java:113)

at com.niku.xog.service.XOGSOAPServlet.processMessage(XOGSOAPServlet.java:302)

at com.niku.xog.service.XOGSOAPServlet.doPost(XOGSOAPServlet.java:91)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at com.niku.union.web.filter.CharsetFilter.doFilter(CharsetFilter.java:56)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

at java.lang.Thread.run(Thread.java:619)
]]></Exception>
    </ErrorInformation>
</XOGOutput>
What exactly is the difference between these two formats? Why are not error messages always in the same format? Is there yet another format I should expect?
Also, how should I interpret the KeyInformation tag? In the example 1, I have two Record tags. The first one has column tags with attribute "name" refering to a column name and the text childi of such tag is the value of the column. OK. But in the second Record tag I have a column tag whose name attribute has the object instance code as its value, and the tag does't have any text value at all. Furthermore, why are there two Record tags, if the XOG document that I sent to the server had only one project? Is it because of the two distinct Severities (warning and fatal)? Why not have two ErrorInformation tags in the same Record tag then?

I have not found any information on this in the Integration Guide or any other documents for that matter. Does anyone know where I can find such descriptions?

Thanks in advance,
Vitor

Outcomes