Clarity

  • 1.  Updating records with just one search criteria using ZOG

    Posted Apr 02, 2018 03:35 PM

    I am trying to update records in PPM using XOG.

     

    Every time we try to use XOG it is asking for the name and we need only to use the ProjectID

     

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

    <Header version="12.0" action="write" objectType="project" externalSource="NIKU" />

    <Projects>

    <Project projectID="000001" >

    <CustomInformation>

    <ColumnValue name="named_client_id">1 – bank name 1</ColumnValue>

    </CustomInformation>

    <General addedBy="admin" addedDate="2018-04-02"/>

    <OBSAssocs>

    </OBSAssocs>

     </Projects>

     

    <Project projectID="000002" >

    <CustomInformation>

    <ColumnValue name="named_client_id">2 – bank name 2</ColumnValue>

    </CustomInformation>

    <General addedBy="admin" addedDate="2018-04-02"/>

    <OBSAssocs>

    </OBSAssocs>

      </Projects>

     

    <Project projectID="000003" >

    <CustomInformation>

    <ColumnValue name="named_client_id">3 – bank name 3</ColumnValue>

    </CustomInformation>

    <General addedBy="admin" addedDate="2018-04-02"/>

    <OBSAssocs>

    </OBSAssocs>

      </Projects>

     

    </Project>

     

    When we run the code above it fails and is saying it needs "name".

     

    Error Mesaage

     

    <XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd">
    <Object type="project"/>
    <Status elapsedTime="0.001 seconds" state="FAILURE"/>
    <Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/>
    <ErrorInformation>
    <Severity>FATAL</Severity>
    <Description>
    [Error] :1:1: element "Project" is missing "name" attribute
    </Description>
    <Exception type="java.lang.Exception">Invalid xml data</Exception>
    </ErrorInformation>
    </XOGOutput>

     

    We have 1717 projects we need to update.

     

    However, we only need to update the field using the Project id, in SQL would be

     

    UPDATE Project

    SET named_Client_ID = '0001 – bank name 2'

    WHERE ProjectID =PRJ00000101'

     

    This should be a very simple task. It is a custom field we created but nothing special.

    We would have a section of code for each record.

     

    <Project projectID="PRJ00000103" >

    <CustomInformation>

    <ColumnValue name="named_client_id">0001 – bank name 3</ColumnValue>

    </CustomInformation>

    <General addedBy="admin" addedDate="2018-04-02"/>

    <OBSAssocs>

    </OBSAssocs>

      </Projects>



  • 2.  Re: Updating records with just one search criteria using ZOG

    Posted Apr 03, 2018 04:07 AM

    I do not think you can do that.

    If you use XOG you have to follow the XOG rules. For project the required fields in update are

      <Project     projectID="zproject"     name="zproject">

     I cannot think of anything that a user could do to skip the name attribute.



  • 3.  Re: Updating records with just one search criteria using ZOG

    Posted Apr 03, 2018 06:45 AM

    Agreed with urmas point as there are some mandatory fields which needs to be pass in XML The name and the projectId are the mandatory attributes of projects to XOG.



  • 4.  Re: Updating records with just one search criteria using ZOG

    Posted Apr 09, 2018 02:02 AM

    The projectID and Name are mandatory, but, the projectID is the attribute which can't be updated.  You can use XOG to update the name using format:

    <Project projectID="current_project_id" name="new_project_name" />

    You may need to include additional attributes, above is just to show the format.

     

    To test the above, I used OOTB prj_projects_read to pull back a sample project via XOG, updated the XOG output to enter a new Project Name, and xog'ed back in again.  The Project Name was updated.