-
1. Re: HQL activity - parameters with EL evaluated values
jimmyb82 Sep 14, 2010 12:10 PM (in response to jimmyb82)It's seem's I've managed to answer my own question! (which always seems to be the way when I finally resort to asking a forum)
I needed to specify the query as follows: -
{code:xml}
<hql name="Check invoice" var="invoice" unique="true"> <query>from Invoice i where i.invoiceId = :invoiceId</query> <parameters> <object name="invoiceId" expr="#{invoiceId}" /> </parameters> <transition name="Check paid" to="Paid?" g="-62,-4"/> </hql>{code}
Where I failed in my initial attempts at this is that the shipped jpdl-4.4.xsd doesn't allow the attribute "name" on the element object thus my OCD refused to allow me to try entering a name.
This must mean that the XSD isn't used at runtime to parse the XML otherwise how does it work?
Unless there is a different copy of the XSD being used at runtime to the one shipped in the distro maybe?
Should I submit a feature request for a documentation update and/or a bug for the XSD?
AbstractDescriptor defines "name" as a field so anything extending that should be able to use a name safely.
-
2. HQL activity - parameters with EL evaluated values
whizkid.samrat Apr 25, 2011 7:03 AM (in response to jimmyb82)James thanks for the solution !
-
3. HQL activity - parameters with EL evaluated values
whizkid.samrat Apr 25, 2011 7:14 AM (in response to whizkid.samrat)problem again ..
when I use Jame's solution I get
Not all named parameters have been set: [reqID] [update ORION_LMS_LEAVE_REQ set FINAL_STATUS='approved' where LEAVE_REQ_ID = :reqID]
my xml is like
<sql g="381,560,129,52" name="CleanupOnApproval" var="approvalQ">
<query>update ORION_LMS_LEAVE_REQ set FINAL_STATUS='approved' where LEAVE_REQ_ID = :reqID</query>
<parameters><object name="reqID" expr="#{requestId}"/></parameters>
<transition g="-102,-11" name="sendApprovalMail" to="sendApprovalMail"/>
</sql>
The problem <object> doesnot have a parameter "name" still stands.
Help ..