Hello,
I'm trying to execute a process basing on a gel script, the script enable finance to resources, but i get an error :
BPM-0704: An error ocurred while executing custom script: org.apache.commons.jelly.JellyTagException: null:13:50:
<sql:query> select id id, unique_name unique_name, last_name last_name, first_name first_name, email email, person_type person_type from srm_resources where id in(select distinct prresourceid from prteam where prprojectid in ( select id from inv_investments where schedule_finish >='2016-01-01' ) ) and person_type in (300,301): [CA Clarity][SQLServer JDBC Driver][SQLServer]An expression of non-boolean type specified in a context where a condition is expected, near ';'
here is my script:
<gel:script xmlns:core="jelly:core"
xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
xmlns:jxml="jelly:xml"
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:x="jelly:org.apache.commons.jelly.tags.xml.XMLTagLibrary"
xmlns:xog="http://www.niku.com/xog"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Paramètres des accès Clarity -->
<gel:parameter default="http://127.0.0.1" var="hostClarity"/>
<gel:parameter default="admin" var="XOGUsername"/>
<gel:parameter default="*********" secure="true" var="XOGPassword"/>
<!-- Base de données -->
<gel:setDataSource dbId="Niku"/>
<!-- Instance du projet en cours -->
<!--récupération des infos de la ressource -->
<sql:query var="infoResource">
<![CDATA[
select id id,
unique_name unique_name,
last_name last_name,
first_name first_name,
email email,
person_type person_type
from srm_resources
where id in(select distinct prresourceid
from prteam
where prprojectid in ( select id
from inv_investments
where schedule_finish >='2016-01-01'
)
)
and person_type in (300,301)
]]>
</sql:query>
<core:if test="${infoResource.rowCount>0}">
<!-- connection Xog ______________________________________________________________________________ -->
<soap:invoke endpoint="${hostClarity}/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>${XOGUsername}</xog:Username>
<xog:Password>${XOGPassword}</xog:Password>
</xog:Login>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>
<gel:log>connexion à ${hostClarity} en ${XOGUsername}</gel:log>
<gel:set asString="true" select="$auth//xog:SessionID/text()" var="SessionID"/>
<core:choose>
<core:when test="${SessionID == null}">
<gel:out>Log in impossible. Vérifiez le hostname/username/password.</gel:out>
<gel:log>Log in impossible. Vérifiez le hostname/username/password.</gel:log>
<core:set value="true" var="stepError"/>
</core:when>
<core:otherwise>
<gel:log>Login réussi. Session ID = ${SessionID}</gel:log>
</core:otherwise>
</core:choose>
<core:if test="${!stepError}">
<!-- ===================== -->
<!-- construction du xog -->
<!-- ===================== -->
<gel:parse var="XML_all">
<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_resource.xsd">
<Header action="write" externalSource="NIKU" objectType="resource" version="14.2.0.237"/>
<Resources>
<core:forEach items="${infoResource.rows}" trim ="true" var ="data" xmlns:core="jelly:core">
<core:if test="${data.person_type==300}">
<Resource
externalId="${data.unique_name}"
resourceId="${data.unique_name}"
resourceType="LABOR">
<PersonalInformation
emailAddress="${data.email}"
firstName="${data.first_name}" lastName="${data.last_name}"/>
<FinancialInformation>
<SupplementalInformation active="1" department="92"
location="Puteaux" resourceClass="Interne" transactionClass="Labor"/>
<RatesNCosts targetbillingRate="0" targetbillingRateCurrency="EUR"/>
<Expenses reimbursementCurrency="EUR"/>
</FinancialInformation>
</Resource>
</core:if>
<core:if test="${data.person_type==301}">
<Resource
externalId="${data.unique_name}"
resourceId="${data.unique_name}"
resourceType="LABOR">
<PersonalInformation
emailAddress="${data.email}"
firstName="${data.first_name}" lastName="${data.last_name}"/>
<FinancialInformation>
<SupplementalInformation active="1" department="92"
location="Puteaux" resourceClass="Interne" transactionClass="Labor"/>
<RatesNCosts targetbillingRate="0" targetbillingRateCurrency="EUR"/>
<Expenses reimbursementCurrency="EUR"/>
</FinancialInformation>
</Resource>
</core:if>
</core:forEach>
</Resources>
</NikuDataBus>
</gel:parse>
<gel:serialize fileName="xogResource.xml" var="${XML_all}"/>
<soap:invoke endpoint="${hostClarity}/niku/xog" var="retour_xog">
<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="$XML_all"/>
</soapenv:Body>
</soapenv:Envelope>
</soap:message>
</soap:invoke>
<core:set value="" var="errorStatus"/>
<core:set value="" var="errorSeverity"/>
<core:if test="${retour_xog!= null}">
<core:if test="${inProcess==0}">
<gel:serialize fileName="xogretour.xml" var="${retour_xog}"/>
</core:if>
<gel:set asString="true"
select="$retour_xog//Status/@state/text()" var="errorStatus"/>
<core:catch>
<gel:set asString="true"
select="$retour_xog//ErrorInformation/Description/text()" var="errorDescription"/>
</core:catch>
<core:catch>
<gel:set asString="true"
select="$retour_xog//ErrorInformation/Severity/text()" var="errorSeverity"/>
</core:catch>
</core:if>
<core:set
value="${errorStatus=='FAILURE' or errorSeverity=='FATAL'}" var="errorXog"/>
<core:if test="${errorXog}">
<gel:out>Erreur xog :${errorDescription}</gel:out>
<gel:log>Erreur xog :${errorDescription}</gel:log>
</core:if>
<core:if test="${errorSeverity=='WARNING'}">
<gel:out>Warning xog :${errorDescription}</gel:out>
<gel:log>Warning xog :${errorDescription}</gel:log>
</core:if>
<core:if test="${!errorXog}">
<gel:out>Ressources activées financièerement</gel:out>
<gel:log>Ressources activées financièerement</gel:log>
</core:if>
<!-- Logout Xog ______________________________________________________________________________ -->
<soap:invoke endpoint="${hostClarity}/niku/xog" var="logout">
<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:log>logout ok</gel:log>
</core:if>
</core:if>
</gel:script>
In Clarity 14.2.0.237 05 12 / Sql Server
What's wrong with my query ??
Many thanks