AnsweredAssumed Answered

Creating service with xog  ---errors

Question asked by mike.christiansen on May 20, 2011
Latest reply on May 20, 2011 by Dave
Hi I am trying to create a service with xog, which worked fine until I found that it didnt create a task in the database to assign resources to. So I then add a piece of xml to the xog to add the task and everything is fine. HOwever I want to create a service via xog and create the task all in the same script to save time. so here is what we have so far, but it throws a java null pointer......any suggestions?


also, this works fine if I already have the objecttID, but the whole point of this excercise is to create a new service that doesnt alreadyhave an objectID


<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_service.xsd">
<Header action="write" externalSource="NIKU" objectType="service" version="8.0"/>
<Services>
<Service active="true" approvedTime="2010-11-23T11:18:57"
calculatePresentValueInfo="true" currencyISOcode="USD"
description="Service: Training related to Information Systems Project Management Office practices and tools."
equipmentExchangeRateType="AVERAGE"
expenseExchangeRateType="AVERAGE"
finish="2011-12-31T17:00:00"
forecastEqualsBudget="true" laborExchangeRateType="AVERAGE"
lastUpdatedBy="admin" managerUserName="jadmin"
materialExchangeRateType="AVERAGE" name="the big Service 4"
openForTimeEntry="1"
pageLayoutCode="service.serviceFrame" plannedBenTotal="0"
plannedCostFinish="2011-12-31T17:00:00"
plannedCostStart="2010-11-23T00:00:00" plannedCostTotal="0"
priority="10" progress="1" requiredForScenarios="true"
start="2010-11-23T08:00:00" status="1"
syncInvestmentAndBudgetDates="false" trackMode="2">
<Allocations/>
<scenarioDependencies/>
<InvestmentAssociations>
<Allocations>
</Allocations>
<Hierarchies/>
</InvestmentAssociations>
<InvestmentResources>
<Resource availFrom="2010-11-23T08:00:00"
availTo="2011-01-31T17:00:00" bookingStatus="5"
defaultAllocation="0" isProjectManager="false"
lastUpdatedBy="1"
lastUpdatedDate="2011-03-17T12:14:22"
openForTimeEntry="true" resourceID="admin">
<AllocCurve/>
<CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
</CustomInformation>
</Resource>

</InvestmentResources>
<InvestmentTasks>
<Task finish="2011-04-05T17:00:00"
key="false"
lastUpdatedBy="1"
lastUpdatedDate="2011-05-10T11:02:31"
milestone="false" name="PMO Training" orderID="1"
outlineLevel="1" percComp="0"
start="2011-03-29T08:00:00" status="1"
summary="false" taskID="~rmw" topDownPercent="0">
<Assignments>
<TaskLabor actualWork="0" baselineWork="0"
estPattern="1" lastUpdatedBy="5001032"
lastUpdatedDate="2011-03-17T12:14:22"
remainingWork="0" resourceID="admin" unpostedActuals="0">
<CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
</CustomInformation>
</TaskLabor>
</Assignments>
</Task>
</InvestmentTasks>
<General addedBy="admin" addedDate="2010-11-23"/>
<CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
</CustomInformation>
</Service>
</Services>
<XOGOutput>
<Object type="service"/>
<Status state="SUCCESS"/>
<Statistics failureRecords="0" insertedRecords="0"
totalNumberOfRecords="2" updatedRecords="0"/>
<Records/>
</XOGOutput>
</NikuDataBus>

ERROR BELOW
XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
<Object type="service"/>
<Status state="FAILURE"/>
<Statistics failureRecords="1" insertedRecords="1"
totalNumberOfRecords="1" updatedRecords="0"/>
<Records>
<Record>
<KeyInformation>
<column name="ID">5011288</column>
<column name="name">the big Service 4</column>
<column name="UNIQUE_NAME"/>
</KeyInformation>
<ErrorInformation>
<Severity>FATAL</Severity>
<Description>Investment Management Object insert failed</Description>
<Exception><![CDATA[
java.lang.Exception: 74 : Record does not exist in DB

at com.niku.xog.functions.XOGProjectAPI.returnErrorMessage(XOGProjectAPI.java:450)

at com.niku.xog.functions.XOGProjectAPI.process(XOGProjectAPI.java:286)

at com.niku.xog.functions.XOGProjectAPI.eval(XOGProjectAPI.java:154)

at com.niku.xql2.eval.XQLFunctionNode.eval(XQLFunctionNode.java:27)

at com.niku.xql2.eval.XQLEvaluator.parse(XQLEvaluator.java:40)

at com.niku.xql2.XQLVisitor.eval(XQLVisitor.java:1043)

at com.niku.xql2.XQLVisitor.eval(XQLVisitor.java:1017)

at com.niku.xql2.XQLVisitor.process(XQLVisitor.java:1249)

at com.niku.xql2.XQLVisitor.process(XQLVisitor.java:1285)

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

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:1342)

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:1342)

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.TryHandler.preProcess(TryHandler.java:50)

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

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.MatchHandler.preProcess(MatchHandler.java:129)

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

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.TryHandler.preProcess(TryHandler.java:50)

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

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:1342)

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:1342)

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:1342)

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:245)

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

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

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

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

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

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

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:29)

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="ID">5011288</column>
<column name="name">the big Service 4</column>
<column name="UNIQUE_NAME">SRV_63</column>
</KeyInformation>
<ErrorInformation>
<Severity>WARNING</Severity>
<Description>OBS association has been updated according to financial information.</Description>
</ErrorInformation>
</Record>
</Records>
</XOGOutput>

Outcomes