Clarity PPM1

Expand all | Collapse all

GEL XOG - Troubleshooting Tips

  • 1.  GEL XOG - Troubleshooting Tips

    Posted 09-17-2013 08:52 PM
    Hi,

    I have a process that runs a custom GEL Script that updates records to a sub-object via XOG.

    I'm not sure why, but sometimes the process runs successfully and updates the records in the sub-object and other times it seems like it runs, but it's not actually doing anything.

    I don't have any error messages when I run the process (or even for that step that runs the XOG) so I'm not really sure how to troubleshoot this.

    When I copy the XML code from the Initiated Process Messages section to the xog.client the XOG completes successfully and the updates to the sub-object are successful.

    Has anyone encountered this before? Do you have any troubleshooting tips?

    Thanks in advance!


  • 2.  RE: GEL XOG - Troubleshooting Tips

    Posted 09-18-2013 05:37 AM
    OK very tricky at this stage to suggest anything specific, but....

    christine.takeuchi wrote:

    I'm not sure why, but sometimes the process runs successfully and updates the records in the sub-object and other times it seems like it runs, but it's not actually doing anything.

    I don't have any error messages when I run the process (or even for that step that runs the XOG) so I'm not really sure how to troubleshoot this.
    Debugging a GEL script ; I would generally place a fair amount of <gel:log> messages in my script so that I could spot what it was doing, log out contents of variables etc that control the "flow" of your GEL script so you can see why (possibly data related) certain things are happening/not happening.

    christine.takeuchi wrote:

    When I copy the XML code from the Initiated Process Messages section to the xog.client the XOG completes successfully and the updates to the sub-object are successful.
    I don't quite follow this ; does that mean that your GEL script is outputting (via <gel:log>) the XML message that you are then trying to XOG into Clarity? If so this indicates your GEL process is getting to the right place with teh right XML but are you then "catching" ( <core:catch> ) any errors generated by your XOG/SOAP call and not actually handling the caught exception? If you are not "catching" exceptions, how does your GEL cope with an error generated by the XOG call? Are you testing any return message from the SOAP call (an "error" might be in the XOG response)?

    :unsure:


  • 3.  RE: GEL XOG - Troubleshooting Tips

    Posted 09-18-2013 10:19 PM
      |   view attached
    Hi Dave,

    I'm attaching a screenshot of the Initiated Process Messages screen for my process as well as a copy of my GEL script. The XML code is shown in the Initiated Process Messages screen and if I copy the XML code to the xog.client screen it runs without any errors/issues.

    Do you have any suggestions on things to output to the gel log? I tried to see if I could add the regular output that you would see if you ran the XML from the command prompt XOG, but I wasn't successful with that so I removed those lines of code....

    Thanks,
    Christine

    Attachment(s)

    docx
    gelxog_not_working.docx   110K 1 version


  • 4.  RE: GEL XOG - Troubleshooting Tips

    Posted 09-19-2013 03:20 AM
      |   view attached
    <gel:script
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

    xmlns:core="jelly:core"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
    xmlns:sql="jelly:sql"
    xmlns:util="jelly:util"
    xmlns:xog="http://www.niku.com/xog"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- SQL tag -->
    <gel:parameter default="" var="p_XOGURL"/>
    <gel:parameter default="" var="p_XOGUsername"/>
    <gel:parameter default="" secure="true" var="p_XOGPassword"/>
    <!-- Setup SQL datasources -->
    <gel:setDataSource dbId="niku"/>
    <!-- ================================================= -->
    <!-- Here is my SQL Statement...-->
    <!-- ================================================= -->
    <sql:query var="InactivateLinkRequests" escapeText="false">
    SELECT LINKAGE_ID

    , ACTION_REQUESTED

    , APPLICATION_NAME

    , APPLICATION_CODE
    , ODF_PARENT_ID

    , DIVC

    , DIVISION_NUMBER

    , DIVISION_NAME

    , COST_CENTER

    , CC_NAME_NUMBER

    , CC_MGR_NAME

    , FUNCTIONNAME

    , decode(BFPRIORITY, 1, 'priority_1', 2, 'priority_2', 3, 'priority_3', 4, 'priority_4')

    , CUST_NAME

    ,CUST_EMAIL

    , CUST_FLNAME

    , PRIMARY_FLNAME

    , PRIMARY_EMAIL

    , SECONDARY_FLNAME

    , SECONDARY_EMAIL

    , TRANSMITTED_DATE

    , UPDATED_DATE

    , CREATED_DATE

    , BFL_ID

    , BIANO

    , LINK_STATUS
    , INDICATOR
    , CODE
    , BIANO_ACTIVE

    FROM Z_BOH_PENDING_BF_LINKAGES

    WHERE ACTION_REQUESTED = 'Inactivate'
    </sql:query>


    <!-- ============================================================================== -->
    <!-- Build the XML file using Parse tag and incorporating those variables' values . ..-->
    <!-- ============================================================================== -->
    <gel:parse var="object_xml">
    <NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_application.xsd">
    <Header action="write" externalSource="NIKU" objectType="application" version="8.0" overrideAutoNumbering="false" />
    <Applications>
    <core:forEach items="${InactivateLinkRequests.rowsByIndex}" var="row">

    <core:set var="v_link_id">${row[0]}</core:set>

    <core:set var="v_action_requested">${row[1]}</core:set>

    <core:set var="v_application_name">${row[2]}</core:set>
    <util:replace
    new = ""
    old = "amp;"
    value = "${v_application_name}"
    var = "v_cleaned_application_name"/>

    <core:set var="v_application_code">${row[3]}</core:set>

    <core:set var="v_odf_parent_id">${row[4]}</core:set>

    <core:set var="v_divc">${row[5]}</core:set>

    <core:set var="v_division_number">${row[6]}</core:set>
    <core:set var="v_division_name">${row[7]}</core:set>
    <util:replace
    new = ""
    old = "amp;"
    value = "${v_division_name}"
    var = "v_cleaned_division_name"/>

    <core:set var="v_cost_center">${row[8]}</core:set>

    <core:set var="v_cc_name_number">${row[9]}</core:set>

    <core:set var="v_cc_mgr_name">${row[10]}</core:set>

    <core:set var="v_functionname">${row[11]}</core:set>
    <util:replace
    new = ""
    old = "amp;"
    value = "${v_functionname}"
    var = "v_cleaned_functionname"/>

    <core:set var="v_bfpriority">${row[12]}</core:set>

    <core:set var="v_cust_name">${row[13]}</core:set>

    <core:set var="v_cust_email">${row[14]}</core:set>

    <core:set var="v_cust_flname">${row[15]}</core:set>

    <core:set var="v_primary_flname">${row[16]}</core:set>

    <core:set var="v_primary_email">${row[17]}</core:set>

    <core:set var="v_secondary_flname">${row[18]}</core:set>

    <core:set var="v_secondary_email">${row[19]}</core:set>

    <core:set var="v_transmitted_date">${row[20]}</core:set>

    <core:set var="v_updated_date">${row[21]}</core:set>

    <core:set var="v_created_date">${row[22]}</core:set>

    <core:set var="v_bfl_id">${row[23]}</core:set>

    <core:set var="v_biano">${row[24]}</core:set>

    <core:set var="v_link_status">${row[25]}</core:set>

    <core:set var="v_indicator">${row[26]}</core:set>

    <core:set var="v_bfl_code">${row[27]}</core:set>

    <core:set var="v_biano_active">${row[28]}</core:set>
    <Application active="true"

    name="${v_cleaned_application_name}"

    objectID="${v_application_code}"

    progress="2" status="1">

    <CustomInformation>

    <instance instanceCode="${v_bfl_code}"

    objectCode="appl_bus_function"

    parentInstanceCode="${v_application_code}" parentObjectCode="application">

    <CustomInformation>


    <ColumnValue name="bus_function_name">${v_cleaned_functionname}</ColumnValue>

    <ColumnValue name="cost_center">${v_cost_center}</ColumnValue>

    <ColumnValue name="division_number">${v_division_number}</ColumnValue>


    <ColumnValue name="biano">${v_biano}</ColumnValue>


    <ColumnValue name="bus_func_priority">${v_bfpriority}</ColumnValue>


    <ColumnValue name="division_name">${v_cleaned_division_name}</ColumnValue>
    <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>

    <ColumnValue name="name">Link</ColumnValue>
    <ColumnValue name="code">${v_bfl_code}</ColumnValue>

    <ColumnValue name="odf_parent_id">${v_odf_parent_id}</ColumnValue>

    <ColumnValue name="odf_cncrt_parent_id">${v_odf_parent_id}</ColumnValue>

    <ColumnValue name="indicator">${v_indicator}</ColumnValue>


    <ColumnValue name="biano_active">${v_biano_active}</ColumnValue>


    <ColumnValue name="divc">${v_divc}</ColumnValue>


    <ColumnValue name="link_status">inactive</ColumnValue>

    </CustomInformation>

    </instance>

    </CustomInformation>

    </Application>
    </core:forEach>


    </Applications>
    </NikuDataBus>
    </gel:parse>

    <!-- display the generated XML from the application query -->
    <gel:log>
    <gel:log>Step 1 - XML Generated is below -</gel:log>
    <gel:expr select="$object_xml"/>
    </gel:log>

    <gel:log>AppName=${v_cleaned_application_name}=</gel:log>
    <gel:out>[XOG]Logging into Clarity XOG at ${p_XOGURL}.</gel:out>
    <gel:log level="INFO" category="XOG">Logging into Clarity XOG at ${p_XOGURL}.</gel:log>
    <core:catch var="v_xog_exception">
    <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="auth">
    <soap:message>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">

    <soapenv:Header/>

    <soapenv:Body>

    <xog:Login>

    <xog:Username>${p_XOGUsername}</xog:Username>

    <xog:Password>${p_XOGPassword}</xog:Password>

    </xog:Login>

    </soapenv:Body>

    </soapenv:Envelope>
    </soap:message>
    </soap:invoke>
    <gel:set asString="true" select="$auth/soapenv:Envelope/soapenv:Body/xog:SessionID/text()" var="sessionID"/>
    <core:choose>
    <core:when test="${sessionID == null}">
    <gel:out>[XOG]Couldn't Log in to XOG. Check the username/password and Application has started.</gel:out>

    <gel:log level="ERROR" category="XOG">Log Couldn't Log in to XOG. Check the username/password and Application has started.</gel:log>
    </core:when>
    <core:otherwise>
    <gel:out>[XOG]Log in successful ${sessionID}</gel:out>

    <gel:log level="INFO" category="XOG">[XOG]Log in successful ${sessionID}</gel:log>

    <core:catch var="v_xog_exception">

    <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="object_xml">

    <soap:message>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">

    <soapenv:Header>


    <xog:Auth>


    <xog:SessionID>${sessionID}</xog:SessionID>


    </xog:Auth>


    </soapenv:Header>


    <soapenv:Body>


    <gel:include select="$object_xml/NikuDataBus"/>


    </soapenv:Body>

    </soapenv:Envelope>

    </soap:message>

    </soap:invoke>

    </core:catch>

    <core:choose>

    <core:when test="${v_xog_exception != null}">

    <gel:out>[XOG]XOG operation failed: ${v_xog_exception}</gel:out>

    <gel:log level="ERROR" category="XOG">XOG operation failed: ${v_xog_exception}</gel:log>

    </core:when>

    </core:choose>

    <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="object_xml_result">

    <soap:message>

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xog="http://www.niku.com/xog">

    <soapenv:Header>

    <xog:Auth>

    <xog:SessionID>${sessionID}</xog:SessionID>

    </xog:Auth>

    </soapenv:Header>

    <soapenv:Body>

    <xog:Logout/>

    </soapenv:Body>

    </soapenv:Envelope>

    </soap:message>
    </soap:invoke>
    <gel:out>[XOG]Logged out </gel:out>
    <gel:log level="INFO" category="XOG">Logged out </gel:log>
    </core:otherwise>
    </core:choose>
    </core:catch>

    <core:if test="${v_xog_exception != null}">
    <gel:out>XOG failed: ${v_xog_exception}</gel:out>
    <gel:log level="ERROR" category="XOG">XOG failed: ${v_xog_exception}</gel:log>
    </core:if>


    </gel:script>


    .


  • 5.  RE: GEL XOG - Troubleshooting Tips

    Posted 09-19-2013 03:59 AM
    I don't know if this is the problem, but when you call the SOAP for you constructed message you use the same name for the returned variable as the XML object that contains the message...

    i.e. you have
    <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="object_xml">
    But "object_xml" is also the variable that holds your XML? :unsure:

    When you call the other SOAP calls (login/logout) you are using a different return variables;
    Login : <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="auth">
    Logout : <soap:invoke endpoint="${p_XOGURL}/niku/xog" var="object_xml_result">

    You could also just <gel:log> out the return from the XOG call to the logs to see what that contains.


  • 6.  Re: GEL XOG - Troubleshooting Tips

    Posted 11-10-2016 03:12 PM

    The posted script was great help to me in creating a single XOG write to update multiple projects.