Hi gcubed,
Thanks for much for your speedy response. Unfortunately l am still receiving the same error.
The first action I took was as per your suggestion above. I updated the commenting to re-add the core set and removed the reference to v_portNumber. The error was the same.. unable to send SOAP message.
I then added the additional lines of code from your 3rd screenshot, and still the same error. Unable to send SOAP message:-
BPM-0704: An error occurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:170:66: <soap:invoke> Failed to send a SOAP message generated to 'https://cppm6124-dev.ondemand.ca.com:14001/niku/xog'.No route to host at com.niku.union.gel.tags.soap.InvokeTag.doTag(InvokeTag.java:76) at org.apache.commons.jelly.impl.TagScript
I then tried un-commenting out the whole section on "Determine if port number is present in entry URL".. still the same error..
This is what I have now..
<gel:script 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: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">
<core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>
<!--Always user Scheduler URL first-->
<core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
<gel:log>${v_clarityURL}</gel:log>
<core:set value="${v_clarityURL}/niku/xog" var="v_clarityURL"/>
<gel:log>${v_clarityURL}</gel:log>
<gel:setDataSource dbId="Niku"/>
<!-- Initialise Variables -->
<core:set var="v_errorFlag">false</core:set>
<!-- Retrieve the username of the XOG user from the Code Constants table -->
<core:catch var="v_exception">
<sql:query var="v_queryXogUserId">
SELECT d_value
FROM odf_ca_d_code_const
WHERE code ='xoguser'
</sql:query>
</core:catch>
<core:if test="${v_exception != null and v_queryXogUserId.rowCount == 0}">
<core:set value="true" var="v_errorFlag"/>
<gel:out>[SQL] Unable to retrieve XOG USER ID from the Database: ${v_exception}</gel:out>
<gel:log category="SQL" level="ERROR">Unable to retrieve XOG USER ID from the database: ${v_exception}</gel:log>
</core:if>
<core:if test="${v_errorFlag==false}">
<core:set var="v_xogUserId">${v_queryXogUserId.rows[0].d_value}</core:set>
</core:if>
<!-- Retrieve a Session ID to be sent with the XOG package as authentication -->
<core:if test="${v_errorFlag == false}">
<core:catch var="v_exception">
<!--Invoke class instances-->
<core:new className="com.niku.union.security.DefaultSecurityIdentifier" var="v_secId"/>
<core:invokeStatic className="com.niku.union.security.UserSessionControllerFactory" method="getInstance" var="userSessionCtrl"/>
<!--Log into clarity by initialising class instance-->
<core:set value="${userSessionCtrl.init(v_xogUserId, v_secId)}" var="v_secId"/>
<core:set value="${v_secId.getSessionId()}" var="v_thisSessionId"/>
</core:catch>
<core:if test="${v_exception!=null}">
<core:set value="true" var="v_errorFlag"/>
<gel:out>[GEL] Unable to retrieve a Session ID: ${v_exception}</gel:out>
<gel:log category="GEL" level="ERROR">Unable to retrieve a Session ID: ${v_exception}</gel:log>
</core:if>
</core:if>
<!--Retrieve the clarity application server URL-->
<core:if test="${v_errorFlag == false}">
<core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="v_config"/>
<!--Always use Scheduler URL first-->
<core:set value="${v_config.getProperties().getWebServer().getSchedulerUrl()}" var="v_clarityURL"/>
<!--If Scheduler URL is not set use the Application Server Entry URL-->
<core:if test="${v_clarityURL == ''}">
<core:switch on="${v_config.getProperties().getWebServer().getWebServerInstance(0).getId()}">
<core:case value="nsa">
<core:set
value="${v_config.getProperties().getWebServer().getWebServerInstance(1).getEntryUrl()}" var="v_entryURL"/>
</core:case>
<core:default>
<core:set
value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getEntryUrl()}" var="v_entryURL"/>
</core:default>
</core:switch>
<core:set value="${v_entryURL}" var="v_clarityURL"/>
</core:if>
<util:tokenize delim=":" var="v_urlComponents">${v_clarityURL}</util:tokenize>
<core:set value="${v_urlComponents.get(0)}://" var="v_httpMethod"/>
<core:set value="${v_urlComponents.get(1)}" var="v_serverName"/>
<util:tokenize delim="/" var="v_serverName">${v_serverName}</util:tokenize>
<core:set value="${v_serverName.get(0)}" var="v_serverName"/>
<core:set value="${v_urlComponents.get(2)}" var="v_portNumber"/>
<!--Determine if port number is present in entry URL. If not use App Server Entry port.-->
<core:choose>
<core:when test="${v_portNumber == null}">
<core:set value="${v_config.getProperties().getWebServer().getWebServerInstance(0).getPort()}" var="v_portNumber"/>
</core:when>
<core:otherwise>
<util:tokenize delim="/" var="v_portNumber">${v_portNumber}</util:tokenize>
<core:set value="${v_portNumber.get(0)}" var="v_portNumber"/>
</core:otherwise>
</core:choose>
<core:set
value="${v_httpMethod}${v_serverName}/niku/xog" var="v_clarityURL"/>
</core:if>
<!-- SQL Query to get Required Attributes for the XOG -->
<core:if test="${v_errorFlag == false}">
<core:catch var="v_exception">
<sql:query var="v_query_result" escapeText="0">
SELECT fu.code,
F.PLANNED_CST_START,
F.PLANNED_CST_CAPITAL_TOTAL,
F.PLANNED_CST_OPERATING_TOTAL,
F.PLANNED_CST_TOTAL,
F.PLANNED_CST_FINISH,
F.PLANNED_BEN_TOTAL,
F.PLANNED_NPV,
F.PLANNED_PAYBACK_PERIOD,
F.PLANNED_ROI
FROM niku.FIN_FINANCIALS F,
niku.INV_INVESTMENTS I,
niku.odf_ca_f_funding fu
where i.id = f.id
and i.id = fu.odf_parent_id
WHERE fu.id = ${gel_objectInstanceId}
</sql:query>
</core:catch>
<core:if test="${v_exception != null}">
<core:set value="true" var="v_errorFlag"/>
<gel:log category="Select Key Indicators" level="ERROR">Query for Key Indicators attributes failed. Report ${gel_objectInstanceId} Exception: ${v_exception.getMessage()}</gel:log>
</core:if>
<!-- Store the results of the query into variables -->
<core:if test="${v_exception eq null}">
<core:forEach items="${v_query_result.rowsByIndex}" trim="true" var="row">
<core:set var="v_fundingID">${row[0]}</core:set>
<core:set var="v_planned_cst_start">${row[1]}</core:set>
<core:set var="v_planned_cst_cap_tot">${row[2]}</core:set>
<core:set var="v_planned_cst_op_tot">${row[3]}</core:set>
<core:set var="v_planned_cst_tot">${row[4]}</core:set>
<core:set var="v_planned_cst_finish">${row[5]}</core:set>
<core:set var="v_planned_ben_tot">${row[6]}</core:set>
<core:set var="v_planned_npv">${row[7]}</core:set>
<core:set var="v_planned_payback_per">${row[8]}</core:set>
<core:set var="v_planned_roi">${row[9]}</core:set>
</core:forEach>
<!-- Create the XOG Write XML using the variables -->
<gel:parse var="v_xml_root">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
<Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="14.4.0.234"/>
<customObjectInstances objectCode="f_funding">
<instance instanceCode="${v_fundingID}" objectCode="f_funding">
<CustomInformation>
<ColumnValue name="f_plnd_cost_st">${v_planned_cst_start}</ColumnValue>
<ColumnValue name="f_pland_cap">${v_planned_cst_cap_tot}</ColumnValue>
<ColumnValue name="f_plnd_op">${v_planned_cst_op_tot}</ColumnValue>
<ColumnValue name="f_plnd_cst">${v_planned_cst_tot}</ColumnValue>
<ColumnValue name="f_pln_cst_fin">${v_planned_cst_finish}</ColumnValue>
<ColumnValue name="f_pr_fin_be">${v_planned_ben_tot}</ColumnValue>
<ColumnValue name="f_plnd_npv">${v_planned_npv}</ColumnValue>
<ColumnValue name="f_plnd_pback_per">${v_planned_payback_per}</ColumnValue>
<ColumnValue name="f_plnd_roi">${v_planned_roi}</ColumnValue>
</CustomInformation>
</instance>
</customObjectInstances>
</NikuDataBus>
</gel:parse>
<!-- XOG into Clarity -->
<core:catch var="v_xog_exception">
<soap:invoke endpoint="${v_clarityURL}" var="runresult">
<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>${v_thisSessionId}</xog:SessionID>
</xog:Auth>
</soapenv:Header>
<soapenv:Body>
<gel:include select="$v_xml_root/NikuDataBus"/>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>
</core:catch>
<core:choose>
<core:when test="${v_xog_exception != null}">
<gel:log category="XOG" level="WARNING">XOG to calculate Overall Status failed.</gel:log>
</core:when>
<core:otherwise>
<!-- Check the XOG result -->
<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="Overall Status" level="INFO">Overall Status is: ${v_overallStatus}]</gel:log>
<gel:log category="XOG" level="INFO">XOG operation completed [Total ${XOGtotalrecords}, Inserted ${XOGinsertedrecords}, Updated ${XOGupdatedrecords}, Failed ${XOGfailurerecords}]</gel:log>
</core:otherwise>
</core:choose>
<!-- CLOSE DOWN THE SESSION -->
<soap:invoke endpoint="${v_clarityURL}" var="logoutresult">
<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>${v_thisSessionId}</xog:SessionID>
</xog:Auth>
</soapenv:Header>
<soapenv:Body>
<xog:Logout/>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>
<!-- End of XOG Update Code -->
</core:if>
</core:if>
</gel:script>
Would appreciate any assistance possible..
Thanks
Michelle