AnsweredAssumed Answered

Gel script : auto-populate a date field

Question asked by Calemirou on Mar 10, 2016
Latest reply on Mar 10, 2016 by Dave_3.0

Hello Everyone,

I'm doing a Gel script that allow me to auto populate a date field with date system when the condition in my process is true but i get stuck. i'm doing something like this:

 

<!-- GET sysdate  -->
    <core:catch var="exception">
        <sql:query var="req">
<![CDATA[       
   SELECT I.NAME ISSUE_NAME 
        , I.RIM_RISK_ISSUE_CODE ISSUE_CODE 
        , P.CODE PROJECT_CODE 
        , R.UNIQUE_NAME AS ISSUE_ASSIGNED_TO 
        ,  CAST(sysdate AS DATE) AS affectationDate
        , A.x_closed_date
        FROM RIM_RISKS_AND_ISSUES I 
        JOIN INV_INVESTMENTS P ON P.ID = I.PK_ID 
        JOIN ODF_CA_ISSUE A ON A.ID = I.ID 
        JOIN SRM_RESOURCES R ON R.USER_ID = I.ASSIGNED_TO 
        WHERE I.TYPE_CODE = 'ISSUE'
        AND I.ID = ${gel_objectInstanceId}
       ]]>
       </sql:query>
    </core:catch>
    <core:choose>
        <core:when test="${exception != null}">
            <gel:log level="ERROR" message="[-] SQL error"/>
            <core:set value="1" var="ProcessError"/>
            <core:if test="${DebugLevel ge 1}">
                <gel:log category="SQL" level="ERROR" message="${exception}"/>
            </core:if>
        </core:when>
        <core:otherwise>
            <core:if test="${req.rowCount !=0}">
                <core:forEach items="${req.rowsByIndex}" trim="true" var="rowParam">
                    <core:if test="${rowParam[0] != null}">
                    <core:set value="${rowParam[4]}" var="affectationDate"/>
                    <core:set value="${rowParam[5]}" var="x_closed_date"/>
                        <core:set value="${affectationDate}" var="x_closed_date"/>
                        <ColumnValue name="affectationDate">${x_closed_date}</ColumnValue>
                        <gel:log category="DATA" level="info" message="traitement of data from ${affectationDate}"/>
                    </core:if>
                </core:forEach>
            </core:if>
        </core:otherwise>
    </core:choose>

Outcomes