AnsweredAssumed Answered

GEL: XOG error message

Question asked by Lowell on Oct 15, 2015
Latest reply on May 9, 2018 by nick_darlington

I have a GEL script that issues a XOG command to update a custom project attribute on "Project Create".  I get the error message listed after the script.  Do you see what I'm missing?

<gel:script xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:core="jelly:core" xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
  xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sql="jelly:sql"
  xmlns:xog="http://www.niku.com/xog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!--Parameters section-->
  <!--    <gel:parameter default="http://vmslcniku01.regence.com:80" var="XOGURL"/>-->
  <!--    <gel:parameter default="http://vmslcclarity02.regence.com:80" var="XOGURLSANDBOX"/>-->
  <!--    <gel:parameter default="http://vmslcniku01.regence.com:80" var="XOGURLTEST"/>-->
  <!--    <gel:parameter default="http://mslcclarity04.regence.com:80" var="XOGURLQA"/>-->
  <!--    <gel:parameter default="http://mslcclarity02.regence.com:80" var="XOGURLPROD"/>-->
  <gel:parameter default="admin" var="XOGUsername"/>
  <gel:parameter default="admin" secure="true" var="XOGPassword"/>
  <!--End Parameters Section-->
  <!-- Only used with GEL Serialize command at end -->
  <gel:parameter default="./outputfiles" var="PLocalDirectory"/>
  <!--vnow used for output file-->


<!--  <core:set var="vnow">
    <gel:formatDate format="MMddyy"/>
  </core:set>-->
  <!-- Only used with GEL Serialize command at end -->

  <!--
  Update Project (ODF_CA_PROJECT.trg_itinitialest) from (RITS Total Hours: ODF_CA_INV.trg_rits_hours) on Project Create
 
 
 
  -->
 
 
  <!-- ****************************************GET THE XOG URL FROM THE APPLICATION **********************************************-->
  <gel:parse file="../config/properties.xml" var="properties"/>
  <gel:set asString="true" select="$properties/properties/webServer/@schedulerUrl" var="EntryURL"/>
  <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="config"/>
  <core:set value="0" var="v_IsLocal"/>
  <core:set value="${config.getProperties().getWebServer().getWebServerInstance(0).getId()}" var="WebServerid"/>
  <core:if test="${WebServerid == 'app'}">
    <core:set value="${config.getProperties().getWebServer().getWebServerInstance(0).getAddress()}" var="AddressIp"/>
    <!-- Replaced "EntryURL" from the Properties.xml file with "scheduler entry url" from Properties.xml file -->
    <!--      <core:set value="${config.getProperties().getWebServer().getWebServerInstance(0).getEntryUrl()}" var="EntryURL"/>-->
    <core:set value="${config.getProperties().getWebServer().getWebServerInstance(0).getPort()}" var="Port"/>
    <core:if test="${EntryURL == 'http://localhost'}">
      <gel:log level="INFO" message="NULL ADDRESS IS LOCAL... "/>
      <core:set value="1" var="v_IsLocal"/>
      <core:set value="${EntryURL}" var="AddressIp"/>
    </core:if>
  </core:if>
  <core:if test="${WebServerid == 'nsa'}">
    <core:set value="${config.getProperties().getWebServer().getWebServerInstance(1).getAddress()}" var="AddressIp"/>
    <!-- Replaced "EntryURL" from the Properties.xml file with "scheduler entry url" from Properties.xml file -->
    <!--      <core:set value="${config.getProperties().getWebServer().getWebServerInstance(1).getEntryUrl()}" var="EntryURL"/>-->
    <core:set value="${config.getProperties().getWebServer().getWebServerInstance(1).getPort()}" var="Port"/>
    <core:if test="${EntryURL == 'http://localhost' }">
      <gel:log level="INFO" message="NULL ADDRESS IS LOCAL... "/>
      <core:set value="1" var="v_IsLocal"/>
      <core:set value="${EntryURL}" var="AddressIp"/>
    </core:if>
  </core:if>
  <core:if test="${Port != null }">
    <core:set value="${EntryURL}:${Port}" var="EntryURL"/>
  </core:if>
  <core:if test="${v_IsLocal == 0 }">
    <core:if test="${AddressIp != '' }">
      <core:set value="http://${AddressIp}" var="EntryURL"/>
    </core:if>
  </core:if>
  <gel:log level="INFO">EntryURL: "${EntryURL}"</gel:log>
  <!--Set value for XOGURLAUTO (auto detected using above code)-->
  <core:set value="${EntryURL}/niku/xog" var="XOGURLAUTO"/>
  <!-- ***************************************END GET XOG URL ***********************************-->
  <gel:log level="INFO">Make sure environment is correct: XOGURLAUTO: "${XOGURLAUTO}"</gel:log>
  <!-- Log into XOG first. -->
  <!--original    <soap:invoke endpoint="${XOGURL}/niku/xog" var="auth">-->
  <soap:invoke endpoint="${XOGURLAUTO}" var="auth">
    <soap:message>
      <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
        <soap-env:Header/>
        <soap-env:Body>
          <xog:Login>
            <xog:Username>${XOGUsername}</xog:Username>
            <xog:Password>${XOGPassword}</xog:Password>
          </xog:Login>
        </soap-env:Body>
      </soap-env:Envelope>
    </soap:message>
  </soap:invoke>
  <!-- Checking whether a sessionID is returned.  If not, it means that Login was not successful. -->
  <gel:set asString="true" select="$auth/SOAP-ENV:Envelope/SOAP-ENV:Body/xog:SessionID/text()" var="sessionID"/>
  <core:choose>
    <core:when test="${sessionID == null}">
      <gel:log level="ERROR">Cannot login to Clarity XOG. Check username and password.</gel:log>
      <gel:log level="INFO">Department XOG not Completed. </gel:log>
    </core:when>
    <core:otherwise>

   <gel:setDataSource dbId="niku"/>

<!--  <core:set var="vnow">
    <gel:formatDate format="MMddyy"/>
  </core:set>-->
  <!-- Only used with GEL Serialize command at end -->

  <core:set value="${gel_objectInstanceId}" var="v_proj_id"/>
  <gel:log level="INFO">v_proj_id ${v_proj_id}</gel:log>


<!--  Your Code Here -->
<!-- Query-->
<!--Query to pull Change Request and ID for Change Request -->

<!-- v_data for XOG data -->
<sql:query var="v_data">
SELECT
P.PRID,
P.PRUID,
I.CODE,
I.NAME

, NVL(CP.TRG_ITINITIALEST,0) ITINITIALEST
, NVL(OCI.TRG_RITS_HOURS,0) RITS_HOURS
--, OCI.TRG_APP_NT_ST_DT
--, OCI.TRG_WIP_DATE
--, OCI.TRG_IN_TEAM_REVDT
--, OCI.TRG_EST_IN_PROC
FROM
PRJ_PROJECTS P
INNER JOIN SRM_PROJECTS SP ON P.PRID = SP.ID
INNER JOIN ODF_CA_PROJECT CP ON P.PRID = CP.ID
INNER JOIN INV_INVESTMENTS I ON P.PRID = I.ID
INNER JOIN ODF_CA_INV OCI ON I.ID = OCI.ID

where I.ID = ${v_proj_id}

</sql:query>

<core:choose>
<gel:log level="INFO">PRID ${v_data.rows[0].PRID}</gel:log>
<gel:log level="INFO">PRUID ${v_data.rows[0].TRG_ITINITIALEST}</gel:log>
<gel:log level="INFO">CODE ${v_data.rows[0].I.CODE}</gel:log>
<gel:log level="INFO">NAME ${v_data.rows[0].I.NAME}</gel:log>
<gel:log level="INFO">TRG_ITINITIALEST ${v_data.rows[0].ITINITIALEST}</gel:log>
<gel:log level="INFO">TRG_RITS_HOURS ${v_data.rows[0].RITS_HOURS}</gel:log>
<gel:log level="INFO">TRG_APP_NT_ST_DT ${v_data.rows[0].TRG_APP_NT_ST_DT}</gel:log>
<gel:log level="INFO">TRG_WIP_DATE ${v_data.rows[0].TRG_WIP_DATE}</gel:log>
<gel:log level="INFO">TRG_IN_TEAM_REVDT ${v_data.rows[0].TRG_IN_TEAM_REVDT}</gel:log>
<gel:log level="INFO">TRG_EST_IN_PROC ${v_data.rows[0].TRG_EST_IN_PROC}</gel:log>

<core:when test="${v_data.rows[0].TRG_ITINITIALEST != v_data.rows[0].TRG_RITS_HOURS}">

            <gel:parse var="xogBody">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd">
<Header action="write" externalSource="NIKU" objectType="project" version="13.3.0.286"/>
<Projects>
  <Project entityCode="Regence" name="${v_data.rows[0].I.NAME}" projectID="${v_data.rows[0].I.CODE}">
  <CustomInformation>
<ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>

<!-- <ColumnValue name="trg_app_nt_st_dt">2015-01-01T00:00:00</ColumnValue>-->
<!-- <ColumnValue name="trg_wip_date">2015-01-01T00:00:00</ColumnValue>-->
<!-- <ColumnValue name="trg_in_team_revdt">2015-01-01T00:00:00</ColumnValue>-->
<!-- <ColumnValue name="trg_est_in_proc">2015-01-01T00:00:00</ColumnValue>-->

<!-- <ColumnValue name="trg_rits_hours">10</ColumnValue>-->
<ColumnValue name="trg_itinitialest">${v_data.rows[0].ITINITIALEST}</ColumnValue>
</CustomInformation>
</Project>
</Projects>
</NikuDataBus>
            </gel:parse>

 


</core:when>
</core:choose>

    </core:otherwise>

    <!--<gel:serialize fileName="${PLocalDirectory}/XOG_Department_${vnow}.xml" var="${xogBody}"/>-->
    <!--<<<<<<<<<<<<<< XOG VALUES>>>>>>>>>>>>>>>>>>>-->
    <!-- Send a XOG request. -->
    <gel:log level="INFO">Sending XOG Request.</gel:log>
    <soap:invoke endpoint="${XOGURLAUTO}" var="result">
      <soap:message>
        <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
          <soap-env:Header>
            <xog:Auth>
              <xog:SessionID>${sessionID}</xog:SessionID>
            </xog:Auth>
          </soap-env:Header>
          <soap-env:Body>
            <gel:include select="$xogBody"/>
          </soap-env:Body>
        </soap-env:Envelope>
      </soap:message>
    </soap:invoke>
    <gel:set asString="true" select="$result/SOAP-ENV:Envelope/SOAP-ENV:Body/XOGOutput/Status/@state" var="xogStatus"/>
    <gel:set asString="true" select="$result/SOAP-ENV:Envelope/SOAP-ENV:Body/XOGOutput/Statistics/@insertedRecords" var="inserted"/>
    <gel:set asString="true" select="$result/SOAP-ENV:Envelope/SOAP-ENV:Body/XOGOutput/Statistics/@updatedRecords" var="updated"/>
    <gel:log level="INFO">XOG status is "${xogStatus}". </gel:log>
    <gel:log level="INFO">XOG Inserted:  "${inserted}". </gel:log>
    <gel:log level="INFO">XOG Updated:  "${updated}". </gel:log>
    <!-- Logout XOG -->
    <soap:invoke endpoint="${XOGURLAUTO}" var="result">
      <soap:message>
        <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
          <soap-env:Header>
            <xog:Auth>
              <xog:SessionID>${sessionID}</xog:SessionID>
            </xog:Auth>
          </soap-env:Header>
          <soap-env:Body>
            <xog:Logout/>
          </soap-env:Body>
        </soap-env:Envelope>
      </soap:message>
    </soap:invoke>
  </core:choose>
  <gel:log level="INFO">Number of rows to process is -- ${v_toprocess.rows[0].num}</gel:log>
  <gel:log level="INFO">ITINITIALEST xog: Finished</gel:log>
</gel:script>

 

 

 

 

Error message:

BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:184:45: <gel:include> java.lang.NullPointerException at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:671) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:259) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.soap.SOAPTagSupport.parseBody(SOAPTagSupport.java:68) at com.niku.union.gel.tags.soap.MessageTag.doTag(MessageTag.java:38) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.soap.InvokeTag.doTag(InvokeTag.java:65) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.ScriptTag.doTag(ScriptTag.java:20) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at com.niku.union.gel.GELScript.run(GELScript.java:48) at com.niku.union.gel.GELController.invoke(GELController.java:74) at com.niku.bpm.services.ExecuteCustomAction.run(ExecuteCustomAction.java:207) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:724) Caused by: java.lang.NullPointerException at com.niku.union.gel.tags.IncludeTag.doTag(IncludeTag.java:49) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) ... 31 more Root cause java.lang.NullPointerException at com.niku.union.gel.tags.IncludeTag.doTag(IncludeTag.java:49) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at org.apache.commons.jelly.impl.StaticTag.doTag(StaticTag.java:65) at org.apache.commons.jelly.impl.StaticTagScript.run(StaticTagScript.java:102) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.soap.SOAPTagSupport.parseBody(SOAPTagSupport.java:68) at com.niku.union.gel.tags.soap.MessageTag.doTag(MessageTag.java:38) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) at com.niku.union.gel.tags.soap.Invoke...

Outcomes