Get Cobra Spread Process

Use the Get Cobra Spread API process to view the results of a Cobra Tphase spread for a specified resource and date range.

You can use this process to preview the Tphase spread before adding it to Cobra.

Process Settings

Below are the settings you must define for the Get Cobra Spread API process:

Setting Description Sample Value
ProcessID This ID informs Cobra to run the Get Cobra Spread process. GetCobraSpread
SpreadInformationFile This setting refers to the full path and file name of the XML file containing the information to be spread. If the path is not specified, the Start In directory is used.

This setting is required.

C:\Program Files\Deltek\Cobra\XMLSpreadInput.xml
SpreadOutputFile This setting refers to the full path and file name of the XML file that will contain the spread results. If the specified path does not exist, it will be created.

This setting is required.

C:\Program Files\Deltek\Cobra\XMLSpreadOutput.xml

Spread Information XML File Structure

The spread information XML file has the following structure:

<SpreadInformation>

<Project Name="xxx">

<Resource Name="xxx">

<CostClass Name="xx">

<Spread SpreadKey=”value”>

<StartDate></StartDate>

<FinishDate></FinishDate>

<SpreadCurve></SpreadCurve>

<Quantity Name="xxx"></Quantity>

</Spread>

Note: The information placed between the <Spread> tags can be repeated if multiple resource spreads are required.

The following information is entered between the <SpreadInformation> and </Spread> tags:

  • <Project Name> — This is the name of the project. An error occurs if the project does not exist.
  • <Resource Name> — This is the name of the resource you want to spread. An error occurs if the resource does not exist.
  • <CostClass Name> — This is the two-letter cost class. An error occurs if the cost class does not exist.
  • <Spread SpreadKey> — The SpreadKey attribute is optional. If used, this attribute will be added to each SpreadValue element in the output XML for the spread that corresponds to the requested Spread. The SpreadKey value can be any identifier that you want to use.
  • <StartDate> — This is the start date of the spread.
  • <FinishDate> — This is the finish date of the spread.
  • <SpreadCurve> — This the name of the spread curve used. If the spread does not exist, a warning displays and the Linear spread is used.
  • <Quantity Name> — This is the name of the result.
  • <Quantity> — This is the numeric value that will be spread in base units.

Spread Information File Sample

Below is a sample code using the <SpreadInformation> tag:

<SpreadInformation>

<Project Name="DEMOADV">

<BudgetElement Name="ASTRO">

<CostClass Name="CB">

<Spread SpreadKey=123>

<StartDate>12/19/99</StartDate>

<FinishDate>04/15/00</FinishDate>

<SpreadCurve>Linear</SpreadCurve>

<Quantity Name="DIRECT">3000</Quantity>

</Spread>

<Spread>

<StartDate>12/19/99</StartDate>

<FinishDate>04/15/00</FinishDate>

<SpreadCurve>Bell</SpreadCurve>

<Quantity>1000</Quantity>

</Spread>

</CostClass>

<CostClass Name="OT">

<Spread>

<StartDate>11/30/99</StartDate>

<FinishDate>04/30/00</FinishDate>

<SpreadCurve>Last Period</SpreadCurve>

<Quantity>3000</Quantity>

</Spread>

</CostClass>

</BudgetElement>

</Project>

</SpreadInformation>

XML Output Structure

The output file has the following XML structure:

<SpreadResults>

<SpreadValue SpreadKey=”value”>

<Project></Project>

<Resource>xxx

<CostClass></CostClass>

<PeriodDate></PeriodDate>

<[Result1]></[Result1]>

<[Result2]></[Result2]>

...

<[ResultN]></[ResultN]>

<SpreadValue>

</SpreadResults>

Note: The <SpreadValue> tags are repeated for each period generated by the spread and each resource specified in the information file.

The following information is entered between the tags:

  • <Project> — This is the name of the project to which the spread information applies. It is the same as the project entered in the information file.
  • <Resource> — This is the name of the resource to which the spread information applies. It is the same as the resource entered in the information file.
  • <CostClass> — This is the name of the cost class to which the spread information applies. It is the same as the cost class entered in the information file.
  • <PeriodDate> — This is the period date for the result values.
  • <[ResultN]> — These tags display the name of the result with the period spread value. They display each result that the resource used.

Sample Script

Below is a sample script file for the Get Cobra Spread API process:

[Process030]

ProcessID=GetCobraSpread

SpreadInformationFile=C:\Program Files\Deltek\Cobra\XMLSpreadInput.xml

SpreadOutputFile=C:\Program Files\Deltek\Cobra\XMLSpreadOutput.xml