You need to have 'pointer to a row' variable defined using relates-to, like this: <variable name="external" element="foo:row" xvar:id="evar1" xvar:relates-to="idx"/>
You can try to run this example: http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/ExtVar/HelloWorld2.bpel On 28 April 2010 08:51, Hoang Phung <[email protected]> wrote: > Hi all, > > I'm trying to access mysql database from inside BPEL process using JDBC > external variable as instructed on the ODE website. I have done the > following: > > * Insert the following in the Tomcat server file, inside the Host element: > <Context path="/ode" docBase="ode" debug="5" reloadable="true" > crossContext="true"> > <Resource name="jdbc/ODEDB" auth="Container" type="javax.sql.DataSource" > maxActive="100" maxIdle="30" maxWait="10000" > username="username" password="pass" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/ode?autoReconnect=true"/> > </Context> > <Context path="/test" docBase="test" debug="5" reloadable="true" > crossContext="true"> > <Resource name="jdbc/ODEDB" auth="Container" type="javax.sql.DataSource" > maxActive="100" maxIdle="30" maxWait="10000" > username="username" password="pass" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/test?autoReconnect=true"/> > </Context> > > * Declare the following in deploy.xml file: > <xvar:externalVariable id="evar1" > > <jdbc:jdbc > xmlns:jdbc="http://ode.apache.org/externalVariables/jdbc" > xmlns="http://ode.apache.org/externalVariables/jdbc"> > <datasource-ref>test</datasource-ref> > <table>shop</table> > <column name="article" key="yes" > /> <column name="dealer" /> > <column name="price" /> </jdbc:jdbc> > </xvar:externalVariable> > > * Declare the following in wsdl file: > <element name="DBRow"> > <complexType> > <sequence> > <element name="_article" type="int"/> > <element name="_dealer" type="string"/> > <element name="_price" type="double"/> > </sequence> > </complexType> > </element> > > * And finally, declare an external variable in bpel file: > <bpel:variable name="tmp" element="tns:DBRow" > xvar:id="evar1"></bpel:variable> > > However, I keep getting the following errors when deploying it: > ERROR - GeronimoLog.error(104) | > file:/usr/lib/apache-tomcat-5.5.27/webapps/ode/WEB-INF/processes/temp/test.bpel:44: > error: [MustSpecifyRelatedVariable] The external variable declaration for > "tmp" must specify a related variable. > ERROR - GeronimoLog.error(104) | > file:/usr/lib/apache-tomcat-5.5.27/webapps/ode/WEB-INF/processes/temp/test.bpel:77: > error: [UndeclaredVariable] Attempt to reference undeclared variable "tmp". > > Would someone please point out where I went wrong, or point me to an example > on using external variable to access mysql from a BPEL process? Thanks in > advance. > > Hoang > > UTS CRICOS Provider Code: 00099F > DISCLAIMER: This email message and any accompanying attachments may contain > confidential information. If you are not the intended recipient, do not > read, use, disseminate, distribute or copy this message or attachments. If > you have received this message in error, please notify the sender > immediately > and delete this message. Any views expressed in this message are those of > the individual sender, except where the sender expressly, and with > authority, > states them to be the views of the University of Technology Sydney. Before > opening any attachments, please check them for viruses and defects. > > Think. Green. Do. > > Please consider the environment before printing this email. > -- Rafał Rusin http://rrusin.blogspot.com
