Clarity

  • 1.  Passing parameter in XOG header in a process

    Posted Jun 07, 2017 09:44 PM

    This is the first time I am writing the Parameterized Gel script. I need to write a process to update an attribute in Team for both Otherwork and Project. The process is failing for "Otherwork". Can you please help?

    Query which is returning ObjectType as either 'otherInvestment' or Project

    Data Source Query - 

     

    SELECT
    DISTINCT
    inv.code
    , inv.id
    ,case when odf_object_code='other' then 'otherInvestment' else 'project' end as type
    FROM PRTEAM team
    JOIN INV_INVESTMENTS inv on inv.id = team.prprojectid
    LEFT JOIN inv_projects invproj on invproj.prid = inv.id and invproj.is_template = 0
    LEFT JOIN prj_resources res on res.prid = team.prresourceid
    LEFT JOIN SRM_RESOURCES srm on srm.id = team.prresourceid
    WHERE
    inv.odf_object_code IN ('project','other') AND
    res.prisrole = 0 and inv.is_active=1
    and inv.id not in (select prl.prrecordid from prlock prl where prl.prtablename = 'SRM_PROJECTS')
    and resource_type is not null
    and resource_type=0

     

    Variable declared - 

    <core:set value="${project_info_rows.type}" var="OBJ_TYPE"/>

     

     

    <Header action="read" externalSource="NIKU" objectType="${OBJ_TYPE}" version="6.0.11">

     

    Project Read failed for "Other work" when I run the process

    Project Read XOG Status for gap_Infra_Net : FAILURE

     

    Read Script - 

    <gel:parse var="prj_read">
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header action="read" externalSource="NIKU" objectType="${OBJ_TYPE}" version="6.0.11">
    <args name="order_by_1" value="name"/>
    <args name="order_by_2" value="projectID"/>
    <args name="include_tasks" value="false"/>
    <args name="include_dependencies" value="false"/>
    <args name="include_subprojects" value="false"/>
    <args name="include_resources" value="true"/>
    <args name="include_baselines" value="false"/>
    <args name="include_allocations" value="true"/>
    <args name="include_estimates" value="false"/>
    <args name="include_actuals" value="false"/>
    <args name="include_custom" value="false"/>
    <args name="include_burdening" value="false"/>
    </Header>
    <Query>
    <Filter criteria="EQUALS" name="projectID">${INV_CODE}</Filter>
    </Query>



  • 2.  Re: Passing parameter in XOG header in a process

    Posted Jun 08, 2017 07:23 AM

    you should bring filter criteria name for other work as well, because its different for project and other work 

     

    For other work, you should be using this:

    <Filter criteria="EQUALS" name="objectID">${INV_CODE}</Filter>



  • 3.  Re: Passing parameter in XOG header in a process
    Best Answer

    Posted Jun 08, 2017 09:34 AM

    Thanks Kritika,

    I fixed that yesterday but still it did not work.

    Error - Read XOG Status for Bas_PDM of Type otherInvestment: FAILURE

     

    I added if block :

     

    <core:set value="${resource_info.rowCount}" var="totalNumber"/>
    <core:if test="${totalNumber > 0}">
    <core:set value="${resource_info.rowCount}" var="totalNumber"/>
    <!-- Read out the project -->
    <core:if test="${OBJ_TYPE == 'project'}">
    <gel:parse var="prj_read">
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header action="read" externalSource="NIKU" objectType="${OBJ_TYPE}" version="6.0.11">
    <args name="order_by_1" value="name"/>
    <args name="order_by_2" value="projectID"/>
    <args name="include_tasks" value="false"/>
    <args name="include_dependencies" value="false"/>
    <args name="include_subprojects" value="false"/>
    <args name="include_resources" value="true"/>
    <args name="include_baselines" value="false"/>
    <args name="include_allocations" value="true"/>
    <args name="include_estimates" value="false"/>
    <args name="include_actuals" value="false"/>
    <args name="include_custom" value="false"/>
    <args name="include_burdening" value="false"/>
    </Header>
    <Query>
    <Filter criteria="EQUALS" name="projectID">${INV_CODE}</Filter>
    </Query>
    </NikuDataBus>
    </gel:parse>
    </core:if>
    <!-- Read out the project -->
    <core:if test="${OBJ_TYPE == 'otherInvestment'}">
    <gel:parse var="prj_read">
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd">
    <Header action="read" externalSource="NIKU" objectType="${OBJ_TYPE}" version="6.0.11">
    <args name="order_by_1" value="name"/>
    <args name="order_by_2" value="objectID"/>
    <args name="include_tasks" value="false"/>
    <args name="include_dependencies" value="false"/>
    <args name="include_subprojects" value="false"/>
    <args name="include_resources" value="true"/>
    <args name="include_baselines" value="false"/>
    <args name="include_allocations" value="true"/>
    <args name="include_estimates" value="false"/>
    <args name="include_actuals" value="false"/>
    <args name="include_custom" value="false"/>
    <args name="include_burdening" value="false"/>
    </Header>
    <Query>
    <Filter criteria="EQUALS" name="objectID">${INV_CODE}</Filter>
    </Query>
    </NikuDataBus>
    </gel:parse>
    </core:if>



  • 4.  Re: Passing parameter in XOG header in a process

    Posted Jun 08, 2017 10:16 AM

    It worked I had to use higher version instead 6.0.11