XOG read action for a project is missing the 'financialLocation' and 'financialDepartment' attributes

Document ID : KB000022106
Last Modified Date : 14/02/2018
Show Technical Document Details

Issue:

If we perform a XOG read action on a project that has existing financial properties for Department OBS Unit and Location OBS Unit we don't see the 'financialLocation' and 'financialDepartment' attributes appear in the resulting xml output file.

We can perform a XOG write action with these two attributes and it works successfully to update the values.

Steps to Reproduce:

  1. Login to the application as an administrator user  
  2. Main Application > Projects > create a new project or select an existing project (myProject1010)  
    Financials sub-page > ensure the financial properties are filled in for Department, Location, etc  
  3. Using the XOG sample 'prj_projects_read.xml' file ; modify the query to XOG read this one project

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header version="12.1.0" action="read" objectType="project" externalSource="NIKU">
    </Header>
    <Query>
    <Filter name="projectID" criteria="EQUALS">myProject1010</Filter>
    </Query>
    </NikuDataBus>

  4. Execute the XOG read action
  5. Examine the resulting output xml file

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd">
    <Header action="write" externalSource="NIKU" objectType="project" version="12.1.0.5840"/>
    <Projects>
    <Project active="true" approved="false" approvedForBilling="1"
    billExpenses="0" billingCurrencyCode="USD" billingType="S"
    calculatePresentValueInfo="true" closed="false"
    currencyISOcode="USD" entityCode="myEntity"
    equipmentExchageRateType="AVERAGE"
    expenseExchageRateType="AVERAGE"
    financialProjectClass="PROJECT" financialStatus="H"
    financialWipClass="PROJECT" finish="2011-06-30T17:00:00"
    forecastEqualsBudget="false" format="0"
    laborCostSource="myMatrix1000"
    laborExchageRateType="AVERAGE"
    laborRateSource="myMatrix1000" lastUpdatedBy="kathryn"
    lastUpdatedDate="2011-05-26T15:02:02"
    managerResourceID="kathryn"
    materialExchageRateType="AVERAGE" name="myProject1010"
    openForTimeEntry="true"
    pageLayoutCode="projmgr.projectPageFrame"
    percentCalcMode="0" percentComplete="0"
    plannedBenFinish="2011-07-01T00:00:00"
    plannedBenStart="2011-04-01T00:00:00" plannedBenTotal="0"
    plannedCostFinish="2011-07-01T00:00:00"
    plannedCostStart="2011-04-01T00:00:00"
    plannedCostTotal="30000" plannedNPV="-30000" plannedROI="0"
    priority="10" program="false" progress="0"
    projectID="myProject1010" requiredForScenarios="false"
    start="2011-04-01T08:00:00" status="0"
    syncInvestmentAndBudgetDates="true" template="false" trackMode="2">
    <Allocations/>
    <scenarioDependencies/>
    <InvestmentAssociations>
    <Allocations/>
    <Hierarchies/>
    </InvestmentAssociations>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    <General addedBy="kathryn" addedDate="2011-05-05"/>
    <OBSAssocs completed="false">
    <OBSAssoc id="mydepartment" name="myDepartment" unitPath="/myDepartment001"/>
    <OBSAssoc id="mylocation" name="myLocation" unitPath="/myLocation"/>
    </OBSAssocs>
    <BurdeningAssocs>
    <BurdeningAssoc transactionType="Labor"/>
    <BurdeningAssoc transactionType="Material"/>
    <BurdeningAssoc transactionType="Expenses"/>
    <BurdeningAssoc transactionType="Equipment"/>
    </BurdeningAssocs>
    </Project>
    </Projects>
    <XOGOutput>
    <Object type="project"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0"
    totalNumberOfRecords="1" updatedRecords="0"/>
    <Records/>
    </XOGOutput>
    </NikuDataBus>

Expected Result: Expected to see 'financialLocation' and 'financialDepartment' attributes appear in the XOG output xml
Actual Result: Both of these attributes do not appear in the XOG output xml

Resolution:

In Clarity 8.1 and 12.x, the Financial Module functionality for Departments and Locations changed from previous versions, so that now, in v13.x and beyond, it uses the concept of OBS Units.

The 'financialLocation' and 'financialDepartment' financial attributes in the XOG functionality are left over from previous versions.

If you examine the output you will see the following information provided for the Department and Location

<OBSAssocs completed="false">
<OBSAssoc id="mydepartment" name="myDepartment" unitPath="/myDepartment001"/>
<OBSAssoc id="mylocation" name="myLocation" unitPath="/myLocation"/>
</OBSAssocs>

Therefore, if you have this syntax in your XOG write xml file, the Department and Location values will be set from the OBS associations.

Although the 'financialLocation' and 'financialDepartment' attributes are not generated from a current XOG read action, they can still be used in a XOG write action.

Care must be taken when using these attributes. If you have BOTH the 'financialLocation', 'financialDepartment' attributes AND the <OBSAssocs> tag in the xml file for the project, the XOG write action will use the values in the financial attributes over the <OBSAssocs> tag.

Example:

The following example demonstrates how the XOG write action behaves when both the financial attributes and the <OBSAssocs> tag are present in the XOG xml file.

  1. Admin Tool > OBS > myDepartment > Properties : Associated Objects - check to ensure the Project Object is associated with this OBS definition

  2. Admin Tool > OBS > myLocation > Properties : Associated Objects - check to ensure the Project Object is associated with this OBS definition

    NOTE: If the XOG write xml file includes the <OBSAssocs> tag and OBS definition is NOT associated to the Project Object, the XOG write action will generate an error message. This error message will be generated with no OBS object association and this message will occur regardless of the presence of the 'financialLocation' and 'financialDepartment' attributes in the xml file. If the XOG write xml file does not include the <OBSAssocs> tag with no OBS object association, this message will not be generated.

    <ErrorInformation>
    <Severity>WARNING</Severity>
    <Description>OBS id (mylocation) is invalid. So, the OBS Association was not made.

    OBS association has been updated according to financial information.</Description>
    </ErrorInformation>

  3. Update the XOG write xml to include the 'financialLocation' and 'financialDepartment' attributes to change the Department value (keep the <OBSAssocs> tag info with different values). The 'financialLocation' and 'financialDepartment' attributes use the OBS Unit ID whereas the <OBSAssocs> tag uses the OBS Unit Name. In this example, the financial attributes will attempt to change to Department #2, keeping the <OBSAssocs> tag for Department #1.

    <?xml version="1.0" encoding="UTF-8"?>
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_project.xsd">
    <Header action="write" externalSource="NIKU" objectType="project" version="12.1.0.5840"/>
    <Projects>
    <Project active="true" approved="false" approvedForBilling="1"

    financialLocation="mylocation" financialDepartment="mydept1002"
    billExpenses="0" billingCurrencyCode="USD" billingType="S"
    calculatePresentValueInfo="true" closed="false"
    currencyISOcode="USD" entityCode="myEntity"
    equipmentExchageRateType="AVERAGE"
    expenseExchageRateType="AVERAGE"
    financialProjectClass="PROJECT" financialStatus="H"
    financialWipClass="PROJECT" finish="2011-06-30T17:00:00"
    forecastEqualsBudget="false" format="0"
    laborCostSource="myMatrix1000"
    laborExchageRateType="AVERAGE"
    laborRateSource="myMatrix1000" lastUpdatedBy="kathryn"
    lastUpdatedDate="2011-05-26T15:02:02"
    managerResourceID="kathryn"
    materialExchageRateType="AVERAGE" name="myProject1010"
    openForTimeEntry="true"
    pageLayoutCode="projmgr.projectPageFrame"
    percentCalcMode="0" percentComplete="0"
    plannedBenFinish="2011-07-01T00:00:00"
    plannedBenStart="2011-04-01T00:00:00" plannedBenTotal="0"
    plannedCostFinish="2011-07-01T00:00:00"
    plannedCostStart="2011-04-01T00:00:00"
    plannedCostTotal="30000" plannedNPV="-30000" plannedROI="0"
    priority="10" program="false" progress="0"
    projectID="myProject1010" requiredForScenarios="false"
    start="2011-04-01T08:00:00" status="0"
    syncInvestmentAndBudgetDates="true" template="false" trackMode="2">
    <Allocations/>
    <scenarioDependencies/>
    <InvestmentAssociations>
    <Allocations/>
    <Hierarchies/>
    </InvestmentAssociations>
    <CustomInformation>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
    </CustomInformation>
    <General addedBy="kathryn" addedDate="2011-05-05"/>
    <OBSAssocs completed="false">
    <OBSAssoc id="mydepartment" name="myDepartment" unitPath="/myDepartment001"/>
    <OBSAssoc id="mylocation" name="myLocation" unitPath="/myLocation"/>
    </OBSAssocs>
    <BurdeningAssocs>
    <BurdeningAssoc transactionType="Labor"/>
    <BurdeningAssoc transactionType="Material"/>
    <BurdeningAssoc transactionType="Expenses"/>
    <BurdeningAssoc transactionType="Equipment"/>
    </BurdeningAssocs>
    </Project>
    </Projects>
    <XOGOutput>
    <Object type="project"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0"
    totalNumberOfRecords="1" updatedRecords="0"/>
    <Records/>
    </XOGOutput>
    </NikuDataBus>

  4. Execute the XOG write action

    <?xml version="1.0" encoding="UTF-8"?>
    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="project"/>
    <Status state="SUCCESS"/>
    <Statistics failureRecords="0" insertedRecords="0"
    totalNumberOfRecords="1" updatedRecords="1"/>
    <Records>
    <Record>
    <KeyInformation>
    <column name="ID">5002086</column>
    <column name="name">myProject1010</column>
    <column name="UNIQUE_NAME">myProject1010</column>
    </KeyInformation>
    <ErrorInformation>
    <Severity>WARNING</Severity>
    <Description>OBS association has been updated according to financial information.</Description>
    </ErrorInformation>
    </Record>
    </Records>
    </XOGOutput>

NOTE: The error message is just a warning. The warning message is present because the xml XOG write file contains both the financial attributes and the <OBSAssocs> tag. It indicates that the values in the financial attributes will be used instead of the values in the <OBSAssocs> tag. This message also is present when the XOG write xml file contains only the 'financialLocation' and 'financialDepartment' attributes.

The XOG write xml file can contain either the financial attributes OR the <OBSAssocs> tag, or the file can contain BOTH as described above.