Clarity

  • 1.  Email notification - Gel-Script

    Posted Jun 05, 2013 09:15 AM
    Hi All,

    I have a gel-script which should send out notification if the executed query in the script as a result set, or it should send out email that there are no results.

    But the below script is sending out email as ‘no results’ even though the executed query is having some result set.

    Please help

    Gel-script.
    <gel:script
    xmlns:SOAP-ENV="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:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:sql="jelly:sql"
    xmlns:mail ="jelly:email"
    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:ftp="jelly:com.niku.union.gel.FTPTagLibrary"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary">

    <gel:setDataSource dbId="niku"/>
    <sql:query var="results">
    select i.name Project_Name,i.code Project_Code , @@ROWCOUNT no_of_rows
    from INV_INVESTMENTS i
    inner join ODF_OBJECT_INSTANCE_MAPPING o on i.ID = o.PRIMARY_OBJECT_INSTANCE_ID
    inner join FIN_FINANCIALS f on o.SECONDARY_OBJECT_INSTANCE_ID = f.ID
    inner join odf_ca_project od on i.ID = od.id
    </sql:query>

    <core:choose>
    <core:when test="${row[0].no_of_rows >0}">
    <gel:log level="info" category="User-defined process" message="Query returned."/>
    <mail:email from="xyz@email.com" to="xyz@email.com" subject="Projects Fields'" server="xzy.email.com" >


    Team,


    Please find the below list of Projects which has Budget Fields mismatch.

    <core:forEach items="${results.rowsByIndex}" var="row">

    <core:set value="${row[0]}" var="Project_Name"/>
    <core:set value="${row[1]}" var="Project_Code"/>

    Project Code: ${Project_Code} Project Name: ${Project_Name}

    </core:forEach>

    Regards
    Clarity Administrator

    </mail:email>
    </core:when>
    <core:otherwise>
    <mail:email from="xyz@email.com" to="xyz@email.com" subject="Projects Fields'" server="xzy.email.com" >

    There are no mismatch in Budget fields.

    Regards
    Clarity Administrator

    </mail:email>

    </core:otherwise>
    </core:choose>
    </gel:script>


  • 2.  RE: Email notification - Gel-Script

    Posted Jun 05, 2013 09:34 AM
    Try this
    <core:when test="${results.row[0].no_of_rows ne 0}">

    Thanks,
    Manish


  • 3.  RE: Email notification - Gel-Script

    Posted Jun 05, 2013 10:47 AM
    Manish,

    Now the <otherwise> part in the script is not working.

    Any help.


  • 4.  RE: Email notification - Gel-Script

    Posted Jun 06, 2013 06:14 AM
    try using the "!=" in the <core:when>
    <core:when test="${results.row[0].no_of_rows != 0}">


  • 5.  Moving to XOG/WSDL/GEL Board

     
    Posted Jun 05, 2013 01:55 PM
    Moving to XOG/WSDL/GEL Board