Hi,
Am trying to xog the resource data via process, and that process makes the resource inactive both at the user and Resource side,disable the Open for time entry option and updates the Date of termination provided in the request.
Now, the issue is that process is not updating the Open for time entry and Date of termination for some resources and for some resources it is updating(really weird) even the resource has the info as other.
Could you please help me in this?#
Any suggestions and comments would help me.
Thanks,
Shruthi
A suggestion, add some log output after each XOG, in particular, when the XOG has an exception, or the Failure records are greater than 0 - sample code:
<core:if test="${v_xog_exception != null}">
<gel:log category="XOG" level="ERROR">XOG Execution failed: ${v_xog_exception}</gel:log>
<gel:log>[XOG] XOG failed: ${v_xog_exception}</gel:log>
<core:set value="true" var="v_errorFlag"/>
</core:if>
<gel:set select="$runresult/soapenv:Envelope/soapenv:Body//XOGOutput" var="writeOutputRoot"/>
<gel:set asString="true" select="$writeOutputRoot/Status/@state" var="XOGoutcome"/>
<gel:set asString="true" select="$writeOutputRoot/Records/Record" var="XOGoutputrecords"/>
<gel:set asString="true" select="$writeOutputRoot/Statistics/@totalNumberOfRecords" var="XOGtotalrecords"/>
<gel:set asString="true" select="$writeOutputRoot/Statistics/@insertedRecords" var="XOGinsertedrecords"/>
<gel:set asString="true" select="$writeOutputRoot/Statistics/@updatedRecords" var="XOGupdatedrecords"/>
<gel:set asString="true" select="$writeOutputRoot/Statistics/@failureRecords" var="XOGfailurerecords"/>
<gel:log category="XOG" level="INFO">XOG Results. Status: ${XOGoutcome}; Total Records: ${XOGtotalrecords}; Total inserted: ${XOGinsertedrecords}; Total updated: ${XOGupdatedrecords}; Total failed: ${XOGfailurerecords}</gel:log>
<core:if test="${XOGfailurerecords > 0 or XOGoutcome == 'FAILURE'}">
<gel:set asString="true" select="$xogRootNode" var="xogRootNodeAsString"/>
<gel:log category="XOG" level="INFO">Input XOG: ${xogRootNodeAsString}</gel:log>
<gel:set asString="true" select="$writeOutputRoot" var="XOGFailure"/>
<gel:log category="XOG" level="INFO">XOG Failure Results: ${XOGFailure}</gel:log>
</core:if>
Hopefully the output will assist you in determine why the XOG update periodically doesn't work.
I also notice that you are using:
<gel:parameter var="XOGPassword" secure="true"/>
I normally store the XOG username as a Code Constant, which is picked up via SQL read to store in v_xogUserId, and then use:
<core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="secId"/>
<core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/>
<!-- Verify the security -->
<core:set value="${userSessionCtrl.init(v_xogUserId, secId)}" var="secId"/>
<!-- Get the username corresponding to xog id -->
<core:set value="${secId.getUserName()}" var="XOGUsername"/>
<!-- Get the Encrypted passowrd corresponding to XOG id -->
<core:set value="${secId.getPWD()}" var="XOGPassword"/>
<!-- Get the Session corresponding to the xog userid and password -->
<core:set value="${secId.getSessionId()}" var="XOGsessionID"/>
This way the password can be modified periodically for the XOG user with no impact to the GEL scripts. You may be passing this data from a previous step, so please ignore if this is the case.