AnsweredAssumed Answered

GEL script to XOG object using SOAP

Question asked by fabricio.de.marchi on Oct 12, 2010
Latest reply on Sep 24, 2012 by karthik_reddy
Hi,

We have the following requirement to implement in Clarity:

When a Project phase is changed, the sub-object instances "Project SDLC Questions" must be evaluated with the new phase.

Basically when we create a new project a series of "SDLC Questions" are also created for this project. This sub-object has Project as parent object.

When the project phase is changed from Envisioning to Planing, for example, each one of the SDLC Question instances related to the current project must be reevaluated.

Currently, we have a process that is fired up when the SDLC Question object is updated in order to evaluate the object and according to a series of filters determine its current status. Since we need to reevaluate all SDLC Questions from a project when its phase is changed we thought about using a GEL script to loop through each of the SDLC Question object instances and update them using XOG in order to fire the process that is supposed to fire when the object is updated.

I was trying to do that using a GEL script that does a SOAP invoke in order to update that object. Here it is the GEL code:
<gel:script xmlns:x="jelly:xml"
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:core="jelly:core"
xmlns:sql="jelly:sql"
xmlns:xog="http://www.niku.com/xog">

<gel:parameter var="XOGusername" default="***"/>
<gel:parameter var="XOGpassword" default="yyy"/>

<soap:invoke endpoint="http://ausgchrwluat2:10202/niku/xog" var="result">
<soap:message>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">
      <soapenv:Body>
        <xog:Login xmlns:xog="http://www.niku.com/xog">
          <xog:Username>${XOGusername}</xog:Username>


  <xog:Password>${XOGpassword}</xog:Password>


  </xog:Login>                        



<!-- start of XOG script -->
       <obj:WriteCustomObjectInstance xmlns:obj="http://www.niku.com/xog/Object">







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







xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">








<Header externalSource="NIKU" version="7.5"/>







<customObjectInstances objectCode="id">








<instance instanceCode="5011660" objectCode="dell_sdlc_prj_quest">









<CustomInformation>










<ColumnValue name="name">TEST665</ColumnValue>










<ColumnValue name="dell_sdlc_desc">TEST888</ColumnValue>









</CustomInformation>









<OBSAssocs/>








</instance>







</customObjectInstances>






</NikuDataBus>







</obj:WriteCustomObjectInstance>



<!-- end of XOG script -->


</soapenv:Body>


</soapenv:Envelope>


</soap:message>
</soap:invoke>

<gel:out>${result}</gel:out>

</gel:script>
I am running that script from my machine and this is the only answer I get:
[#document: null]

Checking the database and the interface I can see that the process is not running after I've executed the GEL script.

It seems the GEL script is not able to connect to the XOG and execute the WRITE operation.

I would appreciate any insights on a possible solution to my requirement as well as to why the above code does not works as it is supposed to.

Thanks,

Fabricio

Outcomes