copying resources and tasks using gel

Discussion created by rajeev.sharma on Oct 12, 2010
Latest reply on Oct 12, 2010 by Chris_Hackett
Hi !

Is there a way to call Copy from Template using gel or java ?

My requirements are : I have a csv file which has project name, template name, start dt, end dt etc.

Now i want to process this file using a gel script for creating new projects with the project name specified in the csv file. New projects should have the data(resources, tasks only) get copied from the template names as specified in the csv file.

I have written a gel script for doing this and is working accurate. But the script is taking very long time to execute because of the following reason :

In my gel script, i am xogging in the resources and tasks one by one in the loop. So, to xog all the resources and taks, gel is doing xog many times.

I thought of a work around to create a variable and parse as below :

select="$xogoutreport/soapenv:Envelope/soapenv:Body/obj:ReadProjectResponse/obj:NikuDataBus/obj:Projects/obj:Project/obj:Tasks" var="xogTasks"/>

select="$xogoutreport/soapenv:Envelope/soapenv:Body/obj:ReadProjectResponse/obj:NikuDataBus/obj:Projects/obj:Project/obj:Resources" var="xogResources"/>

<gel:parse var="xogVariable">

<Project name="${input[2]}" projectID="PR${code.rows[0].code}" managerResourceID="${input[5]}"
start="${input[6]}T08:00:00" finish="${input[7]}T17:00:00" status="${statusnew}" progress="${progressnew}" >

<gel:include select="$xogResources"/>
<gel:include select="$xogTasks"/>

<ColumnValue name="projecttype">${producttype}</ColumnValue>
<ColumnValue name="reportname2">${input[3]}</ColumnValue>
<ColumnValue name="oracleid2">${input[4]}</ColumnValue>
<ColumnValue name="region">${region}</ColumnValue>
<OBSAssocs completed="false">
<OBSAssoc id="ATVIOrgn" name="1 Organization" unitPath="${input[10]}"/>
<OBSAssoc id="Developer" name="2 Developer" unitPath="${input[11]}"/>



But in above script, <gel:include select="$xogResources"/> is returning the structure of Resources as
<Resources xmlns:"http:www.niku.com">

Because of xmlns:"http:www.niku.com" the xog in not happening properly.

Can anyone help me in this.

Any help will be much appreciated.

With Regards