Clarity

 View Only
  • 1.  XOG WSDL update project allocations

    Posted Feb 02, 2016 04:09 AM

    I want to update project allocations via C# webservice. What have I done so far:

    1. Added webservice reference to servername../niku/wsdl/Object/Projects

    2. I tested Auth function - It works (I tried to read project data and it works).

     

    What I want is updating allocations for some project. But I do not know the proper structure of that XML structure. Which type of header method action should I use to preform update? I do know only write and read option for action parameter. Is there an 'update' option?

    Currently I'm using below function from service reference. Is that correct function to execute update?

    wsdl.PNG

     

    Below is attached an write example for creating project. Probably, update XML structure should be pretty similar.

    <?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.0.0.5028"/>
    <Projects>
    <Project active="true" alignment="100" approved="true"
      approvedForBilling="1" asOf="2009-01-02T00:00:00"
      billingCurrencyCode="USD" billingType="S"
      calculateFinancialMetrics="true" chargeCodeExtID="Expense"
      closed="false"
      currencyISOcode="USD"
      description="A Test Project Description11" 
      equipmentCostSource="Financial Cost and Rate Matrix"
      equipmentExchageRateType="AVERAGE"
      equipmentRateSource="Financial Cost and Rate Matrix"
      expenseCostSource="Financial Cost and Rate Matrix"
             expenseExchageRateType="AVERAGE"
                expenseRateSource="Financial Cost and Rate Matrix"
                financialStatus="O" finish="2009-12-31T17:00:00"
                flexibilityRisk="0"
                setBudgetValuesEqualToPlannedValues="true" format="0"
                fundingRisk="0" goalCode="IMPROVE_INFRASTRUCTURE"
                humanInterfaceRisk="0" implementationRisk="0"
                interdependenciesRisk="0"
                laborCostSource="Financial Cost and Rate Matrix"
                laborExchageRateType="AVERAGE"
                laborRateSource="Financial Cost and Rate Matrix"
                lastUpdatedBy="admin" lastUpdatedDate="2009-02-11T09:42:05"
                managerResourceID="paulMartin"
                materialCostSource="Financial Cost and Rate Matrix"
                materialExchageRateType="AVERAGE"
                materialRateSource="Financial Cost and Rate Matrix"
                name="A Test Project" objectivesRisk="0"
                openForTimeEntry="true" organizationalCultureRisk="0"
                pageLayoutCode="projmgr.projectPageFrame"
                plannedBenFinish="2010-01-01T00:00:00"
                plannedBenStart="2009-12-01T00:00:00" plannedBenTotal="1000"
                plannedBreakEven="2010-01-01T00:00:00"
                plannedCostFinish="2010-01-01T00:00:00"
                plannedCostStart="2009-01-01T00:00:00"
                plannedCostTotal="1000" plannedNPV="0" plannedROI="0"
                priority="10" processCode="IT" program="false" progress="0"
                projectID="project1111" requiredForScenarios="false"
                resourceAvailabilityRisk="0" sponsorshipRisk="0"
                stageCode="CSK_INITIATION" start="2009-01-01T08:00:00"
                status="1" statusComment="Status Comment Text"
                statusIndicator="1" supportabilityRisk="0"
                syncInvestmentAndBudgetDates="true" technicalRisk="0"
                template="false" trackMode="2">
                <Resources>
                    <Resource availFrom="2009-01-01T08:00:00"
                        availTo="2009-12-31T17:00:00" bookingStatus="5"
                        defaultAllocation="1" isProjectManager="false"
                        lastUpdatedBy="admin"
                        lastUpdatedDate="2009-02-11T09:39:40"
                        openForTimeEntry="true"
                        projectRoleID="csk.Architect" resourceID="artKatect">
                        <Baselines/>
                        <AllocCurve/>
                        <CustomInformation>
                            <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                        </CustomInformation>
                        <SkillAssocs/>
                    </Resource>
                    <Resource availFrom="2009-01-01T08:00:00"
                        availTo="2009-12-31T17:00:00" bookingStatus="5"
                        defaultAllocation="1" isProjectManager="true"
                        lastUpdatedBy="admin"
                        lastUpdatedDate="2009-02-11T09:40:11"
                        openForTimeEntry="true"
                        projectRoleID="csk.Project Manager" resourceID="paulMartin">
                        <Baselines/>
                        <AllocCurve/>
                        <CustomInformation>
                            <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                        </CustomInformation>
                        <SkillAssocs/>
                    </Resource>
                </Resources>
                <Tasks>
                    <Task finish="2009-12-31T17:00:00"
                        internalTaskID="5000578" key="false"
                        lastUpdatedBy="admin"
                        lastUpdatedDate="2009-02-11T09:39:40"
                        lockedForScheduling="false" milestone="false"
                        name="A Test Project" orderID="1" outlineLevel="1"
                        percComp="0" start="2009-01-01T08:00:00" status="0"
                        summary="false" taskID="~rmw" topDownPercent="0">
                        <Assignments>
                            <TaskLabor actualWork="0" baselineWork="0"
                                estPattern="3" finish="2009-12-31T17:00:00"
                                lastUpdatedBy="admin"
                                lastUpdatedDate="2009-02-11T09:39:41"
                                remainingWork="2088" resourceID="artKatect"
                                roleID="csk.Architect"
                                start="2009-01-01T08:00:00" unpostedActuals="0">
                                <Baselines/>
                                <EstCurve>
                                    <Segment finish="2010-01-01T00:00:00"
                                        start="2009-01-01T00:00:00" sum="2088.0000"/>
                                </EstCurve>
                                <ActCurve/>
                                <CustomInformation>
                                    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                                </CustomInformation>
                            </TaskLabor>
                            <TaskLabor actualWork="0" baselineWork="0"
                                estPattern="3" finish="2009-12-31T17:00:00"
                                lastUpdatedBy="admin"
                                lastUpdatedDate="2009-02-11T09:40:11"
                                remainingWork="2088" resourceID="paulMartin"
                                roleID="csk.Project Manager"
                                start="2009-01-01T08:00:00" unpostedActuals="0">
                                <Baselines/>
                                <EstCurve>
                                    <Segment finish="2010-01-01T00:00:00"
                                        start="2009-01-01T00:00:00" sum="2088.0000"/>
                                </EstCurve>
                                <ActCurve/>
                                <CustomInformation>
                                    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                                </CustomInformation>
                            </TaskLabor>
                        </Assignments>
                        <estimateRules/>
                        <CustomInformation>
                            <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                        </CustomInformation>
                    </Task>
                    <Task chargeCodeExtID="Expense"
                        finish="2009-12-31T17:00:00"
                        internalTaskID="5000585" key="true"
                        lastUpdatedBy="admin"
                        lastUpdatedDate="2009-02-11T09:41:22"
                        lockedForScheduling="false" milestone="false"
                        name="Task1" nextSiblingOf="~rmw" orderID="2"
                        outlineLevel="1" percComp="0"
                        start="2009-01-01T08:00:00" status="0"
                        summary="false" taskID="Task1">
                        <Baselines/>
                        <Assignments>
                            <TaskLabor actualWork="0" baselineWork="0"
                                estPattern="3" finish="2009-12-31T17:00:00"
                                lastUpdatedBy="admin"
                                lastUpdatedDate="2009-02-11T09:41:03"
                                remainingWork="2088" resourceID="artKatect"
                                roleID="csk.Architect"
                                start="2009-01-01T08:00:00" unpostedActuals="0">
                                <Baselines/>
                                <EstCurve>
                                    <Segment finish="2010-01-01T00:00:00"
                                        start="2009-01-01T00:00:00" sum="2088.0000"/>
                                </EstCurve>
                                <ActCurve/>
                                <CustomInformation>
                                    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                                </CustomInformation>
                            </TaskLabor>
                            <TaskLabor actualWork="0" baselineWork="0"
                                estPattern="3" finish="2009-12-31T17:00:00"
                                lastUpdatedBy="admin"
                                lastUpdatedDate="2009-02-11T09:41:03"
                                remainingWork="2088" resourceID="paulMartin"
                                roleID="csk.Project Manager"
                                start="2009-01-01T08:00:00" unpostedActuals="0">
                                <Baselines/>
                                <EstCurve>
                                    <Segment finish="2010-01-01T00:00:00"
                                        start="2009-01-01T00:00:00" sum="2088.0000"/>
                                </EstCurve>
                                <ActCurve/>
                                <CustomInformation>
                                    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                                </CustomInformation>
                            </TaskLabor>
                        </Assignments>
                        <estimateRules/>
                        <CustomInformation>
                            <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                        </CustomInformation>
                    </Task>
                </Tasks>
                <CustomInformation>
                    <ColumnValue name="obj_align_factor1">50</ColumnValue>
                    <ColumnValue name="obj_align_factor2">50</ColumnValue>
                    <ColumnValue name="obj_align_factor3">50</ColumnValue>
                    <ColumnValue name="obj_align_factor4">50</ColumnValue>
                    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                </CustomInformation>
                <General addedBy="admin" addedDate="2009-02-11"/>
                <OBSAssocs completed="false">
                    <OBSAssoc id="Business Unit" name="Business Unit" 
                        unitPath="/All Business Units/Business Operations/Operational Systems"/>
                    <OBSAssoc id="corp_dept" name="CORP Department OBS" unitPath="/CORP IT"/>
                    <OBSAssoc id="Security OBS" name="Security OBS" 
                        unitPath="/Corporate/IT/Portfolio"/>
                </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>
    


    I would really appreciate any help.



  • 2.  Re: XOG WSDL update project allocations

    Posted Feb 02, 2016 10:11 AM

    AFAIK you would still use the normal project write XOG and update the <Resources> block of the XML. This isn't something we do, but as I understand it you basically need to XOG out the project you want to change allocations for, then make adjustments to the <Resources> section and write it back in



  • 3.  Re: XOG WSDL update project allocations

    Posted Feb 02, 2016 10:20 AM

    Thank you, that works. Now I have a problem with setting allocations. I want to set allocations with unit of hours, because right now, I do not now what means 'sum' attribute in segement of AllocCurve element.
    Do you maybe have any idea?

     

    <Resource availFrom="2004-10-04T00:00:00" availTo="2004-10-30T00:00:00" defaultAllocation="1" isProjectManager="false" lastUpdatedBy="sbutler" lastUpdatedDate="2004-11-10T17:42:38" openForTimeEntry="true" resourceID="PRJ_COVRG_Bricks">
       <AllocCurve>
          <Segment finish="2004-11-1T00:00:00" start="2004-10-01T00:00:00" sum="1.0" />
          <Segment finish="2004-11-31T00:00:00" start="2004-11-01T00:00:00" sum="1.0" />
          <!-- what means SUM? How to insert 10 hours for some month? -->
       </AllocCurve>
    </Resource>
    
    

     

    I found this topic:Help with XOG AllocCurve sum value

    Is everything correct with calculation in above topic?



  • 4.  Re: XOG WSDL update project allocations

    Posted Feb 02, 2016 10:50 AM

    Math looks right as far as what the dif values represent, but I think (and could be wrong as I dont think I've done allocation via xog before) sum is just a value for minutes, so 10 hours would be 600 minutes. I want to say thats how its worked with task ETC so I'd think its the same for allocations, but don't take my word for it. If I had to guess, you would put the time value in SUM, and once that gets processed you'd see a new allocation % automagically calculated by clarity in the UI. Test it out (in a Test environment, of course) and let us know what it does.



  • 5.  Re: XOG WSDL update project allocations

    Posted Feb 02, 2016 11:18 AM

    I think that for allocation XOG the segment 'sum' is just the %age of the relevant resource's availability (so like what we would enter in the application screen for maintaining team member allocation segments).

     

    So the somewhat fiddly calculation in that other referenced thread is what you would need to use to get to "10 hours" (since it is duration and resource availability dependant)



  • 6.  Re: XOG WSDL update project allocations

    Posted Feb 04, 2016 03:30 AM

    Sorry for late response. In my case the correct calculation for sum is: hours divided by working days.

     

    Now I have another problem. When I want to update specific resource script inserts new resource instead of updating existing one.

     

             
    <Resource projectRoleID="ROLE_someid" requirementName="someid" resourceID="someid">

     

    What am I missing here?