AnsweredAssumed Answered

Error while swapping data between 2 project attributes using Gel script

Question asked by cappmfan on Feb 8, 2016
Latest reply on Feb 11, 2016 by gcubed

Hi Experts,


Aim: To build a Gel script to swap data between 2 project attributes for all active projects using soap and xog...




The steps we have are as follows.

1. Xog out the project in Gel script.

2. Retrieve the values of the attributes (Manager and a Custom 'manager' attribute) from the xogged out xml (in memory)

3. After swapping the values, set the attribute values in the xml.

4. Xog in the modified xml back to application to update the project with swapped values.


Provided below is the basic structure of my Gel script with the error i am facing an error as enlarged and highlighted in Red below.

My problem here is while trying to set the value the managerresourceid attribute in the xogged out xml using gel:set.




<gel:script xmlns:core="jelly:core"
  xmlns:xsd="" >

   <!-- Log into XOG and get a session ID -  Works fine -->
   <!-- Using Soap to xog out project to variable xogresponse -->

   <soap:invoke endpoint="${xogURL}" var="xogresponse">
  <soapenv:Envelope  xmlns:soapenv=""
  <NikuDataBus xmlns:xsi="" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
   <Header version="6.0.11" action="read" objectType="project" externalSource="NIKU">
  <args name="order_by_1" value="name"/>
  <args name="order_by_2" value="projectID"/>
  <args name="include_tasks" value="false"/>
  <args name="include_dependencies" value="false"/>
  <args name="include_subprojects" value="false"/>
  <args name="include_resources" value="false"/>
  <args name="include_baselines" value="false"/>
  <args name="include_allocations" value="false"/>
  <args name="include_estimates" value="false"/>
  <args name="include_actuals" value="false"/>
  <args name="include_custom" value="true"/>
  <args name="include_burdening" value="false"/>

  <Filter name="projectID" criteria="EQUALS">009460</Filter>

    <!--Retrieve value from xml where managerResourceID is an attribute of the Project element-->  
  <gel:set var="mgr" select="$xogresponse//@managerResourceID" asString="true" /> 

  <gel:out>${mgr}</gel:out>  Result here on running the script is managerResourceID="manager12". Expected result was "manager12"; without the attribute name.

   <gel:expr  select="$mgr"/>          Result here on running the script is "manager12" as expected, but how to use this to set an attribute in the project xml in memory (xogresponse variable)

  <!-- Trying to set value of managerResourceID  -->

  <gel:set value="${mgr}" select="$xogresponse//@managerResourceID"/>  

Result here on running the script - Internal error: file:/C:/CA132XOG/bin/test.javascript:;javascript:;xml:159:87: <gel:set> Missing or invalid XML. Here is the issue.

  <!-- Log out of the XOG -->




If i replace ${mgr} in <gel:set value="${mgr}" select="$xogresponse//@managerResourceID"/> with a hard coded text value like 'ABDC' like below, the managerResourceID attribute gets updated and he gel script runs without errors.


<gel:set value="ABDC" select="$xogresponse//@managerResourceID"/>


Not sure if i am missing something. Ideas?