AnsweredAssumed Answered

update Xog results through Xpath

Question asked by shiva.s43 on Oct 12, 2015
Latest reply on Oct 19, 2015 by shiva.s43

Hi,

 

I was trying to create new user from xog out results of other user by changing unique values and some other basic information of user. I successfully xog out the user and trying to update the values through xpath but when I use it its throwing invalid xml error.

 

Here is the gel script syntax.

 

<gel:parse var="V_username">

  <Filter criteria="EQUALS" name="userName">skumar</Filter>

</gel:parse>

<core:catch var="exception">

  <core:if test="${sessionID.length() > 0}">

  <soap:invoke endpoint="${myXogUrl}" var="xogdata">

  <soap:message>

  <soapenv:Envelope>

  <soapenv:Header>

  <xog:Auth>

  <xog:SessionID>${sessionID}</xog:SessionID>

  </xog:Auth>

  </soapenv:Header>

  <soapenv:Body>

  <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">

  <Header action="read" externalSource="NIKU" objectType="user" version="6.0.11"/>

  <Query>

  <gel:include select="$V_username"/>

  </Query>

  </NikuDataBus>

  </soapenv:Body>

  </soapenv:Envelope>

  </soap:message>

  </soap:invoke>

  </core:if>

</core:catch>

<core:choose>

  <core:when test="${exception != null}">

  <core:set value="${exception.text()}" var="error_message"/>

  <gel:log>error while logging n: ${error_message}</gel:log>

  </core:when>

  <core:otherwise>

  </core:otherwise>

</core:choose>

<!-- Dispaly xog results xml -->

<gel:set asString="true" select="$xogdata" var="printme"/>

<gel:log level="info" message="XOG RESPONSE = ${printme}"/>

 

 

<gel:parse var="exeTag">

  <PersonalInformation lastName="New_lastname" firstName="new_firstname"/>

</gel:parse>

<gel:set select="$xogdata/soapenv:Envelope/soapenv:Body/NikuDataBus/Header/Users/User/PersonalInformation" value="${exeTag}" insert="true"/>

<!-- <gel:set select="$xogdata/soapenv:Envelope/soapenv:Body/NikuDataBus/Header/Users/User" value="${exeTag}" insert="true"/> tried this syntax also-->

<!-- Dispaly updated xog results xml-->

<gel:set asString="true" select="$xogdata" var="printme2"/>

<gel:log level="info" message="XOG RESPONSE updated = ${printme2}"/>

 

The requirement is to create a new user in clarity similar to existing user selected in the copy from field of create new user request form. The new user should have same groups, department/OBS/skills/Financial details etc.

 

Thanks,

Shiva

Outcomes