AnsweredAssumed Answered

<Gel:Parse: var inside another <gel:parse> variable

Question asked by matej256 on Apr 7, 2016
Latest reply on Apr 8, 2016 by matej256

Hi All,

 

I'd like to ask if someone of you, working with GEL, used <gel:parse> inside next <gel:parse> variable . I didn't find it anywhere but I think it should work.

If not please notify me and suggest another solution. Many Thanks

 

In this example I'm trying to "re-use" a piece of code where Cost or Budget plan is retrieved. I've put this code into $xogReadFinPlan_Query variable and would like to "add" this variable/XML code into $xogReadFinPlan - the whole XOG read for Cost or Budget plan read according to $Plan_type. I assume a "select" statement there is maybe not correct

but couldn't find out what should be there. Can you please help if anyone knows this? Thanks og

I assume a "select" statement

ReadFinPlan_Query$xogReadFinPlan_Query

<!-- Prepare XOG Fin plan read according to Fin plan type, 
  if FORECAST then Cost plan if BUDGET, then Budget plan-->
  <gel:parse var="xogReadFinPlan_Query">
  <Query>
  <Filter name="code" criteria="EQUALS">${Plan_code}</Filter>
  <Filter name="investmentCode" criteria="EQUALS">${Project_code}</Filter>
  </Query>
  </gel:parse>

  <core:if test="${debugFlag != 0}">
  <gel:set asString="true" select="$xogReadFinPlan_Query" var="output"/>
  <core:set value="xogReadFinPlan_Query read: ${output}" var="logMessage"/>
  <gel:log level="DEBUG">${logMessage}</gel:log>
  </core:if>
  <gel:out></gel:out>

  <!-- Budget plan XOG read -->
  <core:if test="${Plan_type eq 'BUDGET'}">
  <gel:parse var="xogReadFinPlan">
  <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_budgetPlan.xsd"> 
  <Header version="13.3.0.286" action="read" objectType="budgetPlan" externalSource="NIKU">
  <args name="no_dependencies" value="true"/>
  </Header>
  <gel:set select="$xogReadFinPlan/NikuDataBus" value="${xogReadFinPlan_Query}" insert="true"/>
  </NikuDataBus>
  </gel:parse>
  </core:if>

  <!-- Cost plan XOG read -->
  <core:if test="${Plan_type eq 'FORECAST'}">
  <gel:parse var="xogReadFinPlan">
  <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_costPlan.xsd"> 
  <Header version="13.3.0.286" action="read" objectType="costPlan" externalSource="NIKU">
  <args name="no_dependencies" value="true"/>
  </Header>
  <gel:set select="$xogReadFinPlan/NikuDataBus"  value="${xogReadFinPlan_Query}" insert="true"/>
  </NikuDataBus>
  </gel:parse>
  </core:if>

 

 

Edit: And the error is saying" Missing or invalid XML" ... as usual

err.JPG

Matej

Outcomes