Merge from fork branch sudharma/ODECluster
diff --git a/.gitignore b/.gitignore
index 2614e82..9981fd7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
_buildr.rb
derby.log
Gemfile.lock
+spoon
diff --git a/Rakefile b/Rakefile
index 7c0fa67..ac9b74e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -26,6 +26,8 @@
require File.join(File.dirname(__FILE__), 'dependencies.rb')
Buildr::Hibernate::REQUIRES[:hibernate] = HIBERNATE,
+#Buildr.settings.build['junit'] = "4.11"
+#Buildr::JUnit.instance_eval { @dependencies = ["junit:junit:jar:#{version}", "org.hamcrest:hamcrest-core:jar:1.3"] + Buildr::JMock.dependencies}
Buildr::Hibernate::REQUIRES[:xdoclet] = Buildr.group("xdoclet", "xdoclet-xdoclet-module", "xdoclet-hibernate-module",
:under=>"xdoclet", :version=>"1.2.3") + ["xdoclet:xjavadoc:jar:1.1-j5"]
@@ -89,7 +91,7 @@
JAVAX.transaction, JENCKS, WSDL4J, WS_COMMONS, XMLBEANS, AXIS2_MODULES.libs, SLF4J, LOG4J
test.exclude 'org.apache.ode.axis2.management.*'
- test.with project("tools"), AXIOM, JAVAX.javamail, COMMONS.codec, COMMONS.httpclient, XERCES, WOODSTOX
+ test.with project("tools"), AXIOM, JAVAX.javamail, COMMONS.codec, COMMONS.httpclient, XERCES, WOODSTOX, JACKSON
package :jar
end
@@ -97,7 +99,7 @@
desc "ODE Axis2 Based Web Application"
define "axis2-war" do
libs = projects("axis2", "bpel-api", "bpel-compiler", "bpel-connector", "bpel-dao",
- "bpel-epr", "bpel-obj", "bpel-ql", "bpel-runtime", "scheduler-simple",
+ "bpel-epr", "bpel-nobj", "bpel-ql", "bpel-runtime", "scheduler-simple",
"bpel-schemas", "bpel-store", "dao-hibernate", "jca-ra", "jca-server",
"utils", "dao-jpa", "agents", "clustering"),
AXIS2_ALL, ANNONGEN, BACKPORT, COMMONS.codec, COMMONS.collections, COMMONS.fileupload, COMMONS.io, COMMONS.httpclient, COMMONS.beanutils,
@@ -116,7 +118,7 @@
package(:war).tap do |root|
root.merge(artifact(AXIS2_WAR)).include("WEB-INF/classes/org/*")
end
-
+
task("start"=>[package(:war), jetty.use]) do |task|
class << task ; attr_accessor :url, :path ; end
task.url = "http://localhost:8080/ode"
@@ -131,7 +133,7 @@
end
test.using :testng, :forkmode=>'perTest', :properties=>{ "org.apache.commons.logging.LogFactory" => "org.apache.commons.logging.impl.LogFactoryImpl", "log4j.configuration"=>"test-log4j.properties", "test.ports" => ENV['TEST_PORTS'], "org.apache.ode.scheduler.deleteJobsOnStart" => "true", "org.apache.ode.autoRetireProcess"=>"true" } , :java_args=>['-Xmx2048m', '-XX:MaxPermSize=256m'] #'-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=6001',
- test.with [projects("tools"), libs, AXIS2_MODULES.mods, AXIOM, JAVAX.servlet, Buildr::Jetty::REQUIRES, HIBERNATE, DOM4J, H2::REQUIRES, SPRING_TEST].uniq
+ test.with [projects("tools", 'bpel-obj'), libs, AXIS2_MODULES.mods, AXIOM, JAVAX.servlet, Buildr::Jetty::REQUIRES, HIBERNATE, DOM4J, H2::REQUIRES, SPRING_TEST, JACKSON].uniq
webapp_dir = "#{test.compile.target}/webapp"
test.setup task(:prepare_webapp) do |task|
cp_r _("src/main/webapp"), test.compile.target.to_s
@@ -166,7 +168,7 @@
desc "ODE APIs"
define "bpel-api" do
- compile.with projects("utils", "bpel-obj", "bpel-schemas"), WSDL4J, XERCES, SLF4J, LOG4J
+ compile.with projects("utils", "bpel-nobj", "bpel-schemas"), WSDL4J, XERCES, SLF4J, LOG4J
package :jar
end
@@ -178,10 +180,10 @@
desc "ODE BPEL Compiler"
define "bpel-compiler" do
- compile.with projects("bpel-api", "bpel-obj", "bpel-schemas", "utils"),
- JAVAX.stream, JAXEN, SAXON, WSDL4J, XALAN, XERCES, COMMONS.collections, SLF4J, LOG4J
+ compile.with projects("bpel-api", "bpel-nobj", "bpel-schemas", "utils"),
+ JAVAX.stream, JAXEN, SAXON, WSDL4J, XALAN, XERCES, COMMONS.collections, SLF4J, LOG4J, JACKSON, OBJECT_DIFF
test.resources { filter(project("bpel-scripts").path_to("src/main/resources")).into(test.resources.target).run }
- test.with LOG4J
+ test.with LOG4J, projects("bpel-obj")
package :jar
end
@@ -218,27 +220,35 @@
package :jar
end
+ desc "New ODE BPEL Object Model"
+ define "bpel-nobj" do
+ compile.with projects("utils", "bpel-obj"), JACKSON, LOG4J, SAXON, WSDL4J, COMMONS.collections, COMMONS.logging, OBJECT_DIFF
+ package :jar
+ test.with XERCES
+ end
+
desc "ODE BPEL Query Language"
define "bpel-ql" do
pkg_name = "org.apache.ode.ql.jcc"
jjtree = jjtree(_("src/main/jjtree"), :in_package=>pkg_name)
compile.from javacc(jjtree, :in_package=>pkg_name), jjtree
- compile.with projects("bpel-api", "bpel-compiler", "bpel-obj", "utils"), JACOB
+ compile.with projects("bpel-api", "bpel-compiler", "bpel-nobj", "utils"), JACOB
package :jar
end
desc "ODE Runtime Engine"
define "bpel-runtime" do
- compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-epr", "bpel-obj", "bpel-schemas",
+
+ compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-epr", "bpel-nobj", "bpel-schemas",
"bpel-store", "utils", "agents","clustering"),
- COMMONS.collections, COMMONS.httpclient, JACOB, JAVAX.persistence, JAVAX.stream, JAXEN, SAXON, WSDL4J, XMLBEANS, SPRING, SLF4J, LOG4J
+ COMMONS.collections, COMMONS.httpclient, JACOB, JAVAX.persistence, JAVAX.stream, JAXEN, SAXON, WSDL4J, XMLBEANS, SPRING, SLF4J, LOG4J,
+ JACKSON, JAVAX.connector
-
- test.with projects("scheduler-simple", "dao-jpa", "dao-hibernate", "bpel-epr"),
- BACKPORT, COMMONS.pool, COMMONS.lang, COMMONS.io, DERBY, JAVAX.connector, JAVAX.transaction,
- GERONIMO.transaction, GERONIMO.kernel, GERONIMO.connector, TRANQL, HSQLDB, JAVAX.ejb,
- OPENJPA, XERCES, XALAN, DOM4J, HIBERNATE, SPRING_TEST, H2::REQUIRES,
+ test.with projects("scheduler-simple", "dao-jpa", "dao-hibernate", "bpel-epr", "bpel-obj"),
+# BACKPORT, COMMONS.pool, COMMONS.lang, COMMONS.io, DERBY, JAVAX.connector, JAVAX.transaction,
+ GERONIMO.transaction, GERONIMO.kernel, GERONIMO.connector, TRANQL, HSQLDB, JAVAX.ejb, JAVAX.transaction,
+ OPENJPA, XERCES, XALAN, DOM4J, HIBERNATE, SPRING_TEST, H2::REQUIRES, JACKSON,
"tranql:tranql-connector-derby-common:jar:1.1"
package :jar
@@ -247,7 +257,7 @@
desc "ODE Simple Scheduler"
define "scheduler-simple" do
compile.with projects("bpel-api", "utils"), COMMONS.collections, JAVAX.transaction, SLF4J, LOG4J
- test.compile.with HSQLDB, GERONIMO.kernel, GERONIMO.transaction
+ test.compile.with H2::REQUIRES, HSQLDB, GERONIMO.kernel, GERONIMO.transaction
test.with H2::REQUIRES, HSQLDB, JAVAX.transaction, JAVAX.resource, JAVAX.connector,
GERONIMO.kernel, GERONIMO.transaction, GERONIMO.connector, TRANQL, BACKPORT, JAVAX.ejb
test.exclude('*') if Buildr.environment == 'hudson'
@@ -269,13 +279,13 @@
desc "ODE Process Store"
define "bpel-store" do
- compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-obj", "bpel-schemas", "bpel-epr",
+ compile.with projects("bpel-api", "bpel-compiler", "bpel-dao", "bpel-nobj", "bpel-schemas", "bpel-epr",
"dao-hibernate", "dao-jpa", "utils"),
- JAVAX.persistence, JAVAX.stream, JAVAX.transaction, HIBERNATE, HSQLDB, XMLBEANS, XERCES, WSDL4J, OPENJPA, SPRING, SLF4J, LOG4J
+ JAVAX.persistence, JAVAX.stream, JAVAX.transaction, HIBERNATE, HSQLDB, XMLBEANS, XERCES, WSDL4J, OPENJPA, SPRING, SLF4J, LOG4J, JACKSON, H2::REQUIRES
compile { open_jpa_enhance }
resources hibernate_doclet(:package=>"org.apache.ode.store.hib", :excludedtags=>"@version,@author,@todo")
- test.with COMMONS.collections, COMMONS.lang, JAVAX.connector, JAVAX.transaction, DOM4J,
+ test.with projects("bpel-obj"), COMMONS.collections, COMMONS.lang, JAVAX.connector, JAVAX.transaction, DOM4J,
XERCES, XALAN, JAXEN, SAXON, OPENJPA, GERONIMO.transaction, SLF4J, SPRING_TEST, DERBY,
GERONIMO.transaction, GERONIMO.kernel, GERONIMO.connector, JAVAX.connector, JAVAX.ejb, H2::REQUIRES
package :jar
@@ -290,9 +300,9 @@
SPRING_TEST, COMMONS.codec, SLF4J, LOG4J
test.using :properties=>{ "org.apache.ode.autoRetireProcess"=>"true" }
- test.with projects("bpel-obj", "bpel-schemas", "bpel-scripts"),
+ test.with projects("bpel-nobj", "bpel-obj", "bpel-schemas", "bpel-scripts"),
COMMONS.collections, COMMONS.lang, DERBY, JACOB, JAVAX.connector,
- JAVAX.stream, JAVAX.transaction, JAVAX.connector, JAXEN, HSQLDB, SAXON, XERCES, XMLBEANS, XALAN, GERONIMO.transaction, SPRING, HIBERNATE, DOM4J, H2::REQUIRES
+ JAVAX.stream, JAVAX.transaction, JAVAX.connector, JAXEN, HSQLDB, SAXON, XERCES, XMLBEANS, XALAN, GERONIMO.transaction, SPRING, HIBERNATE, DOM4J, H2::REQUIRES, JACKSON
package :jar
end
@@ -347,11 +357,12 @@
end
common_sql = _("src/main/sql/common.sql")
-
+ index_sql = _("src/main/sql/index.sql")
+
%w{ derby mysql firebird hsql postgres sqlserver oracle h2}.each do |db|
partial_runtime = export[ properties_for[db], dao_hibernate, _("target/partial.runtime.#{db}.sql") ]
partial_store = export[ properties_for[db], bpel_store, _("target/partial.store.#{db}.sql") ]
- build concat(_("target/#{db}.sql")=>[ common_sql, predefined_for[db], partial_store, partial_runtime])
+ build concat(_("target/#{db}.sql")=>[ common_sql, predefined_for[db], partial_store, partial_runtime, index_sql])
end
derby_sql = _("target/derby.sql")
@@ -377,7 +388,7 @@
desc "ODE OpenJPA Derby Database"
define "dao-jpa-ojpa-derby" do
- %w{ derby mysql oracle postgres h2 }.each do |db|
+ %w{ derby mysql oracle postgres h2 sqlserver}.each do |db|
db_xml = _("src/main/descriptors/persistence.#{db}.xml")
scheduler_sql = _("src/main/scripts/simplesched-#{db}.sql")
common_sql = _("src/main/scripts/common.sql")
@@ -392,10 +403,10 @@
derby_db = Derby.create(_("target/derby-jpadb")=>_("target/derby.sql"))
h2_db = H2.create("ode-jpa-h2", _("target/h2-jpadb")=>_("target/h2.sql"))
- test.with projects("bpel-api", "bpel-dao", "bpel-obj", "bpel-epr", "dao-jpa", "utils"),
+ test.with projects("bpel-api", "bpel-dao", "bpel-nobj", "bpel-epr", "dao-jpa", "utils"),
BACKPORT, COMMONS.collections, COMMONS.lang, COMMONS.logging, GERONIMO.transaction,
GERONIMO.kernel, GERONIMO.connector, HSQLDB, JAVAX.connector, JAVAX.ejb, JAVAX.persistence,
- JAVAX.transaction, LOG4J, OPENJPA, XERCES, WSDL4J
+ JAVAX.transaction, LOG4J, OPENJPA, XERCES, WSDL4J, H2::REQUIRES
build derby_db
build h2_db
@@ -407,7 +418,7 @@
desc "ODE JBI Integration Layer"
define "jbi" do
- compile.with projects("bpel-api", "bpel-connector", "bpel-dao", "bpel-epr", "bpel-obj",
+ compile.with projects("bpel-api", "bpel-connector", "bpel-dao", "bpel-epr", "bpel-nobj",
"bpel-runtime", "scheduler-simple", "bpel-schemas", "bpel-store", "utils", "agents"),
AXIOM, COMMONS.logging, COMMONS.pool, JAVAX.transaction, GERONIMO.transaction, JBI, SLF4J, LOG4J, WSDL4J, XERCES
@@ -415,7 +426,7 @@
package(:jbi).tap do |jbi|
libs = artifacts(package(:jar),
projects("bpel-api", "bpel-api-jca", "bpel-compiler", "bpel-connector", "bpel-dao",
- "bpel-epr", "jca-ra", "jca-server", "bpel-obj", "bpel-ql", "bpel-runtime",
+ "bpel-epr", "jca-ra", "jca-server", "bpel-nobj", "bpel-ql", "bpel-runtime",
"scheduler-simple", "bpel-schemas", "bpel-store", "dao-hibernate", "dao-jpa", "utils", "agents"),
ANT, AXIOM, BACKPORT, COMMONS.codec, COMMONS.collections, COMMONS.dbcp, COMMONS.lang, COMMONS.pool,
COMMONS.primitives, DERBY, GERONIMO.connector, GERONIMO.transaction, JACOB, JAVAX.connector,
@@ -430,8 +441,8 @@
jbi.include path_to("src/main/jbi/ode-jbi.properties")
end
- test.using :properties=>{ "java.naming.factory.initial" => "org.apache.xbean.spring.jndi.SpringInitialContextFactory", "org.apache.ode.autoRetireProcess"=>"true"}, :java_args=>ENV['TEST_JVM_ARGS']
- test.with projects("dao-jpa", "dao-hibernate", "bpel-compiler", "bpel-api-jca", "jca-ra", "jca-server"),
+ test.using :properties=>{ "java.naming.factory.initial" => "org.apache.xbean.spring.jndi.SpringInitialContextFactory", "org.apache.ode.autoRetireProcess"=>"true"}, :java_args=>(ENV['TEST_JVM_ARGS']||='').split(' ')
+ test.with projects("dao-jpa", "dao-hibernate", "bpel-compiler", "bpel-api-jca", "jca-ra", "jca-server", "bpel-obj"),
BACKPORT, COMMONS.lang, COMMONS.io, COMMONS.collections, DERBY, GERONIMO.connector, GERONIMO.kernel,
GERONIMO.transaction, JACOB, JAVAX.connector, JAVAX.ejb, JAVAX.persistence, JAVAX.stream,
JAVAX.transaction, JAXEN, JBI, OPENJPA, SAXON, SERVICEMIX, SPRING, TRANQL,
@@ -439,7 +450,8 @@
SLF4J,
LOG4J,
DOM4J,
- HIBERNATE
+ HIBERNATE,
+ JACKSON
test.setup unzip(_("target/test/smx/ode")=>project("dao-jpa-ojpa-derby").package(:zip))
test.setup unzip(_("target/test/smx/ode")=>project("dao-hibernate-db").package(:zip))
test.setup task(:prepare_jbi_tests) do |task|
@@ -547,7 +559,7 @@
desc "ODE JBI Bundle"
define "jbi-bundle" do
ode_libs = artifacts(projects("bpel-api", "bpel-api-jca", "bpel-compiler", "bpel-connector", "bpel-dao", "bpel-epr",
- "jca-ra", "jca-server", "bpel-obj", "bpel-ql", "bpel-runtime", "scheduler-simple",
+ "jca-ra", "jca-server", "bpel-nobj", "bpel-ql", "bpel-runtime", "scheduler-simple",
"bpel-schemas", "bpel-store", "dao-hibernate", "dao-jpa", "utils", "agents"))
libs = artifacts(ANT, AXIOM, BACKPORT, COMMONS.codec, COMMONS.collections, COMMONS.dbcp, COMMONS.lang, COMMONS.pool,
COMMONS.primitives, COMMONS.io, DERBY, GERONIMO.connector, GERONIMO.transaction, JACOB, JAVAX.connector,
@@ -658,7 +670,7 @@
# Libraries
zip.path("lib").include artifacts(COMMONS.codec, COMMONS.httpclient,
COMMONS.pool, COMMONS.collections, JAXEN, SAXON, WSDL4J, XALAN, XERCES, SLF4J, LOG4J)
- project("ode").projects("utils", "tools", "bpel-compiler", "bpel-api", "bpel-obj", "bpel-schemas").
+ project("ode").projects("utils", "tools", "bpel-compiler", "bpel-api", "bpel-nobj", "bpel-schemas").
map(&:packages).flatten.each do |pkg|
zip.include(pkg.to_s, :as=>"#{pkg.id}.#{pkg.type}", :path=>"lib") unless ['sources', 'javadoc'].include?(pkg.classifier)
end
@@ -669,7 +681,11 @@
# Include supported database schemas
Dir["#{project("ode:dao-jpa-ojpa-derby").path_to("target")}/*.sql"].each do |f|
- zip.include(f, :path=>"sql") unless f =~ /partial/
+ zip.include(f, :path=>"sql/openjpa") unless f =~ /partial/
+ end
+
+ Dir["#{project("ode:dao-hibernate-db").path_to("target")}/*.sql"].each do |f|
+ zip.include(f, :path=>"sql/hibernate") unless f =~ /partial/
end
# Tools scripts (like bpelc and sendsoap)
@@ -684,7 +700,7 @@
yield zip
project.check zip, "should contain mysql.sql" do
- it.should contain("sql/mysql.sql")
+ it.should contain("sql/openjpa/mysql.sql")
end
project.check zip, "should contain sendsoap.bat" do
it.should contain("bin/sendsoap.bat")
diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java b/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
index 4fe655d..a718462 100644
--- a/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
+++ b/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java
@@ -162,7 +162,7 @@
String odeRootAbsolutePath = getClass().getClassLoader().getResource("webapp/WEB-INF").getFile();
String axis2RepoAbsolutePath = getClass().getClassLoader().getResource(axis2RepoDir).getFile();
String axis2ConfAbsolutePath = axis2ConfLocation == null ? null : getClass().getClassLoader().getResource(axis2ConfLocation).getFile();
- ODEConfigProperties config = new ODEConfigProperties(new File(System.getProperty("org.apache.ode.configDir", odeRootAbsolutePath + "/conf.hib-derby")));
+ ODEConfigProperties config = new ODEConfigProperties(new File(System.getProperty("org.apache.ode.configDir", odeRootAbsolutePath + "/conf")));
config.load();
server = new ODEAxis2Server(odeRootAbsolutePath, axis2RepoAbsolutePath, axis2ConfAbsolutePath, getTestPort(0), config);
server.txMgrCreatedCallback = new Runnable() {
diff --git a/axis2-war/src/test/webapp/WEB-INF/conf/ode-axis2.properties b/axis2-war/src/test/webapp/WEB-INF/conf/ode-axis2.properties
index e12b199..0a59324 100644
--- a/axis2-war/src/test/webapp/WEB-INF/conf/ode-axis2.properties
+++ b/axis2-war/src/test/webapp/WEB-INF/conf/ode-axis2.properties
@@ -16,9 +16,11 @@
#
ode-axis2.dao.factory=org.apache.ode.axis2.instancecleanup.HibDaoConnectionFactoryImpl
-#ode-axis2.db.mode=INTERNAL
+ode-axis2.db.mode=EMBEDDED
#ode-axis2.db.int.jdbcurl=jdbc:h2:file:axis2-war/target/test/classes/webapp/WEB-INF/h2-hibdb/ode-hib-h2;DB_CLOSE_ON_EXIT=false;user=sa;TRACE_LEVEL_FILE=3
#ode-axis2.db.int.driver=org.h2.Driver
+ode-axis2.db.emb.type=H2
+ode-axis2.db.emb.name=h2-hibdb/ode-hib-h2
ode-axis2.cluster.localRoute.targets=http://doesntexist:8080/ode/processes/
ode-axis2.cluster.localRoute.base=http://localhost:8888/ode/processes/
ode-axis2.event.listeners=org.apache.ode.bpel.common.evt.DebugBpelEventListener
diff --git a/axis2/src/main/java/org/apache/ode/axis2/ODEAxis2Server.java b/axis2/src/main/java/org/apache/ode/axis2/ODEAxis2Server.java
index 4287eb2..ebc86f3 100644
--- a/axis2/src/main/java/org/apache/ode/axis2/ODEAxis2Server.java
+++ b/axis2/src/main/java/org/apache/ode/axis2/ODEAxis2Server.java
@@ -170,7 +170,7 @@
try {
fos = new FileOutputStream(fileName);
} catch (FileNotFoundException e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
configContext.getAxisConfiguration().getService(serviceName).printWSDL(fos);
}
diff --git a/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java b/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
index 66113ee..3b4833f 100644
--- a/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
+++ b/axis2/src/main/java/org/apache/ode/axis2/service/ManagementService.java
@@ -43,7 +43,7 @@
import org.apache.axis2.engine.AxisConfiguration;
import org.apache.axis2.engine.AxisEngine;
import org.apache.axis2.receivers.AbstractMessageReceiver;
-import org.apache.axis2.util.Utils;
+import org.apache.axis2.util.MessageContextBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.axis2.hooks.ODEAxisService;
@@ -123,7 +123,7 @@
public void invokeBusinessLogic(MessageContext messageContext) throws AxisFault {
DynamicService<T> service = new DynamicService<T>(_service);
- MessageContext outMsgContext = Utils.createOutMessageContext(messageContext);
+ MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(messageContext);
outMsgContext.getOperationContext().addMessageContext(outMsgContext);
SOAPFactory soapFactory = getSOAPFactory(messageContext);
SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
diff --git a/axis2/src/main/java/org/apache/ode/axis2/util/WLSFactory.java b/axis2/src/main/java/org/apache/ode/axis2/util/WLSFactory.java
index 506766f..6a4643c 100644
--- a/axis2/src/main/java/org/apache/ode/axis2/util/WLSFactory.java
+++ b/axis2/src/main/java/org/apache/ode/axis2/util/WLSFactory.java
@@ -54,7 +54,7 @@
Context ctx = new InitialContext(env);
tm = (TransactionManager) ctx.lookup("javax.transaction.TransactionManager");
} catch (NamingException e) {
- e.printStackTrace();
+ throw new RuntimeException( "Error while looking up TransactionManager", e);
}
return tm;
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/explang/ConfigurationException.java b/bpel-api/src/main/java/org/apache/ode/bpel/explang/ConfigurationException.java
index 9b6168d..d409ae1 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/explang/ConfigurationException.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/explang/ConfigurationException.java
@@ -20,7 +20,7 @@
/**
* Exception indicating thrown from the
- * {@link ExpressionLanguageRuntime#initialize(org.apache.ode.bpel.o.OExpressionLanguage)}
+ * {@link ExpressionLanguageRuntime#initialize(org.apache.ode.bpel.obj.OExpressionLanguage)}
* method indicating that the expression language processor could not be
* configured.
*/
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java b/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java
index 6d70732..605a655 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationContext.java
@@ -24,11 +24,11 @@
import javax.xml.namespace.QName;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java b/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java
index 3639891..1932e1a 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java
@@ -19,7 +19,7 @@
package org.apache.ode.bpel.explang;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.obj.OExpression;
import org.apache.ode.utils.xsd.Duration;
import org.w3c.dom.Node;
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java b/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
index 7b41b02..b01ad69 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/iapi/DebuggerContext.java
@@ -55,7 +55,7 @@
/**
* @return the process model.
- * Currently an {@link org.apache.ode.bpel.o.OProcess}
+ * Currently an {@link org.apache.ode.bpel.obj.OProcess}
* However it is not guaranteed that it will remain an OProcess
* in future versions of ODE or for different types
* of process lanaguage than BPEL.
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java b/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
index c3808bc..526a199 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
@@ -32,7 +32,7 @@
import javax.xml.namespace.QName;
import org.apache.ode.bpel.evt.BpelEvent;
-import org.apache.ode.bpel.o.OFailureHandling;
+import org.apache.ode.bpel.obj.OFailureHandling;
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
import org.apache.ode.utils.CronExpression;
import org.w3c.dom.Element;
@@ -84,8 +84,15 @@
/**
* Get the CBP stream.
* @return new stream to the CBP file.
+ * @deprecated use {@link #getCBPFile()} instead.
*/
InputStream getCBPInputStream();
+
+ /**
+ * Get the CBP file
+ * @return the CBP file
+ */
+ File getCBPFile();
/**
* Get the CBP file size.
diff --git a/bpel-api/src/main/java/org/apache/ode/bpel/pmapi/BpelManagementFacade.java b/bpel-api/src/main/java/org/apache/ode/bpel/pmapi/BpelManagementFacade.java
index e3e5421..7a64f33 100644
--- a/bpel-api/src/main/java/org/apache/ode/bpel/pmapi/BpelManagementFacade.java
+++ b/bpel-api/src/main/java/org/apache/ode/bpel/pmapi/BpelManagementFacade.java
@@ -23,7 +23,7 @@
import org.apache.ode.bpel.bdi.breaks.VariableModificationBreakpoint;
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.evt.ProcessInstanceEvent;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
import javax.xml.namespace.QName;
import java.util.Date;
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ActivityGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ActivityGenerator.java
index fe0fdfd..7960cea 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ActivityGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ActivityGenerator.java
@@ -20,13 +20,13 @@
import org.apache.ode.bpel.compiler.api.CompilerContext;
import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.obj.OActivity;
/**
* Interface implemented by classes providing activity-generating logic.
* Implementations of this interface are used to convert an
- * activity description object ({@link org.apache.ode.bom.impl.nodes.ActivityImpl})
+ * activity description object ({@link org.apache.ode.bpel.compiler.bom.Activity})
* into a <em>compiled</em> BPEL representation.
*/
public interface ActivityGenerator {
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
index b725ed1..983b368 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/AssignGenerator.java
@@ -31,12 +31,12 @@
import org.apache.ode.bpel.compiler.bom.PropertyVal;
import org.apache.ode.bpel.compiler.bom.To;
import org.apache.ode.bpel.compiler.bom.VariableVal;
-import org.apache.ode.bpel.o.DebugInfo;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OAssign;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OAssign.RValue;
-import org.apache.ode.bpel.o.OMessageVarType;
+import org.apache.ode.bpel.obj.DebugInfo;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OAssign;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OAssign.RValue;
+import org.apache.ode.bpel.obj.OMessageVarType;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.msg.MessageBundle;
import org.w3c.dom.Document;
@@ -64,25 +64,24 @@
AssignActivity ad = (AssignActivity) source;
for (Copy scopy : ad.getCopies()) {
OAssign.Copy ocopy = new OAssign.Copy(_context.getOProcess());
- ocopy.keepSrcElementName = scopy.isKeepSrcElement();
- ocopy.ignoreMissingFromData = scopy.isIgnoreMissingFromData();
- ocopy.ignoreUninitializedFromVariable = scopy.isIgnoreUninitializedFromVariable();
- ocopy.insertMissingToData = scopy.isInsertMissingToData();
- ocopy.insertMissingToData = scopy.isInsertMissingToData();
- ocopy.debugInfo = new DebugInfo(_context.getSourceLocation(), scopy.getLineNo(),
- source.getExtensibilityElements());
+ ocopy.setKeepSrcElementName(scopy.isKeepSrcElement());
+ ocopy.setIgnoreMissingFromData(scopy.isIgnoreMissingFromData());
+ ocopy.setIgnoreUninitializedFromVariable(scopy.isIgnoreUninitializedFromVariable());
+ ocopy.setInsertMissingToData(scopy.isInsertMissingToData());
+ ocopy.setInsertMissingToData(scopy.isInsertMissingToData());
+ ocopy.setDebugInfo(new DebugInfo(_context.getSourceLocation() , scopy.getLineNo() , source.getExtensibilityElements()));
try {
if (scopy.getTo() == null)
throw new CompilationException(__cmsgs.errMissingToSpec().setSource(scopy));
Object[] toResultType = new Object[1];
- ocopy.to = compileTo(scopy.getTo(), toResultType);
+ ocopy.setTo(compileTo(scopy.getTo(), toResultType));
if (scopy.getFrom() == null)
throw new CompilationException(__cmsgs.errMissingFromSpec().setSource(scopy));
- ocopy.from = compileFrom(scopy.getFrom(), toResultType[0]);
+ ocopy.setFrom(compileFrom(scopy.getFrom(), toResultType[0]));
verifyCopy(ocopy);
- oassign.copy.add(ocopy);
+ oassign.getCopy().add(ocopy);
} catch (CompilationException ce) {
_context.recoveredFromError(scopy, ce);
@@ -100,13 +99,13 @@
__log.debug("verifying copy: " + ocopy);
// If direct Message->Message copy
- if (ocopy.to instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.to).isMessageRef()
- && ocopy.from instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.from).isMessageRef()) {
+ if (ocopy.getTo() instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.getTo()).isMessageRef()
+ && ocopy.getFrom() instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.getFrom()).isMessageRef()) {
// Check that the LValue/RValue message types match up.
- String lvar = ((OAssign.VariableRef) ocopy.to).variable.name;
- String rvar = ((OAssign.VariableRef) ocopy.from).variable.name;
- QName tlvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.to).variable.type).messageType;
- QName trvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.from).variable.type).messageType;
+ String lvar = ((OAssign.VariableRef) ocopy.getTo()).getVariable().getName();
+ String rvar = ((OAssign.VariableRef) ocopy.getFrom()).getVariable().getName();
+ QName tlvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.getTo()).getVariable().getType()).getMessageType();
+ QName trvalue = ((OMessageVarType) ((OAssign.VariableRef) ocopy.getFrom()).getVariable().getType()).getMessageType();
if (!tlvalue.equals(trvalue))
throw new CompilationException(__cmsgs.errMismatchedMessageAssignment(lvar, tlvalue, rvar, trvalue));
@@ -114,38 +113,38 @@
}
// If Message->Non-Message copy
- else if (ocopy.from instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.from).isMessageRef()
- && (!(ocopy.to instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.to).isMessageRef())) {
- String rval = ((OAssign.VariableRef) ocopy.from).variable.name;
+ else if (ocopy.getFrom() instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.getFrom()).isMessageRef()
+ && (!(ocopy.getTo() instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.getTo()).isMessageRef())) {
+ String rval = ((OAssign.VariableRef) ocopy.getFrom()).getVariable().getName();
throw new CompilationException(__cmsgs.errCopyFromMessageToNonMessage(rval));
}
// If Non-Message->Message copy
- else if (ocopy.to instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.to).isMessageRef()
- && (!(ocopy.from instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.from).isMessageRef())) {
+ else if (ocopy.getTo() instanceof OAssign.VariableRef && ((OAssign.VariableRef) ocopy.getTo()).isMessageRef()
+ && (!(ocopy.getFrom() instanceof OAssign.VariableRef) || !((OAssign.VariableRef) ocopy.getFrom()).isMessageRef())) {
- String lval = ((OAssign.VariableRef) ocopy.to).variable.name;
+ String lval = ((OAssign.VariableRef) ocopy.getTo()).getVariable().getName();
throw new CompilationException(__cmsgs.errCopyToMessageFromNonMessage(lval));
}
// If *->Partner Link copy
- else if (ocopy.to instanceof OAssign.PartnerLinkRef
- && !((OAssign.PartnerLinkRef) ocopy.to).partnerLink.hasPartnerRole()) {
- String lval = ((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName();
+ else if (ocopy.getTo() instanceof OAssign.PartnerLinkRef
+ && !((OAssign.PartnerLinkRef) ocopy.getTo()).getPartnerLink().hasPartnerRole()) {
+ String lval = ((OAssign.PartnerLinkRef) ocopy.getTo()).getPartnerLink().getName();
throw new CompilationException(__cmsgs.errCopyToUndeclaredPartnerRole(lval));
}
// If Partner Link->* copy
- else if (ocopy.from instanceof OAssign.PartnerLinkRef) {
- if (((OAssign.PartnerLinkRef) ocopy.from).isMyEndpointReference
- && !((OAssign.PartnerLinkRef) ocopy.from).partnerLink.hasMyRole()) {
- String lval = ((OAssign.PartnerLinkRef) ocopy.from).partnerLink.getName();
+ else if (ocopy.getFrom() instanceof OAssign.PartnerLinkRef) {
+ if (((OAssign.PartnerLinkRef) ocopy.getFrom()).isIsMyEndpointReference()
+ && !((OAssign.PartnerLinkRef) ocopy.getFrom()).getPartnerLink().hasMyRole()) {
+ String lval = ((OAssign.PartnerLinkRef) ocopy.getFrom()).getPartnerLink().getName();
throw new CompilationException(__cmsgs.errCopyFromUndeclaredPartnerRole(lval, "myRole"));
}
- if (!((OAssign.PartnerLinkRef) ocopy.from).isMyEndpointReference
- && !((OAssign.PartnerLinkRef) ocopy.from).partnerLink.hasPartnerRole()) {
- String lval = ((OAssign.PartnerLinkRef) ocopy.from).partnerLink.getName();
+ if (!((OAssign.PartnerLinkRef) ocopy.getFrom()).isIsMyEndpointReference()
+ && !((OAssign.PartnerLinkRef) ocopy.getFrom()).getPartnerLink().hasPartnerRole()) {
+ String lval = ((OAssign.PartnerLinkRef) ocopy.getFrom()).getPartnerLink().getName();
throw new CompilationException(__cmsgs.errCopyFromUndeclaredPartnerRole(lval, "partnerRole"));
}
}
@@ -163,32 +162,32 @@
} else if (from.isPropertyVal()) {
OAssign.PropertyRef pref = new OAssign.PropertyRef(_context.getOProcess());
PropertyVal pval = from.getAsPropertyVal();
- pref.variable = _context.resolveVariable(pval.getVariable());
- pref.propertyAlias = _context.resolvePropertyAlias(pref.variable, pval.getProperty());
+ pref.setVariable(_context.resolveVariable(pval.getVariable()));
+ pref.setPropertyAlias(_context.resolvePropertyAlias(pref.getVariable(), pval.getProperty()));
return pref;
} else if (from.isVariableVal()) {
VariableVal vv = from.getAsVariableVal();
OAssign.VariableRef vref = new OAssign.VariableRef(_context.getOProcess());
- vref.variable = _context.resolveVariable(vv.getVariable());
- OVarType rootNodeType = vref.variable.type;
+ vref.setVariable(_context.resolveVariable(vv.getVariable()));
+ OVarType rootNodeType = vref.getVariable().getType();
if (vv.getPart() != null) {
- vref.part = _context.resolvePart(vref.variable, vv.getPart());
- rootNodeType = vref.part.type;
+ vref.setPart(_context.resolvePart(vref.getVariable(), vv.getPart()));
+ rootNodeType = vref.getPart().getType();
}
if (vv.getHeader() != null) {
- vref.headerPart = _context.resolveHeaderPart(vref.variable, vv.getHeader());
- if (vref.headerPart == null)
- vref.headerPart = new OMessageVarType.Part(_context.getOProcess(), vv.getHeader(), null);
- rootNodeType = vref.headerPart.type;
+ vref.setHeaderPart(_context.resolveHeaderPart(vref.getVariable(), vv.getHeader()));
+ if (vref.getHeaderPart() == null)
+ vref.setHeaderPart(new org.apache.ode.bpel.obj.OMessageVarType.Part(_context.getOProcess() , vv.getHeader() , null));
+ rootNodeType = vref.getHeaderPart().getType();
}
if (vv.getLocation() != null && vv.getLocation().getExpression() != null)
- vref.location = _context.compileExpr(vv.getLocation(), rootNodeType, requestedResultType, new Object[1]);
+ vref.setLocation(_context.compileExpr(vv.getLocation(), rootNodeType, requestedResultType, new java.lang.Object[1]));
return vref;
} else if (from.isPartnerLinkVal()) {
PartnerLinkVal plv = from.getAsPartnerLinkVal();
OAssign.PartnerLinkRef plref = new OAssign.PartnerLinkRef(_context.getOProcess());
- plref.partnerLink = _context.resolvePartnerLink(plv.getPartnerLink());
- plref.isMyEndpointReference = (plv.getEndpointReference() == PartnerLinkVal.EndpointReference.MYROLE);
+ plref.setPartnerLink(_context.resolvePartnerLink(plv.getPartnerLink()));
+ plref.setIsMyEndpointReference((plv.getEndpointReference()) == (org.apache.ode.bpel.compiler.bom.PartnerLinkVal.EndpointReference.MYROLE));
return plref;
} else if (from.getAsExpression() != null) {
return new OAssign.Expression(_context.getOProcess(), _context.compileExpr(from.getAsExpression(), null, requestedResultType, new Object[1]));
@@ -212,8 +211,8 @@
*/
private RValue compileExtensionVal(ExtensionVal extVal) {
OAssign.DirectRef dref = new OAssign.DirectRef(_context.getOProcess());
- dref.variable = _context.resolveVariable(extVal.getVariable());
- dref.elName = extVal.getExtension();
+ dref.setVariable(_context.resolveVariable(extVal.getVariable()));
+ dref.setElName(extVal.getExtension());
return dref;
}
@@ -231,31 +230,31 @@
try {
if (to.isPropertyVal()) {
OAssign.PropertyRef pref = new OAssign.PropertyRef(_context.getOProcess());
- pref.variable = _context.resolveVariable(to.getAsPropertyVal().getVariable());
- pref.propertyAlias = _context.resolvePropertyAlias(pref.variable, to.getAsPropertyVal().getProperty());
+ pref.setVariable(_context.resolveVariable(to.getAsPropertyVal().getVariable()));
+ pref.setPropertyAlias(_context.resolvePropertyAlias(pref.getVariable(), to.getAsPropertyVal().getProperty()));
return pref;
} else if (to.isVariableVal()) {
VariableVal vv = to.getAsVariableVal();
OAssign.VariableRef vref = new OAssign.VariableRef(_context.getOProcess());
- vref.variable = _context.resolveVariable(vv.getVariable());
- OVarType rootNodeType = vref.variable.type;
+ vref.setVariable(_context.resolveVariable(vv.getVariable()));
+ OVarType rootNodeType = vref.getVariable().getType();
if (to.getAsVariableVal().getPart() != null) {
- vref.part = _context.resolvePart(vref.variable, vv.getPart());
- rootNodeType = vref.part.type;
+ vref.setPart(_context.resolvePart(vref.getVariable(), vv.getPart()));
+ rootNodeType = vref.getPart().getType();
}
if (to.getAsVariableVal().getHeader() != null) {
- vref.headerPart = _context.resolveHeaderPart(vref.variable, vv.getHeader());
- if (vref.headerPart == null)
- vref.headerPart = new OMessageVarType.Part(_context.getOProcess(), to.getAsVariableVal().getHeader(), null);
- rootNodeType = vref.headerPart.type;
+ vref.setHeaderPart(_context.resolveHeaderPart(vref.getVariable(), vv.getHeader()));
+ if (vref.getHeaderPart() == null)
+ vref.setHeaderPart(new org.apache.ode.bpel.obj.OMessageVarType.Part(_context.getOProcess() , to.getAsVariableVal().getHeader() , null));
+ rootNodeType = vref.getHeaderPart().getType();
}
resultType[0] = rootNodeType;
if (vv.getLocation() != null && vv.getLocation().getExpression() != null)
- vref.location = _context.compileExpr(vv.getLocation(), rootNodeType, null, resultType);
+ vref.setLocation(_context.compileExpr(vv.getLocation(), rootNodeType, null, resultType));
return vref;
} else if (to.isPartnerLinkVal()) {
OAssign.PartnerLinkRef plref = new OAssign.PartnerLinkRef(_context.getOProcess());
- plref.partnerLink = _context.resolvePartnerLink(to.getAsPartnerLinkVal().getPartnerLink());
+ plref.setPartnerLink(_context.resolvePartnerLink(to.getAsPartnerLinkVal().getPartnerLink()));
return plref;
} else if (to.getAsExpression() != null){
return new OAssign.LValueExpression(_context.getOProcess(), _context
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java
index c2bf06a..e959d9b 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelC.java
@@ -21,6 +21,7 @@
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@@ -37,8 +38,11 @@
import org.apache.ode.bpel.compiler.api.SourceLocation;
import org.apache.ode.bpel.compiler.bom.BpelObjectFactory;
import org.apache.ode.bpel.compiler.bom.Process;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OProcessWrapper;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
+import org.apache.ode.bpel.obj.serde.OmSerializer;
import org.apache.ode.utils.StreamUtils;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.xsl.XslTransformHandler;
@@ -157,7 +161,7 @@
_outputStream = os;
if (__log.isDebugEnabled()) {
- __log.debug("Sett output to stream " + os);
+ __log.debug("Set output to stream " + os);
}
}
@@ -282,8 +286,8 @@
}
try {
- Serializer fileHeader = new Serializer(System.currentTimeMillis());
- fileHeader.writeOProcess(oprocess, _outputStream);
+ DeSerializer serializer = new DeSerializer();
+ serializer.serialize(_outputStream, oprocess);
} finally {
// close & mark myself invalid
this.invalidate();
@@ -306,6 +310,143 @@
compile(bpelFile, 0);
}
+ public OProcess compile(final Process process, long version){
+ if (process == null)
+ throw new NullPointerException("Attempt to compile NULL process.");
+
+ logCompilationMessage(__cmsgs.infCompilingProcess());
+
+ BpelCompiler compiler;
+ ResourceFinder wf;
+
+ if (_wsdlFinder != null) {
+ wf = _wsdlFinder;
+ } else {
+ File suDir = _suDir != null ? _suDir : _bpelFile.getParentFile();
+ wf = new DefaultResourceFinder(_bpelFile.getAbsoluteFile().getParentFile(), suDir.getAbsoluteFile());
+ }
+
+ CompileListener clistener = new CompileListener() {
+ public void onCompilationMessage(CompilationMessage compilationMessage) {
+ SourceLocation location = compilationMessage.source;
+ if (location == null) {
+ compilationMessage.source = process;
+ }
+ logCompilationMessage(compilationMessage);
+ }
+ };
+
+ try {
+ switch (process.getBpelVersion()) {
+ case BPEL20:
+ compiler = new BpelCompiler20();
+ compiler.setResourceFinder(wf);
+ if (_bpel11wsdl != null) {
+ CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process();
+ logCompilationMessage(cmsg);
+ }
+ break;
+ case BPEL20_DRAFT:
+ compiler = new BpelCompiler20Draft();
+ compiler.setResourceFinder(wf);
+ if (_bpel11wsdl != null) {
+ CompilationMessage cmsg = __cmsgs.warnWsdlUriIgnoredFor20Process();
+ logCompilationMessage(cmsg);
+ }
+ break;
+ case BPEL11:
+ compiler = new BpelCompiler11();
+ compiler.setResourceFinder(wf);
+ if (_bpel11wsdl != null) {
+ compiler.addWsdlImport(new URI(_bpelFile.getName()), _bpel11wsdl,null);
+ } else {
+ CompilationMessage cmsg = __cmsgs.errBpel11RequiresWsdl();
+ logCompilationMessage(cmsg);
+ this.invalidate();
+ throw new CompilationException(cmsg);
+ }
+ break;
+ default:
+ CompilationMessage cmsg = __cmsgs.errUnrecognizedBpelVersion();
+ logCompilationMessage(cmsg);
+ this.invalidate();
+ throw new CompilationException(cmsg);
+ }
+ compiler.setCompileListener(clistener);
+ if (_compileProperties != null) {
+ if (_compileProperties.get(PROCESS_CUSTOM_PROPERTIES) != null)
+ compiler.setCustomProperties((Map<QName, Node>) _compileProperties.get(PROCESS_CUSTOM_PROPERTIES));
+ }
+ } catch (CompilationException ce) {
+ this.invalidate();
+ throw ce;
+ } catch (Exception ex) {
+ CompilationMessage cmsg = __cmsgs.errBpelParseErr();
+ logCompilationMessage(cmsg);
+ this.invalidate();
+ throw new CompilationException(cmsg,ex);
+ }
+
+ OProcess oprocess;
+ try {
+ oprocess = compiler.compile(process,wf,version);
+ }
+ catch (CompilationException cex) {
+ this.invalidate();
+ throw cex;
+ }
+ return oprocess;
+ }
+ public OProcess compile2OProcess(File bpelFile, long version){
+ if (__log.isDebugEnabled()) {
+ __log.debug("compile(URL)");
+ }
+
+ if (bpelFile == null) {
+ this.invalidate();
+ throw new IllegalArgumentException("Null bpelFile");
+ }
+
+ _bpelFile = bpelFile;
+ Process process;
+ try {
+ InputSource isrc = new InputSource(new ByteArrayInputStream(StreamUtils.read(bpelFile.toURL())));
+ isrc.setSystemId(bpelFile.getAbsolutePath());
+
+ process = BpelObjectFactory.getInstance().parse(isrc,_bpelFile.toURI());
+ } catch (Exception e) {
+ CompilationMessage cmsg = __cmsgs.errBpelParseErr().setSource(new SourceLocationImpl(bpelFile.toURI()));
+ this.invalidate();
+ throw new CompilationException(cmsg, e);
+ }
+
+ assert process != null;
+ return compile(process, version);
+ }
+ public void serializeOProcess(OProcess oprocess, String outputPath) throws IOException{
+ if (!_dryRun) {
+ if (outputPath != null) {
+ this.setOutputStream(new BufferedOutputStream(new FileOutputStream(outputPath)));
+ if (__log.isDebugEnabled()) {
+ __log.debug("Writing compilation results to " + outputPath);
+ }
+ } else if (_outputStream != null) {
+ if (__log.isDebugEnabled()) {
+ __log.debug("Writing compilation results to " + _outputStream.getClass().getName());
+ }
+ } else {
+ throw new IllegalStateException("must setOutputStream() or setOutputDirectory()!");
+ }
+
+ try {
+ DeSerializer serializer = new DeSerializer();
+ serializer.serialize(_outputStream, oprocess);
+ } finally {
+ // close & mark myself invalid
+ this.invalidate();
+ }
+ }
+ }
/**
* <p>
* Compile a BPEL process from a file. This method uses a {@link BpelObjectFactory}
@@ -318,7 +459,7 @@
* @throws CompilationException if one occurs while compiling the process.
*/
public void compile(File bpelFile, long version) throws CompilationException, IOException {
- if (__log.isDebugEnabled()) {
+/* if (__log.isDebugEnabled()) {
__log.debug("compile(URL)");
}
@@ -348,6 +489,13 @@
compile(process, cbpPath, version);
this.invalidate();
+ */
+ OProcess oProcess = compile2OProcess(bpelFile, version);
+ // Output file = bpel file with a cbp extension
+ String bpelPath = bpelFile.getAbsolutePath();
+ String cbpPath = bpelPath.substring(0, bpelPath.lastIndexOf(".")) + ".cbp";
+ serializeOProcess(oProcess, cbpPath);
+
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
index 64f2204..f24bf2f 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
@@ -43,7 +43,6 @@
import javax.wsdl.xml.WSDLReader;
import javax.xml.namespace.QName;
import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -82,36 +81,32 @@
import org.apache.ode.bpel.compiler.bom.Variable;
import org.apache.ode.bpel.compiler.wsdl.Definition4BPEL;
import org.apache.ode.bpel.compiler.wsdl.WSDLFactory4BPEL;
-import org.apache.ode.bpel.o.DebugInfo;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OAssign;
-import org.apache.ode.bpel.o.OCatch;
-import org.apache.ode.bpel.o.OCompensate;
-import org.apache.ode.bpel.o.OCompensationHandler;
-import org.apache.ode.bpel.o.OConstantExpression;
-import org.apache.ode.bpel.o.OConstantVarType;
-import org.apache.ode.bpel.o.OConstants;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OEventHandler;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OExpressionLanguage;
-import org.apache.ode.bpel.o.OExtVar;
-import org.apache.ode.bpel.o.OFaultHandler;
-import org.apache.ode.bpel.o.OFlow;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.ORethrow;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OSequence;
-import org.apache.ode.bpel.o.OTerminationHandler;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.obj.DebugInfo;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OAssign;
+import org.apache.ode.bpel.obj.OCatch;
+import org.apache.ode.bpel.obj.OCompensate;
+import org.apache.ode.bpel.obj.OConstantExpression;
+import org.apache.ode.bpel.obj.OConstantVarType;
+import org.apache.ode.bpel.obj.OConstants;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OEventHandler;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OExpressionLanguage;
+import org.apache.ode.bpel.obj.OExtVar;
+import org.apache.ode.bpel.obj.OFlow;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.ORethrow;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OSequence;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.DOMUtils;
-import org.apache.ode.utils.GUID;
import org.apache.ode.utils.NSContext;
import org.apache.ode.utils.Namespaces;
import org.apache.ode.utils.StreamUtils;
@@ -315,43 +310,43 @@
public List<OScope.Variable> getAccessibleVariables() {
ArrayList<OScope.Variable> result = new ArrayList<OScope.Variable>();
for (Iterator<OScope> i = _structureStack.oscopeIterator(); i.hasNext();) {
- result.addAll(i.next().variables.values());
+ result.addAll(i.next().getVariables().values());
}
return result;
}
public OScope.Variable resolveMessageVariable(String inputVar) throws CompilationException {
OScope.Variable var = resolveVariable(inputVar);
- if (!(var.type instanceof OMessageVarType))
+ if (!(var.getType() instanceof OMessageVarType))
throw new CompilationException(__cmsgs.errMessageVariableRequired(inputVar));
return var;
}
public OScope.Variable resolveMessageVariable(String inputVar, QName messageType) throws CompilationException {
OScope.Variable var = resolveMessageVariable(inputVar);
- if (!((OMessageVarType) var.type).messageType.equals(messageType))
- throw new CompilationException(__cmsgs.errVariableTypeMismatch(var.name, messageType,
- ((OMessageVarType) var.type).messageType));
+ if (!((OMessageVarType) var.getType()).getMessageType().equals(messageType))
+ throw new CompilationException(__cmsgs.errVariableTypeMismatch(var.getName(), messageType,
+ ((OMessageVarType) var.getType()).getMessageType()));
return var;
}
public OProcess.OProperty resolveProperty(QName name) {
- for (OProcess.OProperty prop : _oprocess.properties) {
- if (prop.name.equals(name))
+ for (OProcess.OProperty prop : _oprocess.getProperties()) {
+ if (prop.getName().equals(name))
return prop;
}
throw new CompilationException(__cmsgs.errUndeclaredProperty(name));
}
public OProcess.OPropertyAlias resolvePropertyAlias(OScope.Variable variable, QName propertyName) {
- if (!(variable.type instanceof OMessageVarType))
- throw new CompilationException(__cmsgs.errMessageVariableRequired(variable.name));
+ if (!(variable.getType() instanceof OMessageVarType))
+ throw new CompilationException(__cmsgs.errMessageVariableRequired(variable.getName()));
OProcess.OProperty property = resolveProperty(propertyName);
- OProcess.OPropertyAlias alias = property.getAlias(variable.type);
+ OProcess.OPropertyAlias alias = property.getAlias(variable.getType());
if (alias == null)
- throw new CompilationException(__cmsgs.errUndeclaredPropertyAlias(variable.type.toString(), propertyName));
+ throw new CompilationException(__cmsgs.errUndeclaredPropertyAlias(variable.getType().toString(), propertyName));
return alias;
}
@@ -361,9 +356,9 @@
throw new CompilationException(__cmsgs.errCompensateNAtoContext());
OScope recoveryContext = _recoveryContextStack.peek();
- OScope scopeToComp = CollectionsX.find_if(recoveryContext.compensatable, new MemberOfFunction<OScope>() {
+ OScope scopeToComp = CollectionsX.find_if(recoveryContext.getCompensatable(), new MemberOfFunction<OScope>() {
public boolean isMember(OScope o) {
- return o.name != null && o.name.equals(scopeToCompensate);
+ return o.getName() != null && o.getName().equals(scopeToCompensate);
}
});
if (scopeToComp == null)
@@ -388,7 +383,7 @@
@SuppressWarnings("unchecked")
public OMessageVarType resolveMessageType(QName messageType) {
- OMessageVarType msgType = _oprocess.messageTypes.get(messageType);
+ OMessageVarType msgType = _oprocess.getMessageTypes().get(messageType);
if (msgType == null) {
Message msg = _wsdlRegistry.getMessage(messageType);
if (msg == null) {
@@ -408,19 +403,19 @@
}
OMessageVarType.Part opart = new OMessageVarType.Part(_oprocess, part.getName(), partType);
- opart.debugInfo = createDebugInfo(_processDef, "Message Variable Part: " + part.getName());
+ opart.setDebugInfo(createDebugInfo(_processDef, ("Message Variable Part: " + (part.getName()))));
return opart;
}
});
msgType = new OMessageVarType(_oprocess, msg.getQName(), parts);
- msgType.debugInfo = createDebugInfo(_processDef, "Message Type: " + msg.getQName());
- _oprocess.messageTypes.put(msg.getQName(), msgType);
+ msgType.setDebugInfo(createDebugInfo(_processDef, ("Message Type: " + (msg.getQName()))));
+ _oprocess.getMessageTypes().put(msg.getQName(), msgType);
}
return msgType;
}
public OXsdTypeVarType resolveXsdType(QName typeName) throws CompilationException {
- OXsdTypeVarType type = _oprocess.xsdTypes.get(typeName);
+ OXsdTypeVarType type = _oprocess.getXsdTypes().get(typeName);
if (type == null) {
__log.debug("Resolving XSD type " + typeName);
SchemaModel model = null;
@@ -431,31 +426,31 @@
throw new CompilationException(__cmsgs.errUndeclaredXsdType(typeName));
type = new OXsdTypeVarType(_oprocess);
- type.debugInfo = createDebugInfo(_processDef, "XSD Type: " + typeName);
- type.xsdType = typeName;
- type.simple = _wsdlRegistry.getSchemaModel().isSimpleType(typeName);
- _oprocess.xsdTypes.put(typeName, type);
+ type.setDebugInfo(createDebugInfo(_processDef, ("XSD Type: " + typeName)));
+ type.setXsdType(typeName);
+ type.setSimple(_wsdlRegistry.getSchemaModel().isSimpleType(typeName));
+ _oprocess.getXsdTypes().put(typeName, type);
}
return type;
}
public OMessageVarType.Part resolvePart(OScope.Variable var, String partname) {
- if (!(var.type instanceof OMessageVarType))
- throw new CompilationException(__cmsgs.errMessageVariableRequired(var.name));
- OMessageVarType msgVarType = (OMessageVarType) var.type;
- OMessageVarType.Part part = msgVarType.parts.get(partname);
+ if (!(var.getType() instanceof OMessageVarType))
+ throw new CompilationException(__cmsgs.errMessageVariableRequired(var.getName()));
+ OMessageVarType msgVarType = (OMessageVarType) var.getType();
+ OMessageVarType.Part part = msgVarType.getParts().get(partname);
if (part == null)
- throw new CompilationException(__cmsgs.errUndeclaredMessagePart(var.name, ((OMessageVarType) var.type).messageType,
+ throw new CompilationException(__cmsgs.errUndeclaredMessagePart(var.getName(), ((OMessageVarType) var.getType()).getMessageType(),
partname));
return part;
}
public OMessageVarType.Part resolveHeaderPart(OScope.Variable var, String partname) {
- if (!(var.type instanceof OMessageVarType))
- throw new CompilationException(__cmsgs.errMessageVariableRequired(var.name));
- OMessageVarType msgVarType = (OMessageVarType) var.type;
- return msgVarType.parts.get(partname);
+ if (!(var.getType() instanceof OMessageVarType))
+ throw new CompilationException(__cmsgs.errMessageVariableRequired(var.getName()));
+ OMessageVarType msgVarType = (OMessageVarType) var.getType();
+ return msgVarType.getParts().get(partname);
}
public PartnerLinkType resolvePartnerLinkType(QName partnerLinkType) {
@@ -478,11 +473,11 @@
@SuppressWarnings("unchecked")
public Operation resolvePartnerRoleOperation(final OPartnerLink partnerLink, final String operationName) {
- if (partnerLink.partnerRolePortType == null) {
+ if (partnerLink.getPartnerRolePortType() == null) {
throw new CompilationException(__cmsgs.errPartnerLinkDoesNotDeclarePartnerRole(partnerLink.getName()));
}
- Operation found = CollectionsX.find_if((List<Operation>) partnerLink.partnerRolePortType.getOperations(),
+ Operation found = CollectionsX.find_if((List<Operation>) partnerLink.getPartnerRolePortType().getOperations(),
new MemberOfFunction<Operation>() {
public boolean isMember(Operation o) {
// Guard against WSDL4j funny business.
@@ -496,17 +491,17 @@
if (found == null)
throw new CompilationException(__cmsgs
- .errUndeclaredOperation(partnerLink.partnerRolePortType.getQName(), operationName));
+ .errUndeclaredOperation(partnerLink.getPartnerRolePortType().getQName(), operationName));
return found;
}
@SuppressWarnings("unchecked")
public Operation resolveMyRoleOperation(final OPartnerLink partnerLink, final String operationName) {
- if (partnerLink.myRolePortType == null) {
+ if (partnerLink.getMyRolePortType() == null) {
throw new CompilationException(__cmsgs.errPartnerLinkDoesNotDeclareMyRole(partnerLink.getName()));
}
- Operation found = CollectionsX.find_if((List<Operation>) partnerLink.myRolePortType.getOperations(),
+ Operation found = CollectionsX.find_if((List<Operation>) partnerLink.getMyRolePortType().getOperations(),
new MemberOfFunction<Operation>() {
public boolean isMember(Operation o) {
// Again, guard against WSDL4J's "help"
@@ -517,7 +512,7 @@
}
});
if (found == null) {
- throw new CompilationException(__cmsgs.errUndeclaredOperation(partnerLink.myRolePortType.getQName(), operationName));
+ throw new CompilationException(__cmsgs.errUndeclaredOperation(partnerLink.getMyRolePortType().getQName(), operationName));
}
return found;
}
@@ -532,8 +527,8 @@
*/
public OExpression constantExpr(boolean value) {
OConstantExpression ce = new OConstantExpression(_oprocess, value ? Boolean.TRUE : Boolean.FALSE);
- ce.debugInfo = createDebugInfo(_processDef, "Constant Boolean Expression: " + value);
- ce.expressionLanguage = _konstExprLang;
+ ce.setDebugInfo(createDebugInfo(_processDef, ("Constant Boolean Expression: " + value)));
+ ce.setExpressionLanguage(_konstExprLang);
return ce;
}
@@ -578,17 +573,17 @@
resultType[0] = ev.validate(expression, rootNodeType, requestedResultType);
}
- oexpr.debugInfo = createDebugInfo(expression, expression.toString());
+ oexpr.setDebugInfo(createDebugInfo(expression, expression.toString()));
OExpressionLanguage expLanguage = _expLanguages.get(expLang);
if (expLanguage == null) {
expLanguage = new OExpressionLanguage(_oprocess, ec.getProperties());
- expLanguage.debugInfo = createDebugInfo(_processDef, "Expression Language: " + expLang);
- expLanguage.expressionLanguageUri = expLang;
+ expLanguage.setDebugInfo(createDebugInfo(_processDef, ("Expression Language: " + expLang)));
+ expLanguage.setExpressionLanguageUri(expLang);
_expLanguages.put(expLang, expLanguage);
- _oprocess.expressionLanguages.add(expLanguage);
+ _oprocess.getExpressionLanguages().add(expLanguage);
}
- oexpr.expressionLanguage = expLanguage;
+ oexpr.setExpressionLanguage(expLanguage);
// Cleaning up expression compiler for furter compilation
ec.setCompilerContext(null);
@@ -673,33 +668,33 @@
}
_oprocess = new OProcess(bpelVersionUri);
- _oprocess.guid = null;
- _oprocess.constants = makeConstants();
- _oprocess.debugInfo = createDebugInfo(process, "process");
- _oprocess.namespaceContext = process.getNamespaceContext();
+ _oprocess.setGuid(null);
+ _oprocess.setConstants(makeConstants());
+ _oprocess.setDebugInfo(createDebugInfo(process, "process"));
+ _oprocess.setNamespaceContext(process.getNamespaceContext());
if (process.getTargetNamespace() == null) {
- _oprocess.targetNamespace = "--UNSPECIFIED--";
+ _oprocess.setTargetNamespace("--UNSPECIFIED--");
recoveredFromError(process, new CompilationException(__cmsgs.errProcessNamespaceNotSpecified()));
} else {
- _oprocess.targetNamespace = _processDef.getTargetNamespace();
+ _oprocess.setTargetNamespace(_processDef.getTargetNamespace());
}
if (process.getName() == null) {
- _oprocess.processName = "--UNSPECIFIED--";
+ _oprocess.setProcessName("--UNSPECIFIED--");
recoveredFromError(process, new CompilationException(__cmsgs.errProcessNameNotSpecified()));
} else {
- _oprocess.processName = _processDef.getName();
+ _oprocess.setProcessName(_processDef.getName());
}
- _oprocess.compileDate = _generatedDate;
+ _oprocess.setCompileDate(_generatedDate);
_konstExprLang = new OExpressionLanguage(_oprocess, null);
- _konstExprLang.debugInfo = createDebugInfo(_processDef, "Constant Value Expression Language");
- _konstExprLang.expressionLanguageUri = "uri:www.fivesight.com/konstExpression";
- _konstExprLang.properties.put("runtime-class",
+ _konstExprLang.setDebugInfo(createDebugInfo(_processDef, "Constant Value Expression Language"));
+ _konstExprLang.setExpressionLanguageUri("uri:www.fivesight.com/konstExpression");
+ _konstExprLang.getProperties().put("runtime-class",
"org.apache.ode.bpel.runtime.explang.konst.KonstExpressionLanguageRuntimeImpl");
- _oprocess.expressionLanguages.add(_konstExprLang);
+ _oprocess.getExpressionLanguages().add(_konstExprLang);
// Process the imports. Note, we expect all processes (Event BPEL 1.1)
// to have an import declaration. This should be automatically generated
@@ -739,31 +734,32 @@
}
OScope procesScope = new OScope(_oprocess, null);
- procesScope.name = "__PROCESS_SCOPE:" + process.getName();
- procesScope.debugInfo = createDebugInfo(process, null);
- _oprocess.procesScope = compileScope(procesScope, process, new Runnable() {
- public void run() {
- if (process.getRootActivity() == null) {
- throw new CompilationException(__cmsgs.errNoRootActivity());
- }
- // Process custom properties are created as variables associated
- // with the top scope
- if (_customProcessProperties != null) {
- for (Map.Entry<QName, Node> customVar : _customProcessProperties.entrySet()) {
- final OScope oscope = _structureStack.topScope();
- OVarType varType = new OConstantVarType(_oprocess, customVar.getValue());
- OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
- ovar.name = customVar.getKey().getLocalPart();
- ovar.declaringScope = oscope;
- ovar.debugInfo = createDebugInfo(null, "Process custom property variable");
- oscope.addLocalVariable(ovar);
- if (__log.isDebugEnabled())
- __log.debug("Compiled custom property variable " + ovar);
- }
- }
- _structureStack.topScope().activity = compile(process.getRootActivity());
- }
- });
+ procesScope.setName("__PROCESS_SCOPE:" + (process.getName()));
+ procesScope.setDebugInfo(createDebugInfo(process, null));
+ _oprocess.setProcesScope(compileScope(procesScope, process, new java.lang.Runnable() {
+ public void run() {
+ if (process.getRootActivity() == null) {
+ throw new CompilationException(__cmsgs.errNoRootActivity());
+ }
+ // Process custom properties are created as variables associated
+ // with the top scope
+ if (_customProcessProperties != null) {
+ for (Map.Entry<QName, Node> customVar : _customProcessProperties.entrySet()) {
+ final OScope oscope = _structureStack.topScope();
+ OVarType varType = new OConstantVarType(_oprocess, customVar.getValue());
+ OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
+ ovar.setName(customVar.getKey().getLocalPart());
+ ovar.setDeclaringScope(oscope);
+ ovar.setDebugInfo(createDebugInfo(null, "Process custom property variable"));
+ oscope.addLocalVariable(ovar);
+ if (__log.isDebugEnabled())
+ __log.debug("Compiled custom property variable " + ovar);
+ }
+ }
+ _structureStack.topScope().setActivity(compile(process.getRootActivity()));
+ }
+ }));
+
assert _structureStack.size() == 0;
@@ -788,9 +784,9 @@
{
String digest = "version:" + version + ";" + _oprocess.digest();
- _oprocess.guid = GUID.makeGUID(digest);
+ _oprocess.setGuid(org.apache.ode.utils.GUID.makeGUID(digest));
if (__log.isDebugEnabled()) {
- __log.debug("Compiled process digest: " + digest + "\nguid: " + _oprocess.guid);
+ __log.debug("Compiled process digest: " + digest + "\nguid: " + _oprocess.getGuid());
}
}
return _oprocess;
@@ -798,28 +794,28 @@
private OConstants makeConstants() {
OConstants constants = new OConstants(_oprocess);
- constants.qnConflictingReceive = new QName(getBpwsNamespace(), "conflictingReceive");
- constants.qnConflictingRequest = new QName(getBpwsNamespace(), "conflictingRequest");
- constants.qnCorrelationViolation = new QName(getBpwsNamespace(), "correlationViolation");
- constants.qnForcedTermination = new QName(getBpwsNamespace(), "forcedTermination");
- constants.qnJoinFailure = new QName(getBpwsNamespace(), "joinFailure");
- constants.qnMismatchedAssignmentFailure = new QName(getBpwsNamespace(), "mismatchedAssignment");
- constants.qnMissingReply = new QName(getBpwsNamespace(), "missingReply");
- constants.qnMissingRequest = new QName(getBpwsNamespace(), "missingRequest");
- constants.qnSelectionFailure = new QName(getBpwsNamespace(), "selectionFailure");
- constants.qnUninitializedVariable = new QName(getBpwsNamespace(), "uninitializedVariable");
- constants.qnXsltInvalidSource = new QName(getBpwsNamespace(), "xsltInvalidSource");
- constants.qnSubLanguageExecutionFault = new QName(getBpwsNamespace(), "subLanguageExecutionFault");
- constants.qnUninitializedPartnerRole = new QName(getBpwsNamespace(), "uninitializedPartnerRole");
- constants.qnForEachCounterError = new QName(getBpwsNamespace(), "forEachCounterError");
- constants.qnInvalidBranchCondition = new QName(getBpwsNamespace(), "invalidBranchCondition");
- constants.qnInvalidExpressionValue = new QName(getBpwsNamespace(), "invalidExpressionValue");
+ constants.setQnConflictingReceive(new javax.xml.namespace.QName(getBpwsNamespace() , "conflictingReceive"));
+ constants.setQnConflictingRequest(new javax.xml.namespace.QName(getBpwsNamespace() , "conflictingRequest"));
+ constants.setQnCorrelationViolation(new javax.xml.namespace.QName(getBpwsNamespace() , "correlationViolation"));
+ constants.setQnForcedTermination(new javax.xml.namespace.QName(getBpwsNamespace() , "forcedTermination"));
+ constants.setQnJoinFailure(new javax.xml.namespace.QName(getBpwsNamespace() , "joinFailure"));
+ constants.setQnMismatchedAssignmentFailure(new javax.xml.namespace.QName(getBpwsNamespace() , "mismatchedAssignment"));
+ constants.setQnMissingReply(new javax.xml.namespace.QName(getBpwsNamespace() , "missingReply"));
+ constants.setQnMissingRequest(new javax.xml.namespace.QName(getBpwsNamespace() , "missingRequest"));
+ constants.setQnSelectionFailure(new javax.xml.namespace.QName(getBpwsNamespace() , "selectionFailure"));
+ constants.setQnUninitializedVariable(new javax.xml.namespace.QName(getBpwsNamespace() , "uninitializedVariable"));
+ constants.setQnXsltInvalidSource(new javax.xml.namespace.QName(getBpwsNamespace() , "xsltInvalidSource"));
+ constants.setQnSubLanguageExecutionFault(new javax.xml.namespace.QName(getBpwsNamespace() , "subLanguageExecutionFault"));
+ constants.setQnUninitializedPartnerRole(new javax.xml.namespace.QName(getBpwsNamespace() , "uninitializedPartnerRole"));
+ constants.setQnForEachCounterError(new javax.xml.namespace.QName(getBpwsNamespace() , "forEachCounterError"));
+ constants.setQnInvalidBranchCondition(new javax.xml.namespace.QName(getBpwsNamespace() , "invalidBranchCondition"));
+ constants.setQnInvalidExpressionValue(new javax.xml.namespace.QName(getBpwsNamespace() , "invalidExpressionValue"));
- constants.qnRetiredProcess = new QName(getOdeNamespace(), "retiredProcess");
- constants.qnTooManyInstances = new QName(getOdeNamespace(), "tooManyInstances");
- constants.qnUnknownFault = new QName(getOdeNamespace(), "unknownFault");
- constants.qnTooManyProcesses = new QName(getOdeNamespace(), "tooManyProcesses");
- constants.qnTooHugeProcesses = new QName(getOdeNamespace(), "tooHugeProcesses");
+ constants.setQnRetiredProcess(new javax.xml.namespace.QName(getOdeNamespace() , "retiredProcess"));
+ constants.setQnTooManyInstances(new javax.xml.namespace.QName(getOdeNamespace() , "tooManyInstances"));
+ constants.setQnUnknownFault(new javax.xml.namespace.QName(getOdeNamespace() , "unknownFault"));
+ constants.setQnTooManyProcesses(new javax.xml.namespace.QName(getOdeNamespace() , "tooManyProcesses"));
+ constants.setQnTooHugeProcesses(new javax.xml.namespace.QName(getOdeNamespace() , "tooHugeProcesses"));
return constants;
}
@@ -909,7 +905,7 @@
try {
compiled = (source instanceof ScopeLikeActivity) ? compileSLC((ScopeLikeActivity) source, new OScope.Variable[0])
: compileActivity(true, source);
- compiled.suppressJoinFailure = _supressJoinFailure;
+ compiled.setSuppressJoinFailure(_supressJoinFailure);
} finally {
_supressJoinFailure = previousSupressJoinFailure;
}
@@ -921,30 +917,30 @@
private OCompensate createDefaultCompensateActivity(BpelObject source, String desc) {
OCompensate activity = new OCompensate(_oprocess, getCurrent());
- activity.name = "__autoGenCompensate:" + _structureStack.topScope().name;
- activity.debugInfo = createDebugInfo(source, desc);
+ activity.setName("__autoGenCompensate:" + (_structureStack.topScope().getName()));
+ activity.setDebugInfo(createDebugInfo(source, desc));
return activity;
}
public OScope compileSLC(final ScopeLikeActivity source, final OScope.Variable[] variables) {
final OScope implicitScope = new OScope(_oprocess, getCurrent());
- implicitScope.implicitScope = true;
- implicitScope.name = createName(source, "implicit-scope");
- implicitScope.debugInfo = createDebugInfo(source, "Scope-like construct " + source);
+ implicitScope.setImplicitScope(true);
+ implicitScope.setName(createName(source, "implicit-scope"));
+ implicitScope.setDebugInfo(createDebugInfo(source, ("Scope-like construct " + source)));
compileScope(implicitScope, source.getScope(), new Runnable() {
public void run() {
compileLinks(source);
for (OScope.Variable v : variables) {
- v.declaringScope = implicitScope;
+ v.setDeclaringScope(implicitScope);
implicitScope.addLocalVariable(v);
}
if (source instanceof ScopeActivity) {
Activity scopeChild = ((ScopeActivity) source).getChildActivity();
if (scopeChild == null)
throw new CompilationException(__cmsgs.errEmptyScope().setSource(source));
- implicitScope.activity = compile(scopeChild);
+ implicitScope.setActivity(compile(scopeChild));
} else {
- implicitScope.activity = compileActivity(false, source);
+ implicitScope.setActivity(compileActivity(false, source));
}
}
});
@@ -955,8 +951,8 @@
private OActivity compileActivity(final boolean doLinks, final Activity source) {
final ActivityGenerator actgen = findActivityGen(source);
final OActivity oact = actgen.newInstance(source);
- oact.name = createName(source, "activity");
- oact.debugInfo = createDebugInfo(source, "Activity body for " + source);
+ oact.setName(createName(source, "activity"));
+ oact.setDebugInfo(createDebugInfo(source, ("Activity body for " + source)));
_compiledActivities.add(oact);
compile(oact, source, new Runnable() {
public void run() {
@@ -978,8 +974,7 @@
for (LinkTarget lt : source.getLinkTargets())
compileLinkTarget(lt);
- _structureStack.topActivity().joinCondition = (source.getJoinCondition() == null || source.getLinkTargets().isEmpty()) ? null
- : compileJoinCondition(source.getJoinCondition());
+ _structureStack.topActivity().setJoinCondition(((source.getJoinCondition()) == null) || (source.getLinkTargets().isEmpty()) ? null : compileJoinCondition(source.getJoinCondition()));
}
private String createName(Activity source, String type) {
@@ -991,14 +986,14 @@
private OProcess.OProperty compile(Property property) {
OProcess.OProperty oproperty = new OProcess.OProperty(_oprocess);
- oproperty.name = property.getName();
- oproperty.debugInfo = createDebugInfo(_processDef, "Property " + property.getName());
+ oproperty.setName(property.getName());
+ oproperty.setDebugInfo(createDebugInfo(_processDef, ("Property " + (property.getName()))));
if (!_wsdlRegistry.getSchemaModel().isSimpleType(property.getPropertyType()))
throw new CompilationException(__cmsgs.errPropertyDeclaredWithComplexType(property.getName(),
property.getPropertyType()).setSource(property));
- _oprocess.properties.add(oproperty);
+ _oprocess.getProperties().add(oproperty);
if (__log.isDebugEnabled())
__log.debug("Compiled property " + oproperty);
@@ -1010,77 +1005,76 @@
OProcess.OProperty property = resolveProperty(src.getPropertyName());
OProcess.OPropertyAlias alias = new OProcess.OPropertyAlias(_oprocess);
- alias.debugInfo = createDebugInfo(_processDef, "PropertyAlias " + src.getPropertyName() + " for " + src.getMessageType());
+ alias.setDebugInfo(createDebugInfo(_processDef, ((("PropertyAlias " + (src.getPropertyName())) + " for ") + (src.getMessageType()))));
if (src.getMessageType() == null) {
throw new CompilationException(__cmsgs.errAliasUndeclaredMessage(src.getPropertyName(), src.getQuery().getPath()));
}
OMessageVarType messageType = resolveMessageType(src.getMessageType());
OVarType rootNodeType = messageType;
- alias.varType = messageType;
+ alias.setVarType(messageType);
// bpel 2.0 excludes declaration of part;
// bpel 1.1 requires it
if (src.getPart() != null) {
- alias.part = messageType.parts.get(src.getPart());
- if (alias.part == null)
+ alias.setPart(messageType.getParts().get(src.getPart()));
+ if (alias.getPart() == null)
throw new CompilationException(__cmsgs.errUnknownPartInAlias(src.getPart(),
- messageType.messageType.toString()));
- rootNodeType = alias.part.type;
+ messageType.getMessageType().toString()));
+ rootNodeType = alias.getPart().getType();
} else if (src.getHeader() != null) {
- alias.header = src.getHeader();
+ alias.setHeader(src.getHeader());
rootNodeType = new OElementVarType(_oprocess, QName.valueOf("{http://www.w3.org/2001/XMLSchema}any"));
}
if (src.getQuery() != null)
- alias.location = compileExpr(src.getQuery(), rootNodeType, null, new Object[1]);
- property.aliases.add(alias);
- alias.debugInfo = createDebugInfo(_processDef, src.getMessageType() + " --> " + src.getPropertyName());
+ alias.setLocation(compileExpr(src.getQuery(), rootNodeType, null, new java.lang.Object[1]));
+ property.getAliases().add(alias);
+ alias.setDebugInfo(createDebugInfo(_processDef, (((src.getMessageType()) + " --> ") + (src.getPropertyName()))));
return alias;
}
private void compileLinkTarget(LinkTarget target) {
OLink ol = resolveLink(target.getLinkName());
assert ol != null;
- ol.debugInfo = createDebugInfo(target, target.toString());
- if (ol.target != null)
+ ol.setDebugInfo(createDebugInfo(target, target.toString()));
+ if (ol.getTarget() != null)
throw new CompilationException(__cmsgs.errDuplicateLinkTarget(target.getLinkName()).setSource(target));
- ol.target = _structureStack.topActivity();
+ ol.setTarget(_structureStack.topActivity());
- _structureStack.topActivity().targetLinks.add(ol);
+ _structureStack.topActivity().getTargetLinks().add(ol);
}
private void compileLinkSource(LinkSource linksrc) {
OLink ol = resolveLink(linksrc.getLinkName());
assert ol != null;
- ol.debugInfo = createDebugInfo(linksrc, linksrc.toString());
- if (ol.source != null)
+ ol.setDebugInfo(createDebugInfo(linksrc, linksrc.toString()));
+ if (ol.getSource() != null)
throw new CompilationException(__cmsgs.errDuplicateLinkSource(linksrc.getLinkName()).setSource(linksrc));
- ol.source = _structureStack.topActivity();
- ol.transitionCondition = linksrc.getTransitionCondition() == null ? constantExpr(true) : compileExpr(linksrc
- .getTransitionCondition());
+ ol.setSource(_structureStack.topActivity());
+ ol.setTransitionCondition((linksrc.getTransitionCondition()) == null ? constantExpr(true) : compileExpr(linksrc.getTransitionCondition()));
- _structureStack.topActivity().sourceLinks.add(ol);
- _structureStack.topActivity().outgoingLinks.add(ol);
+ _structureStack.topActivity().getSourceLinks().add(ol);
+ _structureStack.topActivity().getOutgoingLinks().add(ol);
}
private void compile(final PartnerLink plink) {
OPartnerLink oplink = new OPartnerLink(_oprocess);
- oplink.debugInfo = createDebugInfo(plink, plink.toString());
+ oplink.setDebugInfo(createDebugInfo(plink, plink.toString()));
try {
PartnerLinkType plinkType = resolvePartnerLinkType(plink.getPartnerLinkType());
- oplink.partnerLinkType = plinkType.getName();
- oplink.name = plink.getName();
- oplink.initializePartnerRole = plink.isInitializePartnerRole();
+ oplink.setPartnerLinkType(plinkType.getName());
+ oplink.setName(plink.getName());
+ oplink.setInitializePartnerRole(plink.isInitializePartnerRole());
if (plink.hasMyRole()) {
PartnerLinkType.Role myRole = plinkType.getRole(plink.getMyRole());
if (myRole == null)
throw new CompilationException(__cmsgs.errUndeclaredRole(plink.getMyRole(), plinkType.getName()));
- oplink.myRoleName = myRole.getName();
+ oplink.setMyRoleName(myRole.getName());
QName portType = myRole.getPortType();
if (portType == null)
throw new CompilationException(__cmsgs.errMissingMyRolePortType(myRole.getPortType(), plink.getMyRole(), plinkType.getName()));
- oplink.myRolePortType = resolvePortType(portType);
+ oplink.setMyRolePortType(resolvePortType(portType));
}
if (plink.isInitializePartnerRole() && !plink.hasPartnerRole()) {
@@ -1090,18 +1084,18 @@
PartnerLinkType.Role partnerRole = plinkType.getRole(plink.getPartnerRole());
if (partnerRole == null)
throw new CompilationException(__cmsgs.errUndeclaredRole(plink.getPartnerRole(), plinkType.getName()));
- oplink.partnerRoleName = partnerRole.getName();
+ oplink.setPartnerRoleName(partnerRole.getName());
QName portType = partnerRole.getPortType();
if (portType == null)
throw new CompilationException(__cmsgs.errMissingPartnerRolePortType(partnerRole.getPortType(), plink.getPartnerRole(), plinkType.getName()));
- oplink.partnerRolePortType = resolvePortType(portType);
+ oplink.setPartnerRolePortType(resolvePortType(portType));
}
- oplink.declaringScope = _structureStack.topScope();
- if (oplink.declaringScope.partnerLinks.containsKey(oplink.name))
- throw new CompilationException(__cmsgs.errDuplicatePartnerLinkDecl(oplink.name));
- oplink.declaringScope.partnerLinks.put(oplink.name, oplink);
- _oprocess.allPartnerLinks.add(oplink);
+ oplink.setDeclaringScope(_structureStack.topScope());
+ if (oplink.getDeclaringScope().getPartnerLinks().containsKey(oplink.getName()))
+ throw new CompilationException(__cmsgs.errDuplicatePartnerLinkDecl(oplink.getName()));
+ oplink.getDeclaringScope().getPartnerLinks().put(oplink.getName(), oplink);
+ _oprocess.getAllPartnerLinks().add(oplink);
} catch (CompilationException ce) {
ce.getCompilationMessage().setSource(plink);
throw ce;
@@ -1111,12 +1105,12 @@
private void compile(CorrelationSet cset) {
OScope oscope = _structureStack.topScope();
OScope.CorrelationSet ocset = new OScope.CorrelationSet(_oprocess);
- ocset.name = cset.getName();
- ocset.declaringScope = oscope;
- ocset.debugInfo = createDebugInfo(cset, cset.toString());
+ ocset.setName(cset.getName());
+ ocset.setDeclaringScope(oscope);
+ ocset.setDebugInfo(createDebugInfo(cset, cset.toString()));
QName[] setprops = cset.getProperties();
for (int j = 0; j < setprops.length; ++j)
- ocset.properties.add(resolveProperty(setprops[j]));
+ ocset.getProperties().add(resolveProperty(setprops[j]));
oscope.addCorrelationSet(ocset);
}
@@ -1136,36 +1130,37 @@
OScope topScope = _structureStack.topScope();
if (newtop != null) {
- newtop.nested.add(popped);
+ newtop.getNested().add(popped);
// Transfer outgoing and incoming links, excluding the locally defined links.
- newtop.incomingLinks.addAll(popped.incomingLinks);
- if (newtop instanceof OFlow) newtop.incomingLinks.removeAll(((OFlow) newtop).localLinks);
- newtop.outgoingLinks.addAll(popped.outgoingLinks);
+ newtop.getIncomingLinks().addAll(popped.getIncomingLinks());
+ if (newtop instanceof OFlow) newtop.getIncomingLinks().removeAll(((OFlow) newtop).getLocalLinks());
+ newtop.getOutgoingLinks().addAll(popped.getOutgoingLinks());
- if (newtop instanceof OFlow) newtop.outgoingLinks.removeAll(((OFlow) newtop).localLinks);
+ if (newtop instanceof OFlow) newtop.getOutgoingLinks().removeAll(((OFlow) newtop).getLocalLinks());
// Transfer variables read/writen
- newtop.variableRd.addAll(popped.variableRd);
- newtop.variableWr.addAll(popped.variableWr);
+ newtop.getVariableRd().addAll(popped.getVariableRd());
+ newtop.getVariableWr().addAll(popped.getVariableWr());
}
- if (topScope != null && popped instanceof OScope) topScope.compensatable.add((OScope) popped);
+ if (topScope != null && popped instanceof OScope) topScope.getCompensatable().add((OScope) popped);
}
}
private OScope compileScope(final OScope oscope, final Scope src, final Runnable init) {
- if (oscope.name == null)
+ if (oscope.getName() == null)
throw new IllegalArgumentException("Unnamed scope:" + src);
- oscope.debugInfo = createDebugInfo(src, src.toString());
+ oscope.setDebugInfo(createDebugInfo(src, src.toString()));
+ //TODO: Is the logic incorrect?
boolean previousAtomicScope = _atomicScope;
if (src.getAtomicScope() != null) {
boolean newValue = src.getAtomicScope().booleanValue();
if (_atomicScope)
throw new CompilationException(__cmsgs.errAtomicScopeNesting(newValue));
- oscope.atomicScope = _atomicScope = newValue;
+ oscope.setAtomicScope(_atomicScope = newValue);
}
if (src.getIsolatedScope() != null) {
@@ -1173,7 +1168,7 @@
if (_isolatedScope)
throw new CompilationException(__cmsgs.errIsolatedScopeNesting());
- oscope.isolatedScope = _isolatedScope = true;
+ oscope.setIsolatedScope(_isolatedScope = true);
}
}
@@ -1205,8 +1200,8 @@
}
if (!src.getEvents().isEmpty() || !src.getAlarms().isEmpty()) {
- oscope.eventHandler = new OEventHandler(_oprocess);
- oscope.eventHandler.debugInfo = createDebugInfo(src, "Event Handler for " + src);
+ oscope.setEventHandler(new org.apache.ode.bpel.obj.OEventHandler(_oprocess));
+ oscope.getEventHandler().setDebugInfo(createDebugInfo(src, ("Event Handler for " + src)));
}
for (OnEvent onEvent : src.getEvents()) {
@@ -1261,15 +1256,15 @@
private void compile(final OnAlarm onAlarm) {
OScope oscope = _structureStack.topScope();
- assert oscope.eventHandler != null;
+ assert oscope.getEventHandler() != null;
final OEventHandler.OAlarm oalarm = new OEventHandler.OAlarm(_oprocess);
- oalarm.debugInfo = createDebugInfo(onAlarm, "OnAlarm Event Handler: " + onAlarm);
+ oalarm.setDebugInfo(createDebugInfo(onAlarm, ("OnAlarm Event Handler: " + onAlarm)));
if (onAlarm.getFor() != null && onAlarm.getUntil() == null) {
- oalarm.forExpr = compileExpr(onAlarm.getFor());
+ oalarm.setForExpr(compileExpr(onAlarm.getFor()));
} else if (onAlarm.getFor() == null && onAlarm.getUntil() != null) {
- oalarm.untilExpr = compileExpr(onAlarm.getUntil());
+ oalarm.setUntilExpr(compileExpr(onAlarm.getUntil()));
} else if (onAlarm.getFor() != null && onAlarm.getUntil() != null) {
throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm));
} else if (onAlarm.getRepeatEvery() == null) {
@@ -1277,41 +1272,41 @@
}
if (onAlarm.getRepeatEvery() != null)
- oalarm.repeatExpr = compileExpr(onAlarm.getRepeatEvery());
+ oalarm.setRepeatExpr(compileExpr(onAlarm.getRepeatEvery()));
if (onAlarm.getActivity() == null) throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onAlarm));
- oalarm.activity = compile(onAlarm.getActivity());
+ oalarm.setActivity(compile(onAlarm.getActivity()));
// Check links crossing restrictions.
- for (OLink link : oalarm.incomingLinks)
+ for (OLink link : oalarm.getIncomingLinks())
try {
- throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm));
+ throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.getName()).setSource(onAlarm));
} catch (CompilationException ce) {
recoveredFromError(onAlarm, ce);
}
- for (OLink link : oalarm.outgoingLinks)
+ for (OLink link : oalarm.getOutgoingLinks())
try {
- throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name).setSource(onAlarm));
+ throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.getName()).setSource(onAlarm));
} catch (CompilationException ce) {
recoveredFromError(onAlarm, ce);
}
- oscope.eventHandler.onAlarms.add(oalarm);
+ oscope.getEventHandler().getOnAlarms().add(oalarm);
}
private void compile(final OnEvent onEvent) {
final OScope oscope = _structureStack.topScope();
- assert oscope.eventHandler != null;
+ assert oscope.getEventHandler() != null;
final OEventHandler.OEvent oevent = new OEventHandler.OEvent(_oprocess, oscope);
- oevent.name = "__eventHandler:";
- oevent.debugInfo = createDebugInfo(onEvent, null);
+ oevent.setName("__eventHandler:");
+ oevent.setDebugInfo(createDebugInfo(onEvent, null));
compile(oevent, onEvent, new Runnable() {
public void run() {
switch (_processDef.getBpelVersion()) {
case BPEL11:
- oevent.variable = resolveMessageVariable(onEvent.getVariable());
+ oevent.setVariable(resolveMessageVariable(onEvent.getVariable()));
break;
case BPEL20_DRAFT:
case BPEL20:
@@ -1328,24 +1323,24 @@
else
throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(onEvent.getVariable()));
- oevent.variable = new OScope.Variable(_oprocess, varType);
- oevent.variable.name = onEvent.getVariable();
- oevent.variable.declaringScope = _structureStack.topScope();
+ oevent.setVariable(new org.apache.ode.bpel.obj.OScope.Variable(_oprocess , varType));
+ oevent.getVariable().setName(onEvent.getVariable());
+ oevent.getVariable().setDeclaringScope(_structureStack.topScope());
- oevent.addLocalVariable(oevent.variable);
+ oevent.addLocalVariable(oevent.getVariable());
break;
default:
throw new AssertionError("Unexpected BPEL VERSION constatnt: " + _processDef.getBpelVersion());
}
- oevent.partnerLink = resolvePartnerLink(onEvent.getPartnerLink());
- oevent.operation = resolveMyRoleOperation(oevent.partnerLink, onEvent.getOperation());
- oevent.messageExchangeId = onEvent.getMessageExchangeId();
- oevent.route = onEvent.getRoute();
+ oevent.setPartnerLink(resolvePartnerLink(onEvent.getPartnerLink()));
+ oevent.setOperation(resolveMyRoleOperation(oevent.getPartnerLink(), onEvent.getOperation()));
+ oevent.setMessageExchangeId(onEvent.getMessageExchangeId());
+ oevent.setRoute(onEvent.getRoute());
- if (onEvent.getPortType() != null && !onEvent.getPortType().equals(oevent.partnerLink.myRolePortType.getQName()))
+ if (onEvent.getPortType() != null && !onEvent.getPortType().equals(oevent.getPartnerLink().getMyRolePortType().getQName()))
throw new CompilationException(__cmsgs.errPortTypeMismatch(onEvent.getPortType(),
- oevent.partnerLink.myRolePortType.getQName()));
+ oevent.getPartnerLink().getMyRolePortType().getQName()));
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
for (Correlation correlation : onEvent.getCorrelations()) {
@@ -1359,48 +1354,48 @@
switch (correlation.getInitiate()) {
case UNSET:
case NO:
- oevent.matchCorrelations.add(cset);
- oevent.partnerLink.addCorrelationSetForOperation(oevent.operation, cset, false);
+ oevent.getMatchCorrelations().add(cset);
+ oevent.getPartnerLink().addCorrelationSetForOperation(oevent.getOperation(), cset, false);
break;
case YES:
- oevent.initCorrelations.add(cset);
+ oevent.getInitCorrelations().add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
- oevent.joinCorrelations.add(cset);
- oevent.partnerLink.addCorrelationSetForOperation(oevent.operation, cset, true);
+ cset.setHasJoinUseCases(true);
+ oevent.getJoinCorrelations().add(cset);
+ oevent.getPartnerLink().addCorrelationSetForOperation(oevent.getOperation(), cset, true);
}
- for (OProcess.OProperty property : cset.properties) {
+ for (OProcess.OProperty property : cset.getProperties()) {
// Force resolution of alias, to make sure that we have
// one for this variable-property pair.
- resolvePropertyAlias(oevent.variable, property.name);
+ resolvePropertyAlias(oevent.getVariable(), property.getName());
}
csetNames.add(correlation.getCorrelationSet());
}
if (onEvent.getActivity() == null) throw new CompilationException(__cmsgs.errInvalidAlarm().setSource(onEvent));
- oevent.activity = compile(onEvent.getActivity());
+ oevent.setActivity(compile(onEvent.getActivity()));
}
});
// Check links crossing restrictions.
- for (OLink link : oevent.incomingLinks)
+ for (OLink link : oevent.getIncomingLinks())
try {
- throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name));
+ throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.getName()));
} catch (CompilationException ce) {
recoveredFromError(onEvent, ce);
}
- for (OLink link : oevent.outgoingLinks)
+ for (OLink link : oevent.getOutgoingLinks())
try {
- throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.name));
+ throw new CompilationException(__cmsgs.errLinkCrossesEventHandlerBoundary(link.getName()));
} catch (CompilationException ce) {
recoveredFromError(onEvent, ce);
}
- oscope.eventHandler.onMessages.add(oevent);
+ oscope.getEventHandler().getOnMessages().add(oevent);
}
private DebugInfo createDebugInfo(BpelObject bpelObject, String description) {
@@ -1408,7 +1403,7 @@
String str = description == null && bpelObject != null ? bpelObject.toString() : null;
Map<QName, Object> extElmt = bpelObject == null ? null : bpelObject.getExtensibilityElements();
DebugInfo debugInfo = new DebugInfo(_processDef.getSource(), lineNo, extElmt);
- debugInfo.description = str;
+ debugInfo.setDescription(str);
return debugInfo;
}
@@ -1438,11 +1433,11 @@
}
OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
- ovar.name = src.getName();
- ovar.declaringScope = oscope;
- ovar.debugInfo = createDebugInfo(src, null);
+ ovar.setName(src.getName());
+ ovar.setDeclaringScope(oscope);
+ ovar.setDebugInfo(createDebugInfo(src, null));
- ovar.extVar = compileExtVar(src);
+ ovar.setExtVar(compileExtVar(src));
oscope.addLocalVariable(ovar);
@@ -1453,16 +1448,15 @@
private void compile(TerminationHandler terminationHandler) {
OScope oscope = _structureStack.topScope();
- oscope.terminationHandler = new OTerminationHandler(_oprocess, oscope);
- oscope.terminationHandler.name = "__terminationHandler:" + oscope.name;
- oscope.terminationHandler.debugInfo = createDebugInfo(terminationHandler, null);
+ oscope.setTerminationHandler(new org.apache.ode.bpel.obj.OTerminationHandler(_oprocess , oscope));
+ oscope.getTerminationHandler().setName("__terminationHandler:" + (oscope.getName()));
+ oscope.getTerminationHandler().setDebugInfo(createDebugInfo(terminationHandler, null));
if (terminationHandler == null) {
- oscope.terminationHandler.activity = createDefaultCompensateActivity(null,
- "Auto-generated 'compensate all' pseudo-activity for default termination handler on " + oscope.toString());
+ oscope.getTerminationHandler().setActivity(createDefaultCompensateActivity(null, ("Auto-generated \'compensate all\' pseudo-activity for default termination handler on " + (oscope.toString()))));
} else {
_recoveryContextStack.push(oscope);
try {
- oscope.terminationHandler.activity = compile(terminationHandler.getActivity());
+ oscope.getTerminationHandler().setActivity(compile(terminationHandler.getActivity()));
} finally {
_recoveryContextStack.pop();
}
@@ -1471,16 +1465,15 @@
private void compile(CompensationHandler compensationHandler) {
OScope oscope = _structureStack.topScope();
- oscope.compensationHandler = new OCompensationHandler(_oprocess, oscope);
- oscope.compensationHandler.name = "__compenationHandler_" + oscope.name;
- oscope.compensationHandler.debugInfo = createDebugInfo(compensationHandler, null);
+ oscope.setCompensationHandler(new org.apache.ode.bpel.obj.OCompensationHandler(_oprocess , oscope));
+ oscope.getCompensationHandler().setName("__compenationHandler_" + (oscope.getName()));
+ oscope.getCompensationHandler().setDebugInfo(createDebugInfo(compensationHandler, null));
if (compensationHandler == null) {
- oscope.compensationHandler.activity = createDefaultCompensateActivity(compensationHandler,
- "Auto-generated 'compensate all' pseudo-activity for default compensation handler on " + oscope.toString());
+ oscope.getCompensationHandler().setActivity(createDefaultCompensateActivity(compensationHandler, ("Auto-generated \'compensate all\' pseudo-activity for default compensation handler on " + (oscope.toString()))));
} else {
_recoveryContextStack.push(oscope);
try {
- oscope.compensationHandler.activity = compile(compensationHandler.getActivity());
+ oscope.getCompensationHandler().setActivity(compile(compensationHandler.getActivity()));
} finally {
_recoveryContextStack.pop();
}
@@ -1489,25 +1482,25 @@
private void compile(FaultHandler fh) {
OScope oscope = _structureStack.topScope();
- oscope.faultHandler = new OFaultHandler(_oprocess);
+ oscope.setFaultHandler(new org.apache.ode.bpel.obj.OFaultHandler(_oprocess));
if (fh == null) {
// The default fault handler compensates all child activities
// AND then rethrows the fault!
final OCatch defaultCatch = new OCatch(_oprocess, oscope);
- defaultCatch.name = "__defaultFaultHandler:" + oscope.name;
- defaultCatch.faultName = null; // catch any fault
- defaultCatch.faultVariable = null;
+ defaultCatch.setName("__defaultFaultHandler:" + (oscope.getName()));
+ defaultCatch.setFaultName(null); // catch any fault
+ defaultCatch.setFaultVariable(null);
OSequence sequence = new OSequence(_oprocess, defaultCatch);
- sequence.name = "__defaultFaultHandler_sequence:" + oscope.name;
- sequence.debugInfo = createDebugInfo(fh, "Auto-generated sequence activity.");
+ sequence.setName("__defaultFaultHandler_sequence:" + (oscope.getName()));
+ sequence.setDebugInfo(createDebugInfo(fh, "Auto-generated sequence activity."));
ORethrow rethrow = new ORethrow(_oprocess, sequence);
- rethrow.name = "__defaultFaultHandler_rethrow:" + oscope.name;
- rethrow.debugInfo = createDebugInfo(fh, "Auto-generated re-throw activity.");
- sequence.sequence.add(createDefaultCompensateActivity(fh, "Default compensation handler for " + oscope));
- sequence.sequence.add(rethrow);
+ rethrow.setName("__defaultFaultHandler_rethrow:" + (oscope.getName()));
+ rethrow.setDebugInfo(createDebugInfo(fh, "Auto-generated re-throw activity."));
+ sequence.getSequence().add(createDefaultCompensateActivity(fh, "Default compensation handler for " + oscope));
+ sequence.getSequence().add(rethrow);
- defaultCatch.activity = sequence;
- oscope.faultHandler.catchBlocks.add(defaultCatch);
+ defaultCatch.setActivity(sequence);
+ oscope.getFaultHandler().getCatchBlocks().add(defaultCatch);
if (__log.isDebugEnabled())
__log.debug("Compiled default catch block " + defaultCatch + " for " + oscope);
@@ -1518,9 +1511,9 @@
int i = 0;
for (final Catch catchSrc : fh.getCatches()) {
final OCatch ctch = new OCatch(_oprocess, oscope);
- ctch.debugInfo = createDebugInfo(catchSrc, catchSrc.toString());
- ctch.name = "__catch#" + i + ":" + _structureStack.topScope().name;
- ctch.faultName = catchSrc.getFaultName();
+ ctch.setDebugInfo(createDebugInfo(catchSrc, catchSrc.toString()));
+ ctch.setName((("__catch#" + i) + ":") + (_structureStack.topScope().getName()));
+ ctch.setFaultName(catchSrc.getFaultName());
compile(ctch, catchSrc, new Runnable() {
public void run() {
@@ -1529,7 +1522,7 @@
switch (_processDef.getBpelVersion()) {
case BPEL11:
faultVar = resolveVariable(catchSrc.getFaultVariable());
- if (!(faultVar.type instanceof OMessageVarType))
+ if (!(faultVar.getType() instanceof OMessageVarType))
throw new CompilationException(__cmsgs.errMessageVariableRequired(
catchSrc.getFaultVariable()).setSource(catchSrc));
break;
@@ -1554,8 +1547,8 @@
.getFaultVariable()));
faultVar = new OScope.Variable(_oprocess, faultVarType);
- faultVar.name = catchSrc.getFaultVariable();
- faultVar.declaringScope = _structureStack.topScope();
+ faultVar.setName(catchSrc.getFaultVariable());
+ faultVar.setDeclaringScope(_structureStack.topScope());
ctch.addLocalVariable(faultVar);
break;
@@ -1563,15 +1556,15 @@
throw new AssertionError("Unexpected BPEL VERSION constatnt: " + _processDef.getBpelVersion());
}
- ctch.faultVariable = faultVar;
+ ctch.setFaultVariable(faultVar);
}
if (catchSrc.getActivity() == null)
throw new CompilationException(__cmsgs.errEmptyCatch().setSource(catchSrc));
- _structureStack.topScope().activity = compile(catchSrc.getActivity());
+ _structureStack.topScope().setActivity(compile(catchSrc.getActivity()));
}
});
- oscope.faultHandler.catchBlocks.add(ctch);
+ oscope.getFaultHandler().getCatchBlocks().add(ctch);
++i;
}
} finally {
@@ -1595,10 +1588,10 @@
}
OXslSheet oXslSheet = new OXslSheet(_oprocess);
- oXslSheet.uri = docUri;
- oXslSheet.sheetBody = sheetBody;
+ oXslSheet.setUri(docUri);
+ oXslSheet.setSheetBody(sheetBody);
- _oprocess.xslSheets.put(oXslSheet.uri, oXslSheet);
+ _oprocess.getXslSheets().put(oXslSheet.getUri(), oXslSheet);
return oXslSheet;
}
@@ -1635,9 +1628,9 @@
for (OActivity act : _compiledActivities) {
if (act instanceof OAssign) {
OAssign assign = (OAssign) act;
- for (OAssign.Copy copy : assign.copy) {
- if (copy.to instanceof OAssign.PartnerLinkRef) {
- if (((OAssign.PartnerLinkRef) copy.to).partnerLink.getName().equals(plink))
+ for (OAssign.Copy copy : assign.getCopy()) {
+ if (copy.getTo() instanceof OAssign.PartnerLinkRef) {
+ if (((OAssign.PartnerLinkRef) copy.getTo()).getPartnerLink().getName().equals(plink))
return true;
}
}
@@ -1656,10 +1649,10 @@
}
private OElementVarType resolveElementType(QName faultVariableElementType) {
- OElementVarType type = _oprocess.elementTypes.get(faultVariableElementType);
+ OElementVarType type = _oprocess.getElementTypes().get(faultVariableElementType);
if (type == null) {
type = new OElementVarType(_oprocess, faultVariableElementType);
- _oprocess.elementTypes.put(faultVariableElementType, type);
+ _oprocess.getElementTypes().put(faultVariableElementType, type);
}
return type;
}
@@ -1744,8 +1737,8 @@
}
public NSContext tryCacheNamespaceContext(NSContext nsContext) {
- if (getOProcess().namespaceContext.equals(nsContext)) {
- return getOProcess().namespaceContext;
+ if (getOProcess().getNamespaceContext().equals(nsContext)) {
+ return getOProcess().getNamespaceContext();
} else {
return nsContext;
}
@@ -1761,15 +1754,15 @@
return null;
OExtVar oextvar = new OExtVar(_oprocess);
- oextvar.externalVariableId = src.getExternalId();
- oextvar.debugInfo = createDebugInfo(src, null);
+ oextvar.setExternalVariableId(src.getExternalId());
+ oextvar.setDebugInfo(createDebugInfo(src, null));
if (src.getExternalId() == null)
throw new CompilationException(__cmsgs.errMustSpecifyExternalVariableId(src.getName()));
if (src.getRelated() == null)
throw new CompilationException(__cmsgs.errMustSpecifyRelatedVariable(src.getName()));
- oextvar.related = resolveVariable(src.getRelated());
+ oextvar.setRelated(resolveVariable(src.getRelated()));
return oextvar;
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
index 802cc3a..d38dd99 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateGenerator.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OCompensate;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OCompensate;
/**
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
index 8c1c5fe..2391662 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/CompensateScopeGenerator.java
@@ -22,8 +22,8 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.CompensateScopeActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OCompensate;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OCompensate;
import org.apache.ode.utils.msg.MessageBundle;
@@ -37,7 +37,7 @@
CompensateScopeActivity compSrc = (CompensateScopeActivity) src;
if (compSrc.getScopeToCompensate() == null)
throw new CompilationException(__cmsgs.errScopeToCompensateUnspecfied());
- ((OCompensate)output).compensatedScope = _context.resolveCompensatableScope(compSrc.getScopeToCompensate());
+ ((OCompensate)output).setCompensatedScope(_context.resolveCompensatableScope(compSrc.getScopeToCompensate()));
}
public OActivity newInstance(Activity src) {
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
index 4e70125..32e0f80 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/DefaultActivityGenerator.java
@@ -22,8 +22,8 @@
import org.apache.ode.bpel.compiler.bom.BpelObject;
import org.apache.ode.bpel.compiler.bom.ExtensibilityQNames;
import org.apache.ode.bpel.compiler.bom.FailureHandling;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OFailureHandling;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OFailureHandling;
import org.w3c.dom.Element;
/**
@@ -49,9 +49,9 @@
return;
FailureHandling extElement = new FailureHandling(element);
OFailureHandling obj = new OFailureHandling();
- obj.retryFor = extElement.getRetryFor();
- obj.retryDelay = extElement.getRetryDelay();
- obj.faultOnFailure = extElement.getFaultOnFailure();
+ obj.setRetryFor(extElement.getRetryFor());
+ obj.setRetryDelay(extElement.getRetryDelay());
+ obj.setFaultOnFailure(extElement.getFaultOnFailure());
output.setFailureHandling(obj);
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/EmptyGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/EmptyGenerator.java
index a3ff4bc..d8d8955 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/EmptyGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/EmptyGenerator.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OEmpty;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OEmpty;
/**
* Generates code for <code><empty></code> activities.
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java
index cad5e7a..3e27ce3 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ExpressionValidatorFactory.java
@@ -27,7 +27,7 @@
import org.apache.ode.bpel.compiler.api.ExpressionValidator;
import org.apache.ode.bpel.compiler.bom.Process;
import org.apache.ode.bpel.compiler.bom.Expression;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OVarType;
public class ExpressionValidatorFactory {
private static final Log __log = LogFactory.getLog(ExpressionValidatorFactory.class);
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGenerator.java
index 13a77f0..bfb30f9 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/FlowGenerator.java
@@ -23,9 +23,9 @@
import org.apache.ode.bpel.compiler.bom.CompositeActivity;
import org.apache.ode.bpel.compiler.bom.FlowActivity;
import org.apache.ode.bpel.compiler.bom.Link;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OFlow;
-import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OFlow;
+import org.apache.ode.bpel.obj.OLink;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.stl.CollectionsX;
import org.apache.ode.utils.stl.MemberOfFunction;
@@ -45,18 +45,18 @@
compileLinkDecls(oflow, flowAct);
compileChildren(oflow, flowAct);
- for (Iterator<OLink> i = oflow.localLinks.iterator(); i.hasNext(); ) {
+ for (Iterator<OLink> i = oflow.getLocalLinks().iterator(); i.hasNext(); ) {
OLink olink = i.next();
try {
- if (olink.source == null)
- throw new CompilationException(__cmsgs.errLinkMissingSourceActivity(olink.name).setSource(flowAct));
+ if (olink.getSource() == null)
+ throw new CompilationException(__cmsgs.errLinkMissingSourceActivity(olink.getName()).setSource(flowAct));
} catch (CompilationException ce) {
_context.recoveredFromError(src, ce);
}
try {
- if (olink.target == null)
- throw new CompilationException(__cmsgs.errLinkMissingTargetActivity(olink.name).setSource(flowAct));
+ if (olink.getTarget() == null)
+ throw new CompilationException(__cmsgs.errLinkMissingTargetActivity(olink.getName()).setSource(flowAct));
} catch (CompilationException ce) {
_context.recoveredFromError(src, ce);
}
@@ -71,22 +71,22 @@
private void compileLinkDecls(OFlow oflow, FlowActivity flowAct) {
for (Link link : flowAct.getLinks()) {
OLink olink = new OLink(_context.getOProcess());
- olink.name = link.getLinkName();
+ olink.setName(link.getLinkName());
declareLink(oflow, olink);
}
}
private void declareLink(final OFlow oflow, final OLink olink) throws CompilationException {
- if (CollectionsX.find_if(oflow.localLinks, new MemberOfFunction<OLink>() {
+ if (CollectionsX.find_if(oflow.getLocalLinks(), new MemberOfFunction<OLink>() {
public boolean isMember(OLink o) {
- return o.name.equals(olink.name);
+ return o.getName().equals(olink.getName());
}
}) != null)
- throw new CompilationException(__cmsgs.errDuplicateLinkDecl(olink.name));
+ throw new CompilationException(__cmsgs.errDuplicateLinkDecl(olink.getName()));
- olink.declaringFlow = oflow;
- oflow.localLinks.add(olink);
+ olink.setDeclaringFlow(oflow);
+ oflow.getLocalLinks().add(olink);
}
/**
@@ -95,7 +95,7 @@
for (Activity child : src.getActivities()){
try {
OActivity compiledChild = _context.compile(child);
- dest.parallelActivities.add(compiledChild);
+ dest.getParallelActivities().add(compiledChild);
} catch (CompilationException ce) {
_context.recoveredFromError(child, ce);
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
index d672899..d0a4f8a 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ForEachGenerator.java
@@ -28,10 +28,10 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.ForEachActivity;
import org.apache.ode.bpel.compiler.bom.Scope;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OForEach;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OForEach;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.Namespaces;
@@ -51,15 +51,13 @@
if (__log.isDebugEnabled()) __log.debug("Compiling ForEach activity.");
OForEach oforEach = (OForEach) output;
ForEachActivity forEach = (ForEachActivity) src;
- oforEach.parallel = forEach.isParallel();
- oforEach.startCounterValue = _context.compileExpr(forEach.getStartCounter());
- oforEach.finalCounterValue = _context.compileExpr(forEach.getFinalCounter());
+ oforEach.setParallel(forEach.isParallel());
+ oforEach.setStartCounterValue(_context.compileExpr(forEach.getStartCounter()));
+ oforEach.setFinalCounterValue(_context.compileExpr(forEach.getFinalCounter()));
if (forEach.getCompletionCondition() != null) {
- oforEach.completionCondition =
- new OForEach.CompletionCondition(_context.getOProcess());
- oforEach.completionCondition.successfulBranchesOnly
- = forEach.getCompletionCondition().getBranch().isSuccessfulBranchesOnly();
- oforEach.completionCondition.branchCount = _context.compileExpr(forEach.getCompletionCondition().getBranch());
+ oforEach.setCompletionCondition(new org.apache.ode.bpel.obj.OForEach.CompletionCondition(_context.getOProcess()));
+ oforEach.getCompletionCondition().setSuccessfulBranchesOnly(forEach.getCompletionCondition().getBranch().isSuccessfulBranchesOnly());
+ oforEach.getCompletionCondition().setBranchCount(_context.compileExpr(forEach.getCompletionCondition().getBranch()));
}
// ForEach 'adds' a counter variable in inner scope
@@ -75,16 +73,16 @@
throw new CompilationException(__cmsgs.errForEachAndScopeVariableRedundant(forEach.getCounterName()).setSource(src));
OXsdTypeVarType counterType = new OXsdTypeVarType(oforEach.getOwner());
- counterType.simple = true;
- counterType.xsdType = new QName(Namespaces.XML_SCHEMA, "int");
+ counterType.setSimple(true);
+ counterType.setXsdType(new javax.xml.namespace.QName(org.apache.ode.utils.Namespaces.XML_SCHEMA , "int"));
OScope.Variable counterVar = new OScope.Variable(oforEach.getOwner(), counterType);
- counterVar.name = forEach.getCounterName();
+ counterVar.setName(forEach.getCounterName());
if (__log.isDebugEnabled()) __log.debug("Compiling forEach inner scope.");
- oforEach.innerScope = _context.compileSLC(forEach.getChild(), new OScope.Variable[]{counterVar});
+ oforEach.setInnerScope(_context.compileSLC(forEach.getChild(), new org.apache.ode.bpel.obj.OScope.Variable[]{ counterVar }));
// oforEach.innerScope.addLocalVariable(counterVar);
- oforEach.counterVariable = counterVar;
+ oforEach.setCounterVariable(counterVar);
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/IfGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/IfGenerator.java
index 0bb041c..b1e2523 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/IfGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/IfGenerator.java
@@ -24,8 +24,8 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.IfActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OSwitch;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OSwitch;
import org.apache.ode.utils.msg.MessageBundle;
@@ -49,17 +49,16 @@
boolean first = true;
if (switchDef.getActivity() != null) {
OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
- ocase.activity = _context.compile(switchDef.getActivity());
- ocase.expression = _context.compileExpr(switchDef.getCondition());
+ ocase.setActivity(_context.compile(switchDef.getActivity()));
+ ocase.setExpression(_context.compileExpr(switchDef.getCondition()));
oswitch.addCase(ocase);
first = false;
}
for (IfActivity.Case ccase : switchDef.getCases()) {
OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
- ocase.activity = _context.compile(ccase.getActivity());
- ocase.expression = first ? _context.compileExpr(switchDef.getCondition())
- : (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
+ ocase.setActivity(_context.compile(ccase.getActivity()));
+ ocase.setExpression(first ? _context.compileExpr(switchDef.getCondition()) : (ccase.getCondition()) == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
oswitch.addCase(ocase);
first = false;
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
index af627a5..4db569c 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/InvokeGenerator.java
@@ -23,10 +23,10 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.Correlation;
import org.apache.ode.bpel.compiler.bom.InvokeActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OInvoke;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OInvoke;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.stl.CollectionsX;
import org.apache.ode.utils.stl.MemberOfFunction;
@@ -54,11 +54,11 @@
InvokeActivity src = (InvokeActivity) srcx;
final OInvoke oinvoke = (OInvoke) output;
- oinvoke.partnerLink = _context.resolvePartnerLink(src.getPartnerLink());
- oinvoke.operation = _context.resolvePartnerRoleOperation(oinvoke.partnerLink, src.getOperation());
- assert oinvoke.operation.getInput() != null; // ensured by
+ oinvoke.setPartnerLink(_context.resolvePartnerLink(src.getPartnerLink()));
+ oinvoke.setOperation(_context.resolvePartnerRoleOperation(oinvoke.getPartnerLink(), src.getOperation()));
+ assert oinvoke.getOperation().getInput() != null; // ensured by
// resolvePartnerRoleOperation
- assert oinvoke.operation.getInput().getMessage() != null; // ensured
+ assert oinvoke.getOperation().getInput().getMessage() != null; // ensured
// by
// resolvePartnerRoleOperation
// TODO: Add portType checking if specified by user
@@ -66,20 +66,18 @@
// !portType.equals(onMessage.partnerLink.myRolePortType.getQName()))
// throw new CompilationException(CMSGSG.errPortTypeMismatch(portType,
// onMessage.partnerLink.myRolePortType.getQName()));
- if (oinvoke.operation.getInput() != null && oinvoke.operation.getInput().getMessage() != null) {
+ if (oinvoke.getOperation().getInput() != null && oinvoke.getOperation().getInput().getMessage() != null) {
// Input var can be omitted if input message has no part
- if (oinvoke.operation.getInput().getMessage().getParts().size() > 0) {
+ if (oinvoke.getOperation().getInput().getMessage().getParts().size() > 0) {
if (src.getInputVar() == null)
- throw new CompilationException(__imsgs.errInvokeNoInputMessageForInputOp(oinvoke.operation.getName()));
- oinvoke.inputVar = _context.resolveMessageVariable(src.getInputVar(), oinvoke.operation.getInput()
- .getMessage().getQName());
+ throw new CompilationException(__imsgs.errInvokeNoInputMessageForInputOp(oinvoke.getOperation().getName()));
+ oinvoke.setInputVar(_context.resolveMessageVariable(src.getInputVar(), oinvoke.getOperation().getInput().getMessage().getQName()));
}
}
- if (oinvoke.operation.getOutput() != null && oinvoke.operation.getOutput().getMessage() != null) {
+ if (oinvoke.getOperation().getOutput() != null && oinvoke.getOperation().getOutput().getMessage() != null) {
if (src.getOutputVar() == null)
- throw new CompilationException(__imsgs.errInvokeNoOutputMessageForOutputOp(oinvoke.operation.getName()));
- oinvoke.outputVar = _context.resolveMessageVariable(src.getOutputVar(), oinvoke.operation.getOutput()
- .getMessage().getQName());
+ throw new CompilationException(__imsgs.errInvokeNoOutputMessageForOutputOp(oinvoke.getOperation().getName()));
+ oinvoke.setOutputVar(_context.resolveMessageVariable(src.getOutputVar(), oinvoke.getOperation().getOutput().getMessage().getQName()));
}
List<Correlation> correlations = src.getCorrelations();
List<Correlation> incorrelations = CollectionsX.filter(new ArrayList<Correlation>(), correlations,
@@ -94,7 +92,7 @@
@Override
public boolean isMember(Correlation o) {
return (o.getPattern() == Correlation.CorrelationPattern.OUT)
- || (o.getPattern()== Correlation.CorrelationPattern.UNSET && oinvoke.operation.getStyle()== OperationType.ONE_WAY );
+ || (o.getPattern()== Correlation.CorrelationPattern.UNSET && oinvoke.getOperation().getStyle()== OperationType.ONE_WAY );
}
});
@@ -106,17 +104,17 @@
}
});
- if (oinvoke.inputVar != null) {
- doCorrelations(outcorrelations, oinvoke.inputVar, oinvoke.assertCorrelationsInput,
- oinvoke.initCorrelationsInput, oinvoke.joinCorrelationsInput);
- doCorrelations(inoutcorrelations, oinvoke.inputVar, oinvoke.assertCorrelationsInput,
- oinvoke.initCorrelationsInput, oinvoke.joinCorrelationsInput);
+ if (oinvoke.getInputVar() != null) {
+ doCorrelations(outcorrelations, oinvoke.getInputVar(), oinvoke.getAssertCorrelationsInput(),
+ oinvoke.getInitCorrelationsInput(), oinvoke.getJoinCorrelationsInput());
+ doCorrelations(inoutcorrelations, oinvoke.getInputVar(), oinvoke.getAssertCorrelationsInput(),
+ oinvoke.getInitCorrelationsInput(), oinvoke.getJoinCorrelationsInput());
}
- if (oinvoke.outputVar != null) {
- doCorrelations(incorrelations, oinvoke.outputVar,
- oinvoke.assertCorrelationsOutput, oinvoke.initCorrelationsOutput, oinvoke.joinCorrelationsOutput);
- doCorrelations(inoutcorrelations, oinvoke.outputVar,
- oinvoke.assertCorrelationsOutput, oinvoke.initCorrelationsOutput, oinvoke.joinCorrelationsOutput);
+ if (oinvoke.getOutputVar() != null) {
+ doCorrelations(incorrelations, oinvoke.getOutputVar(),
+ oinvoke.getAssertCorrelationsOutput(), oinvoke.getInitCorrelationsOutput(), oinvoke.getJoinCorrelationsOutput());
+ doCorrelations(inoutcorrelations, oinvoke.getOutputVar(),
+ oinvoke.getAssertCorrelationsOutput(), oinvoke.getInitCorrelationsOutput(), oinvoke.getJoinCorrelationsOutput());
}
}
@@ -141,14 +139,14 @@
initCorrelations.add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
+ cset.setHasJoinUseCases(true);
joinCorrelations.add(cset);
}
- for (OProcess.OProperty property : cset.properties) {
+ for (OProcess.OProperty property : cset.getProperties()) {
// Force resolution of alias, to make sure that we have one for
// this variable-property pair.
try {
- _context.resolvePropertyAlias(var, property.name);
+ _context.resolvePropertyAlias(var, property.getName());
} catch (CompilationException ce) {
if (ce.getCompilationMessage().source == null) {
ce.getCompilationMessage().source = correlation;
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java
index bc43e47..5c3915f 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickGenerator.java
@@ -23,8 +23,8 @@
import org.apache.ode.bpel.compiler.bom.OnAlarm;
import org.apache.ode.bpel.compiler.bom.OnMessage;
import org.apache.ode.bpel.compiler.bom.PickActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OPickReceive;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OPickReceive;
/**
@@ -40,7 +40,7 @@
OPickReceive opick = (OPickReceive) output;
PickActivity pickDef = (PickActivity) src;
- opick.createInstanceFlag = pickDef.isCreateInstance();
+ opick.setCreateInstanceFlag(pickDef.isCreateInstance());
for (OnMessage sOnMessage : pickDef.getOnMessages()) {
OPickReceive.OnMessage oOnMessage = compileOnMessage(sOnMessage.getVariable(),
sOnMessage.getPartnerLink(),
@@ -52,18 +52,18 @@
sOnMessage.getRoute());
if (sOnMessage.getActivity() == null)
throw new CompilationException(__cmsgs.errEmptyOnMessage().setSource(sOnMessage));
- oOnMessage.activity = _context.compile(sOnMessage.getActivity());
- opick.onMessages.add(oOnMessage);
+ oOnMessage.setActivity(_context.compile(sOnMessage.getActivity()));
+ opick.getOnMessages().add(oOnMessage);
}
try {
for(OnAlarm onAlarmDef : pickDef.getOnAlarms()){
OPickReceive.OnAlarm oalarm = new OPickReceive.OnAlarm(_context.getOProcess());
- oalarm.activity = _context.compile(onAlarmDef.getActivity());
+ oalarm.setActivity(_context.compile(onAlarmDef.getActivity()));
if (onAlarmDef.getFor() != null && onAlarmDef.getUntil() == null) {
- oalarm.forExpr = _context.compileExpr(onAlarmDef.getFor());
+ oalarm.setForExpr(_context.compileExpr(onAlarmDef.getFor()));
} else if (onAlarmDef.getFor() == null && onAlarmDef.getUntil() != null) {
- oalarm.untilExpr = _context.compileExpr(onAlarmDef.getUntil());
+ oalarm.setUntilExpr(_context.compileExpr(onAlarmDef.getUntil()));
} else {
throw new CompilationException(__cmsgs.errForOrUntilMustBeGiven().setSource(onAlarmDef));
}
@@ -71,7 +71,7 @@
if (pickDef.isCreateInstance())
throw new CompilationException(__cmsgs.errOnAlarmWithCreateInstance().setSource(onAlarmDef));
- opick.onAlarms.add(oalarm);
+ opick.getOnAlarms().add(oalarm);
}
} catch (CompilationException ce) {
_context.recoveredFromError(pickDef, ce);
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java
index cd6b45b..966c3bc 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/PickReceiveGenerator.java
@@ -21,10 +21,10 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.Correlation;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OPickReceive;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OPickReceive;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.utils.msg.MessageBundle;
import javax.xml.namespace.QName;
@@ -35,7 +35,7 @@
/**
* Base class for the {@link PickGenerator} and {@link ReceiveGenerator}
* classes. Provides common functionality related to generating
- * {@link org.apache.ode.bpel.o.OPickReceive.OnMessage} objects.
+ * {@link org.apache.ode.bpel.obj.OPickReceive.OnMessage} objects.
*/
abstract class PickReceiveGenerator extends DefaultActivityGenerator {
protected static final CommonCompilationMessages __cmsgsGeneral = MessageBundle
@@ -68,21 +68,20 @@
String messageExchangeId, QName portType, boolean createInstance, Collection<Correlation> correlations, String route) {
OPickReceive.OnMessage onMessage = new OPickReceive.OnMessage(_context.getOProcess());
- onMessage.partnerLink = _context.resolvePartnerLink(plink);
- onMessage.operation = _context.resolveMyRoleOperation(onMessage.partnerLink, operation);
- if (onMessage.operation.getInput() != null && onMessage.operation.getInput().getMessage() != null) {
- onMessage.variable = _context.resolveMessageVariable(varname, onMessage.operation.getInput().getMessage()
- .getQName());
+ onMessage.setPartnerLink(_context.resolvePartnerLink(plink));
+ onMessage.setOperation(_context.resolveMyRoleOperation(onMessage.getPartnerLink(), operation));
+ if (onMessage.getOperation().getInput() != null && onMessage.getOperation().getInput().getMessage() != null) {
+ onMessage.setVariable(_context.resolveMessageVariable(varname, onMessage.getOperation().getInput().getMessage().getQName()));
}
- onMessage.messageExchangeId = messageExchangeId;
- onMessage.route = route;
+ onMessage.setMessageExchangeId(messageExchangeId);
+ onMessage.setRoute(route);
- if (portType != null && !portType.equals(onMessage.partnerLink.myRolePortType.getQName()))
+ if (portType != null && !portType.equals(onMessage.getPartnerLink().getMyRolePortType().getQName()))
throw new CompilationException(__cmsgsGeneral.errPortTypeMismatch(portType,
- onMessage.partnerLink.myRolePortType.getQName()));
+ onMessage.getPartnerLink().getMyRolePortType().getQName()));
if (createInstance)
- onMessage.partnerLink.addCreateInstanceOperation(onMessage.operation);
+ onMessage.getPartnerLink().addCreateInstanceOperation(onMessage.getOperation());
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
for (Correlation correlation : correlations) {
@@ -99,33 +98,33 @@
if (createInstance)
throw new CompilationException(__cmsgsGeneral.errUseOfUninitializedCorrelationSet(correlation
.getCorrelationSet()));
- onMessage.matchCorrelations.add(cset);
- onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset, false);
+ onMessage.getMatchCorrelations().add(cset);
+ onMessage.getPartnerLink().addCorrelationSetForOperation(onMessage.getOperation(), cset, false);
break;
case YES:
- onMessage.initCorrelations.add(cset);
+ onMessage.getInitCorrelations().add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
- onMessage.joinCorrelations.add(cset);
- onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation, cset, true);
+ cset.setHasJoinUseCases(true);
+ onMessage.getJoinCorrelations().add(cset);
+ onMessage.getPartnerLink().addCorrelationSetForOperation(onMessage.getOperation(), cset, true);
break;
default:
throw new AssertionError("Unexpected value for correlation set enumeration!");
}
- for (OProcess.OProperty property : cset.properties) {
+ for (OProcess.OProperty property : cset.getProperties()) {
// Force resolution of alias, to make sure that we have one for
// this variable-property pair.
- _context.resolvePropertyAlias(onMessage.variable, property.name);
+ _context.resolvePropertyAlias(onMessage.getVariable(), property.getName());
}
csetNames.add(correlation.getCorrelationSet());
}
- if (!onMessage.partnerLink.hasMyRole()) {
- throw new CompilationException(__cmsgsGeneral.errNoMyRoleOnReceivePartnerLink(onMessage.partnerLink
+ if (!onMessage.getPartnerLink().hasMyRole()) {
+ throw new CompilationException(__cmsgsGeneral.errNoMyRoleOnReceivePartnerLink(onMessage.getPartnerLink()
.getName()));
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java
index 0b96fbb..4b0bee3 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReceiveGenerator.java
@@ -20,9 +20,9 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.ReceiveActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OEmpty;
-import org.apache.ode.bpel.o.OPickReceive;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OEmpty;
+import org.apache.ode.bpel.obj.OPickReceive;
class ReceiveGenerator extends PickReceiveGenerator {
@@ -30,7 +30,7 @@
OPickReceive opick = (OPickReceive) output;
ReceiveActivity rcvDef = (ReceiveActivity) src;
- opick.createInstanceFlag = rcvDef.isCreateInstance();
+ opick.setCreateInstanceFlag(rcvDef.isCreateInstance());
OPickReceive.OnMessage onMessage = compileOnMessage(
rcvDef.getVariable(),
rcvDef.getPartnerLink(),
@@ -41,8 +41,8 @@
rcvDef.getCorrelations(),
rcvDef.getRoute());
- onMessage.activity = new OEmpty(_context.getOProcess(), opick);
- opick.onMessages.add(onMessage);
+ onMessage.setActivity(new org.apache.ode.bpel.obj.OEmpty(_context.getOProcess() , opick));
+ opick.getOnMessages().add(onMessage);
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RepeatUntilGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RepeatUntilGenerator.java
index 06c462b..f690b18 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RepeatUntilGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RepeatUntilGenerator.java
@@ -20,8 +20,8 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.RepeatUntilActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.ORepeatUntil;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.ORepeatUntil;
/**
* Generates code for <code><while></code> activities.
@@ -34,8 +34,8 @@
public void compile(OActivity output, Activity srcx) {
ORepeatUntil oru = (ORepeatUntil) output;
RepeatUntilActivity src = (RepeatUntilActivity)srcx;
- oru.untilCondition = _context.compileExpr(src.getCondition());
- oru.activity = _context.compile(src.getActivity());
+ oru.setUntilCondition(_context.compileExpr(src.getCondition()));
+ oru.setActivity(_context.compile(src.getActivity()));
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java
index ddd09d1..a0ec7cc 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ReplyGenerator.java
@@ -21,11 +21,11 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.Correlation;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OReply;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OReply;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.utils.msg.MessageBundle;
import javax.wsdl.Fault;
@@ -54,40 +54,40 @@
org.apache.ode.bpel.compiler.bom.ReplyActivity replyDef = (org.apache.ode.bpel.compiler.bom.ReplyActivity) src;
OReply oreply = (OReply) output;
- oreply.isFaultReply = replyDef.getFaultName() != null;
- oreply.partnerLink = _context.resolvePartnerLink(replyDef.getPartnerLink());
- oreply.messageExchangeId = replyDef.getMessageExchangeId();
+ oreply.setIsFaultReply((replyDef.getFaultName()) != null);
+ oreply.setPartnerLink(_context.resolvePartnerLink(replyDef.getPartnerLink()));
+ oreply.setMessageExchangeId(replyDef.getMessageExchangeId());
if (replyDef.getVariable() != null) {
- oreply.variable = _context.resolveVariable(replyDef.getVariable());
- if (!(oreply.variable.type instanceof OMessageVarType))
- throw new CompilationException(_cmsgsGeneral.errMessageVariableRequired(oreply.variable.name));
+ oreply.setVariable(_context.resolveVariable(replyDef.getVariable()));
+ if (!(oreply.getVariable().getType() instanceof OMessageVarType))
+ throw new CompilationException(_cmsgsGeneral.errMessageVariableRequired(oreply.getVariable().getName()));
}
- if (oreply.partnerLink.myRolePortType == null)
- throw new CompilationException(_cmsgsGeneral.errPartnerLinkDoesNotDeclareMyRole(oreply.partnerLink.getName()));
+ if (oreply.getPartnerLink().getMyRolePortType() == null)
+ throw new CompilationException(_cmsgsGeneral.errPartnerLinkDoesNotDeclareMyRole(oreply.getPartnerLink().getName()));
// The portType on the reply is not necessary, so we check its validty only when present.
- if (replyDef.getPortType() != null && !oreply.partnerLink.myRolePortType.getQName().equals(replyDef.getPortType()))
- throw new CompilationException(_cmsgsGeneral.errPortTypeMismatch(replyDef.getPortType(),oreply.partnerLink.myRolePortType.getQName()));
+ if (replyDef.getPortType() != null && !oreply.getPartnerLink().getMyRolePortType().getQName().equals(replyDef.getPortType()))
+ throw new CompilationException(_cmsgsGeneral.errPortTypeMismatch(replyDef.getPortType(),oreply.getPartnerLink().getMyRolePortType().getQName()));
- oreply.operation = _context.resolveMyRoleOperation(oreply.partnerLink, replyDef.getOperation());
- if (oreply.operation.getOutput() == null)
- throw new CompilationException(_cmsgsGeneral.errTwoWayOperationExpected(oreply.operation.getName()));
+ oreply.setOperation(_context.resolveMyRoleOperation(oreply.getPartnerLink(), replyDef.getOperation()));
+ if (oreply.getOperation().getOutput() == null)
+ throw new CompilationException(_cmsgsGeneral.errTwoWayOperationExpected(oreply.getOperation().getName()));
- if (oreply.isFaultReply) {
+ if (oreply.isIsFaultReply()) {
Fault flt = null;
- if (replyDef.getFaultName().getNamespaceURI().equals(oreply.partnerLink.myRolePortType.getQName().getNamespaceURI()))
- flt = oreply.operation.getFault(replyDef.getFaultName().getLocalPart());
+ if (replyDef.getFaultName().getNamespaceURI().equals(oreply.getPartnerLink().getMyRolePortType().getQName().getNamespaceURI()))
+ flt = oreply.getOperation().getFault(replyDef.getFaultName().getLocalPart());
if (flt == null)
- throw new CompilationException(__cmsgsLocal.errUndeclaredFault(replyDef.getFaultName().getLocalPart(), oreply.operation.getName()));
- if (oreply.variable != null && !((OMessageVarType)oreply.variable.type).messageType.equals(flt.getMessage().getQName()))
- throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, flt.getMessage().getQName(), ((OMessageVarType)oreply.variable.type).messageType));
- oreply.fault = replyDef.getFaultName();
+ throw new CompilationException(__cmsgsLocal.errUndeclaredFault(replyDef.getFaultName().getLocalPart(), oreply.getOperation().getName()));
+ if (oreply.getVariable() != null && !((OMessageVarType)oreply.getVariable().getType()).getMessageType().equals(flt.getMessage().getQName()))
+ throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.getVariable().getName(), flt.getMessage().getQName(), ((OMessageVarType)oreply.getVariable().getType()).getMessageType()));
+ oreply.setFault(replyDef.getFaultName());
} else /* !oreply.isFaultReply */ {
- assert oreply.fault == null;
- if (oreply.variable == null)
+ assert oreply.getFault() == null;
+ if (oreply.getVariable() == null)
throw new CompilationException(__cmsgsLocal.errOutputVariableMustBeSpecified());
- if (!((OMessageVarType)oreply.variable.type).messageType.equals(oreply.operation.getOutput().getMessage().getQName()))
- throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.variable.name, oreply.operation.getOutput().getMessage().getQName(),((OMessageVarType)oreply.variable.type).messageType));
+ if (!((OMessageVarType)oreply.getVariable().getType()).getMessageType().equals(oreply.getOperation().getOutput().getMessage().getQName()))
+ throw new CompilationException(_cmsgsGeneral.errVariableTypeMismatch(oreply.getVariable().getName(), oreply.getOperation().getOutput().getMessage().getQName(),((OMessageVarType)oreply.getVariable().getType()).getMessageType()));
}
Set<String> csetNames = new HashSet<String>(); // prevents duplicate cset in on one set of correlations
@@ -102,24 +102,24 @@
switch (correlation.getInitiate()) {
case UNSET:
case NO:
- oreply.assertCorrelations.add(cset);
+ oreply.getAssertCorrelations().add(cset);
break;
case YES:
- oreply.initCorrelations.add(cset);
+ oreply.getInitCorrelations().add(cset);
break;
case JOIN:
- cset.hasJoinUseCases = true;
- oreply.joinCorrelations.add(cset);
+ cset.setHasJoinUseCases(true);
+ oreply.getJoinCorrelations().add(cset);
break;
default:
// TODO: Make error for this.
throw new AssertionError();
}
- for (Iterator<OProcess.OProperty> j = cset.properties.iterator(); j.hasNext(); ) {
+ for (Iterator<OProcess.OProperty> j = cset.getProperties().iterator(); j.hasNext(); ) {
OProcess.OProperty property = j.next();
// Force resolution of alias, to make sure that we have one for this variable-property pair.
- _context.resolvePropertyAlias(oreply.variable, property.name);
+ _context.resolvePropertyAlias(oreply.getVariable(), property.getName());
}
csetNames.add(correlation.getCorrelationSet());
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java
index cf94696..e60f7b2 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/RethrowGenerator.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.ORethrow;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.ORethrow;
class RethrowGenerator extends DefaultActivityGenerator {
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java
index 12e5253..fd986b3 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SequenceGenerator.java
@@ -22,8 +22,8 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.CompositeActivity;
import org.apache.ode.bpel.compiler.bom.SequenceActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OSequence;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OSequence;
import org.apache.ode.utils.msg.MessageBundle;
@@ -52,7 +52,7 @@
for (Activity child : src.getActivities()) {
try {
OActivity compiledChild = _context.compile(child);
- dest.sequence.add(compiledChild);
+ dest.getSequence().add(compiledChild);
}
catch (CompilationException ce) {
_context.recoveredFromError(child, ce);
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SwitchGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SwitchGenerator.java
index 8edbc54..644da81 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SwitchGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/SwitchGenerator.java
@@ -20,8 +20,8 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.SwitchActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OSwitch;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OSwitch;
/**
* Generator for legacy BPEL 1.1 <code><switch></code> actiivty.
@@ -39,8 +39,8 @@
for (SwitchActivity.Case ccase : switchDef.getCases()) {
OSwitch.OCase ocase = new OSwitch.OCase(_context.getOProcess());
- ocase.activity = _context.compile(ccase.getActivity());
- ocase.expression = (ccase.getCondition() == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
+ ocase.setActivity(_context.compile(ccase.getActivity()));
+ ocase.setExpression((ccase.getCondition()) == null ? _context.constantExpr(true) : _context.compileExpr(ccase.getCondition()));
oswitch.addCase(ocase);
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java
index fcd33c4..8d269f6 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/TerminateGenerator.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.compiler;
import org.apache.ode.bpel.compiler.bom.Activity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OTerminate;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OTerminate;
/**
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java
index cbde1f0..63ca608 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java
@@ -21,8 +21,8 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.ThrowActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OThrow;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OThrow;
import org.apache.ode.utils.msg.MessageBundle;
@@ -43,8 +43,8 @@
if (throwDef.getFaultName() == null)
throw new CompilationException(__cmsgs.errThrowMustDefineFaultName());
- othrow.faultName = throwDef.getFaultName();
+ othrow.setFaultName(throwDef.getFaultName());
if(throwDef.getFaultVariable() != null)
- othrow.faultVariable = _context.resolveVariable(throwDef.getFaultVariable());
+ othrow.setFaultVariable(_context.resolveVariable(throwDef.getFaultVariable()));
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
index 22821df..e49e0ca 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WSDLRegistry.java
@@ -18,6 +18,28 @@
*/
package org.apache.ode.bpel.compiler;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
+import javax.wsdl.Message;
+import javax.wsdl.PortType;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.compiler.api.CompilationException;
@@ -37,19 +59,6 @@
import org.w3c.dom.Document;
import org.xml.sax.InputSource;
-import javax.wsdl.*;
-import javax.wsdl.extensions.ExtensibilityElement;
-import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-
-import java.io.ByteArrayInputStream;
-import java.io.StringReader;
-import java.io.IOException;
-import java.net.URI;
-import java.util.*;
-
/**
* A parsed collection of WSDL definitions, including BPEL-specific extensions.
@@ -209,6 +218,8 @@
Types types = def.getTypes();
if (types != null) {
+ addAllInternalSchemas(def);
+
int localSchemaId = 0;
for (Iterator<ExtensibilityElement> iter =
((List<ExtensibilityElement>)def.getTypes().getExtensibilityElements()).iterator();
@@ -271,6 +282,27 @@
}
}
+ @SuppressWarnings("unchecked")
+ private void addAllInternalSchemas(Definition def) {
+ for (Iterator<ExtensibilityElement> iter = ((List<ExtensibilityElement>) def.getTypes().getExtensibilityElements()).iterator(); iter.hasNext();) {
+ ExtensibilityElement ee = iter.next();
+
+ if (ee instanceof XMLSchemaType) {
+ byte[] schema = ((XMLSchemaType) ee).getXMLSchema();
+ try {
+ Document doc = DOMUtils.parse(new InputSource(new ByteArrayInputStream(schema)));
+ String schemaTargetNS = doc.getDocumentElement().getAttribute("targetNamespace");
+ if (schemaTargetNS != null && schemaTargetNS.length() > 0) {
+ _internalSchemas.put(new URI(schemaTargetNS), schema);
+ _documentSchemas.put(new URI(schemaTargetNS), doc);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Couldn't parse schema in " + def.getTargetNamespace(), e);
+ }
+ }
+ }
+ }
+
public org.apache.ode.bpel.compiler.bom.Property getProperty(QName name) {
ArrayList<Definition4BPEL> defs = _definitions.get(name.getNamespaceURI());
if (defs == null) return null;
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java
index ac84804..08cc835 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WaitGenerator.java
@@ -22,8 +22,8 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.WaitActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OWait;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OWait;
import org.apache.ode.utils.msg.MessageBundle;
/**
@@ -41,10 +41,10 @@
WaitActivity waitDef = (WaitActivity)src;
OWait owait = (OWait)output;
if (waitDef.getFor() != null && waitDef.getUntil() == null) {
- owait.forExpression = _context.compileExpr(waitDef.getFor());
+ owait.setForExpression(_context.compileExpr(waitDef.getFor()));
}
else if (waitDef.getFor() == null && waitDef.getUntil() != null) {
- owait.untilExpression = _context.compileExpr(waitDef.getUntil());
+ owait.setUntilExpression(_context.compileExpr(waitDef.getUntil()));
}
else {
throw new CompilationException(_msgs.errWaitMustDefineForOrUntilDuration().setSource(waitDef));
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java
index be32dc4..509dd06 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/WhileGenerator.java
@@ -20,8 +20,8 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.WhileActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OWhile;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OWhile;
/**
@@ -35,7 +35,7 @@
public void compile(OActivity output, Activity srcx) {
OWhile owhile = (OWhile) output;
WhileActivity src = (WhileActivity)srcx;
- owhile.whileCondition = _context.compileExpr(src.getCondition());
- owhile.activity = _context.compile(src.getActivity());
+ owhile.setWhileCondition(_context.compileExpr(src.getCondition()));
+ owhile.setActivity(_context.compile(src.getActivity()));
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
index 0ff6f0b..5d9f634 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/CompilerContext.java
@@ -29,18 +29,18 @@
import org.apache.ode.bpel.compiler.bom.Activity;
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.compiler.bom.ScopeLikeActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OXslSheet;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OXslSheet;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.NSContext;
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java
index 47124e0..0d86bc0 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionCompiler.java
@@ -18,9 +18,9 @@
*/
package org.apache.ode.bpel.compiler.api;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OVarType;
import java.util.Map;
@@ -36,7 +36,7 @@
void setCompilerContext(CompilerContext compilerContext);
/**
- * Compile an expression into a {@link org.apache.ode.bpel.o.OExpression} object.
+ * Compile an expression into a {@link org.apache.ode.bpel.obj.OExpression} object.
* @param source
* @return
*/
@@ -44,7 +44,7 @@
throws CompilationException;
/**
- * Compile an lvalue (the 'to' of an assignment) into a {@link org.apache.ode.bpel.o.OLValueExpression} object.
+ * Compile an lvalue (the 'to' of an assignment) into a {@link org.apache.ode.bpel.obj.OLValueExpression} object.
* @param source
* @return
* @throws CompilationException
@@ -53,7 +53,7 @@
throws CompilationException;
/**
- * Compile a join condition into a {@link org.apache.ode.bpel.o.OExpression} object.
+ * Compile a join condition into a {@link org.apache.ode.bpel.obj.OExpression} object.
* @param source
* @return
*/
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionValidator.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionValidator.java
index 689e3d9..05a5030 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionValidator.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/api/ExpressionValidator.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.compiler.api;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OVarType;
import org.apache.ode.bpel.compiler.bom.Process;
import org.apache.ode.bpel.compiler.bom.Expression;
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/package.html b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/package.html
deleted file mode 100644
index ba33985..0000000
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/package.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<html>
-<body>
-<p>
-The API for the BPEL Object Model (BOM), a domain-specific document
-object model (DOM) that can represent BPEL v1.1 and BPEL v2.0 (OASIS) processes.
-While the BOM enforced strcutural constraints
---for example that a process contain one root activity--
-it does not perform any static analysis, and may be used to produce processes
-that are invalid.
-It is also possible to use the BOM to build processes that do not conform to
-the BPEL XML Schema.
-This allows the BOM to be used in applications such a process design, where an
-incomplete or invalid process may need to be modeled.
-</p>
-
-<p>
-
-</p>
-</body>
-</html>
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/package.html b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/package.html
deleted file mode 100644
index 9a64046..0000000
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/package.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements. See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership. The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied. See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- -->
-
-<html>
- <body>
- <p>BPEL compiler (bpelc) classes and interfaces.
- Taking as input the de-referenced BPEL object model
- (see {@link org.apache.ode.bom.impl.nodes}), the BPEL compiler applies
- static analysis rules to ensure compliance of the BPEL model.
- Upon successful analysis, the compiler generates a
- "compiled" process description suitable for
- consumption by the BPEL Service Provider?s
- (see {@link com.fs.jlo.bpel.provider.BpelServiceProvider})
- processing engine (also known as the virtual processing unit
- or <b>VPU</b>).</p>
-
- <p>Failures in the static analysis phase are
- reported in the same manner as parser errors and contain
- detailed error descriptions and line number references to
- the location of the errors in the original BPEL XML process
- definition.</p>
- </body>
-</html>
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/WSDLReaderImpl.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/WSDLReaderImpl.java
index ea68329..341097a 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/WSDLReaderImpl.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/wsdl/WSDLReaderImpl.java
@@ -18,9 +18,29 @@
*/
package org.apache.ode.bpel.compiler.wsdl;
+import java.util.Map;
+
+import javax.wsdl.Binding;
+import javax.wsdl.BindingFault;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Fault;
+import javax.wsdl.Input;
+import javax.wsdl.Message;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
import javax.wsdl.WSDLException;
import javax.wsdl.factory.WSDLFactory;
+import org.w3c.dom.Element;
+
/**
* Little hack to solve the disfunctional WSDL4J extension mechanism. Without this,
* WSDL4J will attempt to do Class.forName to get the WSDLFactory, which will break
@@ -42,5 +62,116 @@
return _localFactory;
}
+ @Override
+ public Binding parseBinding(Element bindingEl, Definition def) throws WSDLException {
+ Binding binding = super.parseBinding(bindingEl, def);
+ binding.setDocumentationElement(null);
+ return binding;
+ }
+ @Override
+ public BindingFault parseBindingFault(Element bindingFaultEl, Definition def) throws WSDLException {
+ BindingFault bindingFault = super.parseBindingFault(bindingFaultEl, def);
+ bindingFault.setDocumentationElement(null);
+ return bindingFault;
+ }
+
+ @Override
+ public BindingInput parseBindingInput(Element bindingInputEl, Definition def) throws WSDLException {
+ BindingInput bindingInput = super.parseBindingInput(bindingInputEl, def);
+ bindingInput.setDocumentationElement(null);
+ return bindingInput;
+ }
+
+ @Override
+ public BindingOperation parseBindingOperation(Element bindingOperationEl, PortType portType, Definition def) throws WSDLException {
+ BindingOperation bindingOperation = super.parseBindingOperation(bindingOperationEl, portType, def);
+ bindingOperation.setDocumentationElement(null);
+ return bindingOperation;
+ }
+
+ @Override
+ public BindingOutput parseBindingOutput(Element bindingOutputEl, Definition def) throws WSDLException {
+ BindingOutput BindingOutput = super.parseBindingOutput(bindingOutputEl, def);
+ BindingOutput.setDocumentationElement(null);
+ return BindingOutput;
+ }
+
+ @SuppressWarnings("rawtypes")
+ @Override
+ public Definition parseDefinitions(String documentBaseURI, Element defEl, Map importedDefs) throws WSDLException {
+ Definition definition = super.parseDefinitions(documentBaseURI, defEl, importedDefs);
+ definition.setDocumentationElement(null);
+ return definition;
+ }
+
+ @Override
+ public Fault parseFault(Element faultEl, Definition def) throws WSDLException {
+ Fault fault = super.parseFault(faultEl, def);
+ fault.setDocumentationElement(null);
+ return fault;
+ }
+
+ @Override
+ public Input parseInput(Element inputEl, Definition def) throws WSDLException {
+ Input input = super.parseInput(inputEl, def);
+ input.setDocumentationElement(null);
+ return input;
+ }
+
+ @Override
+ public Message parseMessage(Element msgEl, Definition def) throws WSDLException {
+ Message message = super.parseMessage(msgEl, def);
+ message.setDocumentationElement(null);
+ return message;
+ }
+
+ @Override
+ public Operation parseOperation(Element opEl, PortType portType, Definition def) throws WSDLException {
+ Operation operation = super.parseOperation(opEl, portType, def);
+ operation.setDocumentationElement(null);
+ return operation;
+ }
+
+ @Override
+ public Output parseOutput(Element outputEl, Definition def) throws WSDLException {
+ Output output = super.parseOutput(outputEl, def);
+ output.setDocumentationElement(null);
+ return output;
+ }
+
+ @Override
+ public Part parsePart(Element partEl, Definition def) throws WSDLException {
+ Part part = super.parsePart(partEl, def);
+ part.setDocumentationElement(null);
+ return part;
+ }
+
+ @Override
+ public Port parsePort(Element portEl, Definition def) throws WSDLException {
+ Port Port = super.parsePort(portEl, def);
+ Port.setDocumentationElement(null);
+ return Port;
+ }
+
+ @Override
+ public PortType parsePortType(Element portTypeEl, Definition def) throws WSDLException {
+ PortType portType = super.parsePortType(portTypeEl, def);
+ portType.setDocumentationElement(null);
+ return portType;
+ }
+
+ @Override
+ public Service parseService(Element serviceEl, Definition def) throws WSDLException {
+ Service service = super.parseService(serviceEl, def);
+ service.setDocumentationElement(null);
+ return service;
+ }
+
+ @Override
+ public Types parseTypes(Element typesEl, Definition def) throws WSDLException {
+ Types types = super.parseTypes(typesEl, def);
+ types.setDocumentationElement(null);
+ return types;
+ }
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
index 890a2a3..319efb0 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/JaxenBpelHandler.java
@@ -24,14 +24,14 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.api.CompilerContext;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.NSContext;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.xsl.XslTransformHandler;
@@ -76,16 +76,16 @@
if(_out instanceof OXPath10ExpressionBPEL20){
OXPath10ExpressionBPEL20 out = (OXPath10ExpressionBPEL20)_out;
try{
- if(out.isJoinExpression){
+ if(out.isIsJoinExpression()){
// these resolve to links
OLink olink = _cctx.resolveLink(variableName);
- _out.links.put(variableName, olink);
+ _out.getLinks().put(variableName, olink);
}else{
int dot = variableName.indexOf('.');
if (dot != -1)
variableName = variableName.substring(0,dot);
OScope.Variable var = _cctx.resolveVariable(variableName);
- _out.vars.put(variableName, var);
+ _out.getVars().put(variableName, var);
}
}catch(CompilationException ce){
throw new CompilationExceptionWrapper(ce);
@@ -148,7 +148,7 @@
String linkName = getLiteralFromExpression((Expr)params.get(0));
OLink olink = _cctx.resolveLink(linkName);
- _out.links.put(linkName, olink);
+ _out.getLinks().put(linkName, olink);
}
/**
@@ -195,7 +195,7 @@
String varName = getLiteralFromExpression((Expr)params.get(0));
OScope.Variable v = _cctx.resolveVariable(varName);
- _out.vars.put(varName, v);
+ _out.getVars().put(varName, v);
String propName = getLiteralFromExpression((Expr)params.get(1));
QName qname = _nsContext.derefQName(propName);
@@ -208,8 +208,8 @@
// Make sure we can...
_cctx.resolvePropertyAlias(v, qname);
- _out.properties.put(propName, property);
- _out.vars.put(varName, v);
+ _out.getProperties().put(propName, property);
+ _out.getVars().put(varName, v);
}
private void compileDoXslTransform(FunctionCallExpr c) throws CompilationException {
@@ -222,14 +222,14 @@
String xslUri = getLiteralFromExpression((Expr)params.get(0));
OXslSheet xslSheet = _cctx.compileXslt(xslUri);
try {
- XslTransformHandler.getInstance().parseXSLSheet(_cctx.getOProcess().getQName(), xslSheet.uri, xslSheet.sheetBody,
+ XslTransformHandler.getInstance().parseXSLSheet(_cctx.getOProcess().getQName(), xslSheet.getUri(), xslSheet.getSheetBody(),
new XslCompileUriResolver(_cctx, _out));
} catch (Exception e) {
throw new CompilationException(
__msgs.errInvalidNumberOfArguments(xslUri));
}
- _out.setXslSheet(xslSheet.uri, xslSheet);
+ _out.setXslSheet(xslSheet.getUri(), xslSheet);
}
private String getLiteralFromExpression(Expr expr)
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java
index 6bc70e2..69d561a 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL11.java
@@ -20,9 +20,9 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.bom.Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
import org.apache.ode.utils.Namespaces;
/**
@@ -54,7 +54,7 @@
_qnFnGetVariableData,
_qnFnGetVariableProperty,
_qnFnGetLinkStatus);
- oexp.namespaceCtx = xpath.getNamespaceContext();
+ oexp.setNamespaceCtx(xpath.getNamespaceContext());
doJaxenCompile(oexp, xpath);
return oexp;
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL20.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL20.java
index 8c5b4d4..81a4e3b 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL20.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerBPEL20.java
@@ -21,10 +21,10 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.api.CompilerContext;
import org.apache.ode.bpel.compiler.bom.Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
import org.apache.ode.utils.Namespaces;
import org.apache.ode.utils.xsl.XslTransformHandler;
@@ -84,7 +84,7 @@
_qnFnGetLinkStatus,
_qnDoXslTransform,
isJoinCondition);
- oexp.namespaceCtx = xpath.getNamespaceContext();
+ oexp.setNamespaceCtx(xpath.getNamespaceContext());
doJaxenCompile(oexp, xpath);
return oexp;
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java
index ebef93a..8598c1b 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPath10ExpressionCompilerImpl.java
@@ -27,7 +27,7 @@
import org.apache.ode.bpel.compiler.api.CompilerContext;
import org.apache.ode.bpel.compiler.api.ExpressionCompiler;
import org.apache.ode.bpel.compiler.bom.Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
import org.apache.ode.utils.msg.MessageBundle;
import org.jaxen.saxpath.SAXPathException;
import org.jaxen.saxpath.XPathReader;
@@ -122,7 +122,7 @@
reader.setXPathHandler(handler);
reader.parse(xpathStr);
- out.xpath = xpathStr;
+ out.setXpath(xpathStr);
} catch (CompilationExceptionWrapper e) {
CompilationException ce = e.getCompilationException();
if (ce == null) {
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XslCompileUriResolver.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XslCompileUriResolver.java
index 675d323..710baa9 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XslCompileUriResolver.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XslCompileUriResolver.java
@@ -20,8 +20,8 @@
package org.apache.ode.bpel.elang.xpath10.compiler;
import org.apache.ode.bpel.compiler.api.CompilerContext;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.obj.OXslSheet;
import javax.xml.transform.URIResolver;
import javax.xml.transform.Source;
@@ -45,7 +45,7 @@
public Source resolve(String href, String base) throws TransformerException {
OXslSheet xslSheet = _cc.compileXslt(href);
- _expr.setXslSheet(xslSheet.uri, xslSheet);
- return new StreamSource(new StringReader(xslSheet.sheetBody));
+ _expr.setXslSheet(xslSheet.getUri(), xslSheet);
+ return new StreamSource(new StringReader(xslSheet.getSheetBody()));
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
index dc6e5e4..b1c86b1 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpFunctionResolver.java
@@ -30,10 +30,10 @@
import org.apache.ode.bpel.compiler.api.CompilerContext;
import org.apache.ode.bpel.elang.xpath10.compiler.XPathMessages;
import org.apache.ode.bpel.elang.xpath10.compiler.XslCompileUriResolver;
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.NSContext;
import org.apache.ode.utils.Namespaces;
import org.apache.ode.utils.msg.MessageBundle;
@@ -124,7 +124,7 @@
}
String varName = (String) params.get(0);
OScope.Variable v = _cctx.resolveVariable(varName);
- _out.vars.put(varName, v);
+ _out.getVars().put(varName, v);
String propName = (String) params.get(1);
QName qname = _nsContext.derefQName(propName);
@@ -137,8 +137,8 @@
// Make sure we can...
_cctx.resolvePropertyAlias(v, qname);
- _out.properties.put(propName, property);
- _out.vars.put(varName, v);
+ _out.getProperties().put(propName, property);
+ _out.getVars().put(varName, v);
return "";
}
}
@@ -153,13 +153,13 @@
String xslUri = (String) params.get(0);
OXslSheet xslSheet = _cctx.compileXslt(xslUri);
try {
- XslTransformHandler.getInstance().parseXSLSheet(_cctx.getOProcess().getQName(), xslSheet.uri, xslSheet.sheetBody,
+ XslTransformHandler.getInstance().parseXSLSheet(_cctx.getOProcess().getQName(), xslSheet.getUri(), xslSheet.getSheetBody(),
new XslCompileUriResolver(_cctx, _out));
} catch (Exception e) {
throw new CompilationException(__msgs.errXslCompilation(xslUri, e.toString()));
}
- _out.setXslSheet(xslSheet.uri, xslSheet);
+ _out.setXslSheet(xslSheet.getUri(), xslSheet);
return "";
}
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpVariableResolver.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpVariableResolver.java
index 108b63e..fc50621 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpVariableResolver.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/JaxpVariableResolver.java
@@ -24,13 +24,13 @@
import org.apache.ode.bpel.compiler.api.CompilationException;
import org.apache.ode.bpel.compiler.api.CompilerContext;
import org.apache.ode.bpel.elang.xpath10.compiler.XPathMessages;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
import org.apache.ode.utils.msg.MessageBundle;
@@ -70,18 +70,18 @@
try {
String name = variableName.getLocalPart();
- if(_oxpath.isJoinExpression) {
+ if(_oxpath.isIsJoinExpression()) {
// these resolve to links
OLink olink = _cctx.resolveLink(name);
- _oxpath.links.put(name, olink);
+ _oxpath.getLinks().put(name, olink);
return Boolean.TRUE;
} else {
int dot = name.indexOf('.');
if (dot != -1)
name = name.substring(0,dot);
OScope.Variable var = _cctx.resolveVariable(name);
- _oxpath.vars.put(name, var);
- return extractValue(var, var.type);
+ _oxpath.getVars().put(name, var);
+ return extractValue(var, var.getType());
}
} catch (CompilationException e) {
throw new WrappedResolverException(e);
@@ -90,14 +90,14 @@
private Object extractValue(OScope.Variable var, OVarType varType) {
if (varType instanceof OXsdTypeVarType) {
- return generateFromType(((OXsdTypeVarType)varType).xsdType);
+ return generateFromType(((OXsdTypeVarType)varType).getXsdType());
} else if (varType instanceof OElementVarType) {
- return generateFromType(((OElementVarType)varType).elementType);
+ return generateFromType(((OElementVarType)varType).getElementType());
} else if (varType instanceof OMessageVarType) {
// MR That's an ugly hack but otherwise, xpath compilation doesn't work
- if (((OMessageVarType)varType).parts.size() == 0)
- throw new WrappedResolverException(__msgs.errExpressionMessageNoPart(var.name));
- return extractValue(var, ((OMessageVarType)varType).parts.values().iterator().next().type);
+ if (((OMessageVarType)varType).getParts().size() == 0)
+ throw new WrappedResolverException(__msgs.errExpressionMessageNoPart(var.getName()));
+ return extractValue(var, ((OMessageVarType)varType).getParts().values().iterator().next().getType());
}
return "";
}
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
index dc35969..ac0cf58 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
@@ -48,9 +48,9 @@
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.elang.xpath10.compiler.XPathMessages;
import org.apache.ode.bpel.elang.xpath10.compiler.XslCompilationErrorListener;
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.xsl.XslTransformHandler;
@@ -120,7 +120,7 @@
throws CompilationException {
OXPath20ExpressionBPEL20 oexp = new OXPath20ExpressionBPEL20(_compilerContext.getOProcess(), _qnVarData,
_qnVarProp, _qnLinkStatus, _qnXslTransform, isJoinCondition);
- oexp.namespaceCtx = _compilerContext.tryCacheNamespaceContext(xpath.getNamespaceContext());
+ oexp.setNamespaceCtx(_compilerContext.tryCacheNamespaceContext(xpath.getNamespaceContext()));
doJaxpCompile(oexp, xpath);
return oexp;
}
@@ -140,7 +140,7 @@
throw new CompilationException(__msgs.warnXPath20Syntax(DOMUtils.domToString(node), "empty string"));
}
- out.xpath = xpathStr;
+ out.setXpath(xpathStr);
try {
__log.debug("Compiling expression " + xpathStr);
XPathFactory xpf = new XPathFactoryImpl();
diff --git a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
index 8e97c55..aeaf585 100644
--- a/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
+++ b/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
@@ -57,16 +57,16 @@
import org.apache.ode.bpel.elang.xpath20.compiler.JaxpFunctionResolver;
import org.apache.ode.bpel.elang.xpath20.compiler.JaxpVariableResolver;
import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
-import org.apache.ode.bpel.elang.xquery10.o.OXQuery10ExpressionBPEL20;
-import org.apache.ode.bpel.o.OConstantVarType;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.elang.xquery10.obj.OXQuery10ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OConstantVarType;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.NSContext;
import org.apache.ode.utils.Namespaces;
@@ -139,7 +139,7 @@
throws CompilationException {
OXQuery10ExpressionBPEL20 oexp = new OXQuery10ExpressionBPEL20(_compilerContext.getOProcess(), _qnVarData,
_qnVarProp, _qnLinkStatus, _qnXslTransform, isJoinCondition);
- oexp.namespaceCtx = xquery.getNamespaceContext();
+ oexp.setNamespaceCtx(xquery.getNamespaceContext());
doJaxpCompile(oexp, xquery);
return oexp;
}
@@ -210,7 +210,7 @@
if (variable == null) {
continue;
}
- OVarType type = variable.type;
+ OVarType type = variable.getType();
QName nameQName = getNameQName(variableName);
QName typeQName = getTypeQName(variableName, type);
variableTypes.put(nameQName, typeQName);
@@ -224,11 +224,11 @@
}
// Add implicit declarations as prolog to the user-defined XQuery
- out.xquery = declarations.toString() + xqueryStr;
+ out.setXquery((declarations.toString()) + xqueryStr);
// Check the XQuery for compilation errors
xqconn.setStaticContext(staticContext);
- XQPreparedExpression exp = xqconn.prepareExpression(out.xquery);
+ XQPreparedExpression exp = xqconn.prepareExpression(out.getXquery());
// Pre-evaluate variables and functions by executing query
node.setUserData(XQuery10BpelFunctions.USER_DATA_KEY_FUNCTION_RESOLVER,
@@ -318,7 +318,7 @@
private OScope.Variable getVariable(List<OScope.Variable> variables, String variableName) {
String declaredVariable = getVariableDeclaredName(variableName);
for (OScope.Variable variable : variables) {
- if (variable.name.equals(declaredVariable)) {
+ if (variable.getName().equals(declaredVariable)) {
return variable;
}
}
@@ -353,14 +353,14 @@
if (type instanceof OConstantVarType) {
typeQName = new QName(Namespaces.XML_SCHEMA, "string", "xs");
} else if (type instanceof OElementVarType) {
- typeQName = ((OElementVarType) type).elementType;
+ typeQName = ((OElementVarType) type).getElementType();
} else if (type instanceof OMessageVarType) {
- Part part = ((OMessageVarType) type).parts.get(getVariablePartName(variableName));
+ Part part = ((OMessageVarType) type).getParts().get(getVariablePartName(variableName));
if (part != null) {
- typeQName = getTypeQName(variableName, part.type);
+ typeQName = getTypeQName(variableName, part.getType());
}
} else if (type instanceof OXsdTypeVarType) {
- typeQName = ((OXsdTypeVarType) type).xsdType;
+ typeQName = ((OXsdTypeVarType) type).getXsdType();
}
return typeQName;
}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java
index 01f4503..57f6ea4 100644
--- a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler/XPathTest.java
@@ -44,23 +44,23 @@
import org.apache.ode.bpel.elang.xpath10.compiler.XPath10ExpressionCompilerBPEL20Draft;
import org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerBPEL20;
import org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerBPEL20Draft;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OXslSheet;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OProcess.OPropertyAlias;
-import org.apache.ode.bpel.o.OScope.CorrelationSet;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OXslSheet;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+import org.apache.ode.bpel.obj.OProcess.OPropertyAlias;
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.NSContext;
import org.w3c.dom.Element;
@@ -174,7 +174,7 @@
public Part resolvePart(Variable variable, String partname)
throws CompilationException {
- return ((OMessageVarType) variable.type).parts.get(partname);
+ return ((OMessageVarType) variable.getType()).getParts().get(partname);
}
public OActivity compile(Activity child) throws CompilationException {
@@ -251,7 +251,7 @@
public void registerElementVar(String name, QName type) {
OElementVarType varType = new OElementVarType(getOProcess(), type);
OScope.Variable var = new OScope.Variable(getOProcess(), varType);
- var.name = name;
+ var.setName(name);
_vars.put(name, var);
}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
index 1327105..45e4be5 100644
--- a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/GoodCompileTest.java
@@ -24,277 +24,283 @@
import java.net.URL;
import org.apache.ode.bpel.compiler.api.CompileListener;
+import org.apache.ode.bpel.obj.OProcess;
import org.junit.Assert;
import org.junit.Test;
-public class GoodCompileTest extends AbstractCompileTestCase implements CompileListener {
-
- public void runTest(String bpel) throws Exception {
- try {
- Class testClass = getClass();
- URL url = testClass.getResource(bpel);
- URI uri = url.toURI();
- String path = uri.getPath();
- File bpelFile = new File(path);
- _compiler.compile(bpelFile, 0);
- } catch (Exception ex) {
- ex.printStackTrace();
- Assert.fail("Compilation did not succeed.");
- }
- }
-
- @Test
- public void testAssign1_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign1-2.0.bpel");
- }
+public class GoodCompileTest extends AbstractCompileTestCase implements
+ CompileListener {
- @Test
- public void testAssign2_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign2-2.0.bpel");
- }
-
- @Test
- public void testAssign3_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign3-2.0.bpel");
- }
-
- @Test
- public void testAssign5_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign5-2.0.bpel");
- }
+ public void runTest(String bpel) throws Exception {
+ try {
+ Class testClass = getClass();
+ URL url = testClass.getResource(bpel);
+ URI uri = url.toURI();
+ String path = uri.getPath();
+ File bpelFile = new File(path);
+ OProcess origi = _compiler.compile2OProcess(bpelFile, 0);
+ String bpelPath = bpelFile.getAbsolutePath();
+ String cbpPath = bpelPath.substring(0, bpelPath.lastIndexOf("."))
+ + ".cbp";
+ _compiler.serializeOProcess(origi, cbpPath);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Compilation did not succeed.");
+ }
+ }
- @Test
- public void testAssign6_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign6-2.0.bpel");
- }
-
- @Test
- public void testAssign7_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign7-2.0.bpel");
- }
-
- @Test
- public void testAssign8_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign8-2.0.bpel");
- }
-
- @Test
- public void testAssign9_BPEL20() throws Exception {
- runTest("/2.0/good/assign/Assign9-2.0.bpel");
- }
-
- @Test
- public void testAsyncProcess() throws Exception {
- runTest("/2.0/good/AsyncProcess/AsyncProcess2.bpel");
- }
-
- @Test
- public void testCompensation1() throws Exception {
- runTest("/2.0/good/compensation/comp1-2.0.bpel");
- }
-
- @Test
- public void testCompensation2() throws Exception {
- runTest("/2.0/good/compensation/comp2-2.0.bpel");
- }
-
- @Test
- public void testFlow2() throws Exception {
- runTest("/2.0/good/flow/flow2-2.0.bpel");
- }
-
- @Test
- public void testFlow3() throws Exception {
- runTest("/2.0/good/flow/flow3-2.0.bpel");
- }
-
- @Test
- public void testFlow4() throws Exception {
- runTest("/2.0/good/flow/flow4-2.0.bpel");
- }
-
- @Test
- public void testFlow5() throws Exception {
- runTest("/2.0/good/flow/flow5-2.0.bpel");
- }
-
- @Test
- public void testFlow6() throws Exception {
- runTest("/2.0/good/flow/flow6-2.0.bpel");
- }
-
- @Test
- public void testFlow7() throws Exception {
- runTest("/2.0/good/flow/flow7-2.0.bpel");
- }
-
- @Test
- public void testForEach1() throws Exception {
- runTest("/2.0/good/foreach/ForEach1-2.0.bpel");
- }
+ @Test
+ public void testAssign1_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign1-2.0.bpel");
+ }
- @Test
- public void testForEach2() throws Exception {
- runTest("/2.0/good/foreach/ForEach2-2.0.bpel");
- }
-
- @Test
- public void testForEach3() throws Exception {
- runTest("/2.0/good/foreach/ForEach3-2.0.bpel");
- }
-
- @Test
- public void testIf1() throws Exception {
- runTest("/2.0/good/if/If1-2.0.bpel");
- }
-
- @Test
- public void testIf2() throws Exception {
- runTest("/2.0/good/if/If2-2.0.bpel");
- }
-
- @Test
- public void testIf3() throws Exception {
- runTest("/2.0/good/if/If3-2.0.bpel");
- }
-
- @Test
- public void testPick3() throws Exception {
- runTest("/2.0/good/pick/Pick3-2.0.bpel");
- }
-
- @Test
- public void testPick4() throws Exception {
- runTest("/2.0/good/pick/Pick4-2.0.bpel");
- }
-
- @Test
- public void testPick5() throws Exception {
- runTest("/2.0/good/pick/Pick5-2.0.bpel");
- }
-
- @Test
- public void testPick6() throws Exception {
- runTest("/2.0/good/pick/Pick6-2.0.bpel");
- }
-
- @Test
- public void testRethrow1() throws Exception {
- runTest("/2.0/good/rethrow/Rethrow1-2.0.bpel");
- }
-
- @Test
- public void testRethrow2() throws Exception {
- runTest("/2.0/good/rethrow/Rethrow2-2.0.bpel");
- }
-
- @Test
- public void testThrow1() throws Exception {
- runTest("/2.0/good/throw/Throw1-2.0.bpel");
- }
+ @Test
+ public void testAssign2_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign2-2.0.bpel");
+ }
- @Test
- public void testThrow2() throws Exception {
- runTest("/2.0/good/throw/Throw2-2.0.bpel");
- }
-
- @Test
- public void testThrow3() throws Exception {
- runTest("/2.0/good/throw/Throw3-2.0.bpel");
- }
-
- @Test
- public void testThrow4() throws Exception {
- runTest("/2.0/good/throw/Throw4-2.0.bpel");
- }
-
- @Test
- public void testThrow5() throws Exception {
- runTest("/2.0/good/throw/Throw5-2.0.bpel");
- }
-
- @Test
- public void testThrow6() throws Exception {
- runTest("/2.0/good/throw/Throw6-2.0.bpel");
- }
-
- @Test
- public void testThrow7() throws Exception {
- runTest("/2.0/good/throw/Throw7-2.0.bpel");
- }
-
- @Test
- public void testWait1() throws Exception {
- runTest("/2.0/good/wait/Wait1-2.0.bpel");
- }
-
- @Test
- public void testWait2() throws Exception {
- runTest("/2.0/good/wait/Wait2-2.0.bpel");
- }
-
- @Test
- public void testWhile() throws Exception {
- runTest("/2.0/good/while/While1-2.0.bpel");
- }
-
- @Test
- public void testXPath10GetVariableData1() throws Exception {
- runTest("/2.0/good/xpath10-func/GetVariableData1-2.0.bpel");
- }
-
- @Test
- public void testXPath10GetVariableData2() throws Exception {
- runTest("/2.0/good/xpath10-func/GetVariableData2-2.0.bpel");
- }
-
- @Test
- public void testXPath10GetVariableData3() throws Exception {
- runTest("/2.0/good/xpath10-func/GetVariableData3-2.0.bpel");
- }
-
- @Test
- public void testXPath10GetVariableData4() throws Exception {
- runTest("/2.0/good/xpath10-func/GetVariableData4-2.0.bpel");
- }
-
- @Test
- public void testXPath10GetVariableProperty1() throws Exception {
- runTest("/2.0/good/xpath10-func/GetVariableProperty1-2.0.bpel");
- }
-
- @Test
- public void testXPath20GetVariableData2() throws Exception {
- runTest("/2.0/good/xpath20-func/GetVariableData2-xp2.0.bpel");
- }
-
- @Test
- public void testXPath20GetVariableData3() throws Exception {
- runTest("/2.0/good/xpath20-func/GetVariableData3-xp2.0.bpel");
- }
-
- @Test
- public void testXPath20GetVariableData4() throws Exception {
- runTest("/2.0/good/xpath20-func/GetVariableData4-xp2.0.bpel");
- }
-
- @Test
- public void testXPath20GetVariableProperty1() throws Exception {
- runTest("/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.bpel");
- }
-
- @Test
- public void testXSDImport() throws Exception {
- runTest("/2.0/good/xsd-import/helloworld-Server.bpel");
- }
-
- @Test
- public void testCircularReference() throws Exception {
- runTest("/2.0/good/circularReference/CircularReference.bpel");
- }
-
- @Test
- public void testMultipleEmbeddedSchemas() throws Exception {
- runTest("/org/apache/ode/bpel/compiler/MultipleEmbeddedSchemas.bpel");
- }
+ @Test
+ public void testAssign3_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign3-2.0.bpel");
+ }
+
+ @Test
+ public void testAssign5_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign5-2.0.bpel");
+ }
+
+ @Test
+ public void testAssign6_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign6-2.0.bpel");
+ }
+
+ @Test
+ public void testAssign7_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign7-2.0.bpel");
+ }
+
+ @Test
+ public void testAssign8_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign8-2.0.bpel");
+ }
+
+ @Test
+ public void testAssign9_BPEL20() throws Exception {
+ runTest("/2.0/good/assign/Assign9-2.0.bpel");
+ }
+
+ @Test
+ public void testAsyncProcess() throws Exception {
+ runTest("/2.0/good/AsyncProcess/AsyncProcess2.bpel");
+ }
+
+ @Test
+ public void testCompensation1() throws Exception {
+ runTest("/2.0/good/compensation/comp1-2.0.bpel");
+ }
+
+ @Test
+ public void testCompensation2() throws Exception {
+ runTest("/2.0/good/compensation/comp2-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow2() throws Exception {
+ runTest("/2.0/good/flow/flow2-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow3() throws Exception {
+ runTest("/2.0/good/flow/flow3-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow4() throws Exception {
+ runTest("/2.0/good/flow/flow4-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow5() throws Exception {
+ runTest("/2.0/good/flow/flow5-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow6() throws Exception {
+ runTest("/2.0/good/flow/flow6-2.0.bpel");
+ }
+
+ @Test
+ public void testFlow7() throws Exception {
+ runTest("/2.0/good/flow/flow7-2.0.bpel");
+ }
+
+ @Test
+ public void testForEach1() throws Exception {
+ runTest("/2.0/good/foreach/ForEach1-2.0.bpel");
+ }
+
+ @Test
+ public void testForEach2() throws Exception {
+ runTest("/2.0/good/foreach/ForEach2-2.0.bpel");
+ }
+
+ @Test
+ public void testForEach3() throws Exception {
+ runTest("/2.0/good/foreach/ForEach3-2.0.bpel");
+ }
+
+ @Test
+ public void testIf1() throws Exception {
+ runTest("/2.0/good/if/If1-2.0.bpel");
+ }
+
+ @Test
+ public void testIf2() throws Exception {
+ runTest("/2.0/good/if/If2-2.0.bpel");
+ }
+
+ @Test
+ public void testIf3() throws Exception {
+ runTest("/2.0/good/if/If3-2.0.bpel");
+ }
+
+ @Test
+ public void testPick3() throws Exception {
+ runTest("/2.0/good/pick/Pick3-2.0.bpel");
+ }
+
+ @Test
+ public void testPick4() throws Exception {
+ runTest("/2.0/good/pick/Pick4-2.0.bpel");
+ }
+
+ @Test
+ public void testPick5() throws Exception {
+ runTest("/2.0/good/pick/Pick5-2.0.bpel");
+ }
+
+ @Test
+ public void testPick6() throws Exception {
+ runTest("/2.0/good/pick/Pick6-2.0.bpel");
+ }
+
+ @Test
+ public void testRethrow1() throws Exception {
+ runTest("/2.0/good/rethrow/Rethrow1-2.0.bpel");
+ }
+
+ @Test
+ public void testRethrow2() throws Exception {
+ runTest("/2.0/good/rethrow/Rethrow2-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow1() throws Exception {
+ runTest("/2.0/good/throw/Throw1-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow2() throws Exception {
+ runTest("/2.0/good/throw/Throw2-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow3() throws Exception {
+ runTest("/2.0/good/throw/Throw3-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow4() throws Exception {
+ runTest("/2.0/good/throw/Throw4-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow5() throws Exception {
+ runTest("/2.0/good/throw/Throw5-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow6() throws Exception {
+ runTest("/2.0/good/throw/Throw6-2.0.bpel");
+ }
+
+ @Test
+ public void testThrow7() throws Exception {
+ runTest("/2.0/good/throw/Throw7-2.0.bpel");
+ }
+
+ @Test
+ public void testWait1() throws Exception {
+ runTest("/2.0/good/wait/Wait1-2.0.bpel");
+ }
+
+ @Test
+ public void testWait2() throws Exception {
+ runTest("/2.0/good/wait/Wait2-2.0.bpel");
+ }
+
+ @Test
+ public void testWhile() throws Exception {
+ runTest("/2.0/good/while/While1-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath10GetVariableData1() throws Exception {
+ runTest("/2.0/good/xpath10-func/GetVariableData1-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath10GetVariableData2() throws Exception {
+ runTest("/2.0/good/xpath10-func/GetVariableData2-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath10GetVariableData3() throws Exception {
+ runTest("/2.0/good/xpath10-func/GetVariableData3-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath10GetVariableData4() throws Exception {
+ runTest("/2.0/good/xpath10-func/GetVariableData4-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath10GetVariableProperty1() throws Exception {
+ runTest("/2.0/good/xpath10-func/GetVariableProperty1-2.0.bpel");
+ }
+
+ @Test
+ public void testXPath20GetVariableData2() throws Exception {
+ runTest("/2.0/good/xpath20-func/GetVariableData2-xp2.0.bpel");
+ }
+
+ @Test
+ public void testXPath20GetVariableData3() throws Exception {
+ runTest("/2.0/good/xpath20-func/GetVariableData3-xp2.0.bpel");
+ }
+
+ @Test
+ public void testXPath20GetVariableData4() throws Exception {
+ runTest("/2.0/good/xpath20-func/GetVariableData4-xp2.0.bpel");
+ }
+
+ @Test
+ public void testXPath20GetVariableProperty1() throws Exception {
+ runTest("/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.bpel");
+ }
+
+ @Test
+ public void testXSDImport() throws Exception {
+ runTest("/2.0/good/xsd-import/helloworld-Server.bpel");
+ }
+
+ @Test
+ public void testCircularReference() throws Exception {
+ runTest("/2.0/good/circularReference/CircularReference.bpel");
+ }
+
+ @Test
+ public void testMultipleEmbeddedSchemas() throws Exception {
+ runTest("/org/apache/ode/bpel/compiler/MultipleEmbeddedSchemas.bpel");
+ }
}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JavaSerializationTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JavaSerializationTest.java
new file mode 100644
index 0000000..eb4002d
--- /dev/null
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JavaSerializationTest.java
@@ -0,0 +1,57 @@
+package org.apache.ode.bpel.compiler_2_0;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.net.URI;
+import java.net.URL;
+
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.migrate.DeepEqualityHelper;
+import org.apache.ode.bpel.obj.migrate.DomElementComparator;
+import org.apache.ode.bpel.obj.migrate.ExtensibeImplEqualityComp;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory.SerializeFormat;
+import org.junit.Assert;
+
+public class JavaSerializationTest extends GoodCompileTest{
+ protected SerializeFormat format;
+ protected String pathSuffix;
+
+ public JavaSerializationTest(){
+ this.format = OmSerdeFactory.SerializeFormat.FORMAT_SERIALIZED_JAVA;
+ this.pathSuffix = "java";
+ }
+ public void runTest(String bpel) throws Exception {
+ try {
+ Class testClass = getClass();
+ URL url = testClass.getResource(bpel);
+ URI uri = url.toURI();
+ String path = uri.getPath();
+ File bpelFile = new File(path);
+ OProcess origi = _compiler.compile2OProcess(bpelFile, 0);
+ String bpelPath = bpelFile.getAbsolutePath();
+ String cbpPath = bpelPath.substring(0, bpelPath.lastIndexOf("."))
+ + "." + pathSuffix + ".cbp";
+ DeSerializer serializer = new DeSerializer();
+ serializer.serialize(new FileOutputStream(cbpPath),
+ origi, format);
+
+ DeSerializer deserializer = new DeSerializer(new File(cbpPath));
+ OProcess desered = deserializer.deserialize();
+
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ de.addCustomComparator(new ExtensibeImplEqualityComp());
+ de.addCustomComparator(new DomElementComparator());
+ boolean res = de.deepEquals(origi, desered);
+ assertEquals(Boolean.TRUE, res);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Compilation or deserialization did not succeed.");
+ }
+ }
+
+}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JsonSerializationTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JsonSerializationTest.java
new file mode 100644
index 0000000..dbdfe84
--- /dev/null
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/JsonSerializationTest.java
@@ -0,0 +1,10 @@
+package org.apache.ode.bpel.compiler_2_0;
+
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
+
+public class JsonSerializationTest extends JavaSerializationTest{
+ public JsonSerializationTest(){
+ this.format = OmSerdeFactory.SerializeFormat.FORMAT_SERIALIZED_JSON;
+ this.pathSuffix = "json";
+ }
+}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/MigrationTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/MigrationTest.java
new file mode 100644
index 0000000..970a351
--- /dev/null
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/MigrationTest.java
@@ -0,0 +1,75 @@
+package org.apache.ode.bpel.compiler_2_0;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.migrate.DeepEqualityHelper;
+import org.apache.ode.bpel.obj.migrate.DomElementComparator;
+import org.apache.ode.bpel.obj.migrate.ExtensibeImplEqualityComp;
+import org.apache.ode.bpel.obj.migrate.ObjectTraverser;
+import org.apache.ode.bpel.obj.migrate.UpgradeChecker;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class MigrationTest extends GoodCompileTest{
+ private static final Log __log = LogFactory.getLog(MigrationTest.class);
+
+ /**
+ * compare compiled OProcess with migrated ones.
+ */
+ public void runTest(String bpel) throws Exception {
+ try {
+ Class testClass = getClass();
+ URL url = testClass.getResource(bpel);
+ URI uri = url.toURI();
+ String path = uri.getPath();
+ File bpelFile = new File(path);
+ String cbpPath = bpel.substring(0, bpel.lastIndexOf(".")) + ".cbp";
+ String oldCbpPath = "/oldcbp" + cbpPath;
+ File oldCbpFile = new File(testClass.getResource(oldCbpPath).getFile());
+
+ OProcess nu = _compiler.compile2OProcess(bpelFile, 0);
+ __log.debug("compiled new OProcess " + nu.getFieldContainer());
+
+ DeSerializer deSerializer = new DeSerializer(oldCbpFile);
+ OProcess migrated = deSerializer.deserialize();
+ __log.debug("Read and migrated old OProcess " + migrated.getFieldContainer());
+
+ //check
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ de.addCustomComparator(new ExtensibeImplEqualityComp());
+ de.addCustomComparator(new DomElementComparator());
+ boolean res = de.deepEquals(nu, migrated);
+ assertEquals(Boolean.TRUE, res);
+
+ UpgradeChecker checker = new UpgradeChecker();
+ ObjectTraverser traverser = new ObjectTraverser();
+ traverser.accept(checker);
+ traverser.traverseObject(migrated);
+ assertEquals(true, checker.isNewest());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ Assert.fail("Compilation or migration did not succeed.");
+ }
+ }
+
+
+ @Test
+ public void testCompensation1() throws Exception {
+ //skip this test for no corresponding cbp from 1.3.x
+// runTest("/2.0/good/compensation/comp1-2.0.bpel");
+ }
+
+ @Test
+ public void testMultipleEmbeddedSchemas() throws Exception {
+ //skip this test for no corresponding cbp from 1.3.x
+// runTest("/org/apache/ode/bpel/compiler/MultipleEmbeddedSchemas.bpel");
+ }
+}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/SmileSerializationTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/SmileSerializationTest.java
new file mode 100644
index 0000000..47de594
--- /dev/null
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/SmileSerializationTest.java
@@ -0,0 +1,11 @@
+package org.apache.ode.bpel.compiler_2_0;
+
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
+
+public class SmileSerializationTest extends JavaSerializationTest{
+ public SmileSerializationTest(){
+ this.format = OmSerdeFactory.SerializeFormat.FORMAT_SERIALIZED_SMILE;
+ this.pathSuffix = "smile";
+
+ }
+}
diff --git a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/XslTest.java b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/XslTest.java
index ae95cc3..963a0e5 100644
--- a/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/XslTest.java
+++ b/bpel-compiler/src/test/java/org/apache/ode/bpel/compiler_2_0/XslTest.java
@@ -28,8 +28,8 @@
import org.apache.ode.bpel.compiler.DefaultResourceFinder;
import org.apache.ode.bpel.compiler.ResourceFinder;
import org.apache.ode.bpel.compiler.bom.BpelObjectFactory;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.StreamUtils;
import org.junit.After;
@@ -63,18 +63,18 @@
public void testUTFEncoding() throws Exception {
Document original = DOMUtils.parse(getClass().getResourceAsStream("/xslt/test-utf8.xslt"));
OProcess op = compile("xsl-utf8");
- OXslSheet sheet = op.xslSheets.get(URI.create("test-utf8.xslt"));
+ OXslSheet sheet = op.getXslSheets().get(URI.create("test-utf8.xslt"));
Assert.assertNotNull(sheet);
- Assert.assertEquals(DOMUtils.domToString(original), sheet.sheetBody);
+ Assert.assertEquals(DOMUtils.domToString(original), sheet.getSheetBody());
}
@Test
public void testISOEncoding() throws Exception {
Document original = DOMUtils.parse(getClass().getResourceAsStream("/xslt/test-iso.xslt"));
OProcess op = compile("xsl-iso");
- OXslSheet sheet = op.xslSheets.get(URI.create("test-iso.xslt"));
+ OXslSheet sheet = op.getXslSheets().get(URI.create("test-iso.xslt"));
Assert.assertNotNull(sheet);
- Assert.assertEquals(DOMUtils.domToString(original), sheet.sheetBody);
+ Assert.assertEquals(DOMUtils.domToString(original), sheet.getSheetBody());
}
private OProcess compile(String bpelFile) throws Exception {
diff --git a/bpel-compiler/src/test/resources/log4j.properties b/bpel-compiler/src/test/resources/log4j.properties
index 0f6f26d..8fa716e 100644
--- a/bpel-compiler/src/test/resources/log4j.properties
+++ b/bpel-compiler/src/test/resources/log4j.properties
@@ -21,7 +21,7 @@
#
# The logging properties used during tests..
#
-log4j.rootLogger=INFO, file
+log4j.rootLogger=DEBUG, file
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.File=target/test/test.log
@@ -31,6 +31,3 @@
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p (%13F:%L) %3x - %m%n
-
-log4j.category.org.apache.ode=INFO
-
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/AsyncProcess/AsyncProcess2.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/AsyncProcess/AsyncProcess2.cbp
new file mode 100644
index 0000000..dd1a43e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/AsyncProcess/AsyncProcess2.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign1-2.0.cbp
new file mode 100644
index 0000000..71235ec
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign2-2.0.cbp
new file mode 100644
index 0000000..67b8b52
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign3-2.0.cbp
new file mode 100644
index 0000000..2567dba
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign5-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign5-2.0.cbp
new file mode 100644
index 0000000..1687bdf
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign5-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign6-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign6-2.0.cbp
new file mode 100644
index 0000000..03666d5
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign6-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign7-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign7-2.0.cbp
new file mode 100644
index 0000000..c9c2e48
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign7-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign8-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign8-2.0.cbp
new file mode 100644
index 0000000..3ca4459
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign8-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign9-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign9-2.0.cbp
new file mode 100644
index 0000000..e787e57
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/assign/Assign9-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/circularReference/CircularReference.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/circularReference/CircularReference.cbp
new file mode 100644
index 0000000..6afb95f
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/circularReference/CircularReference.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/compensation/comp2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/compensation/comp2-2.0.cbp
new file mode 100644
index 0000000..aaf0738
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/compensation/comp2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow2-2.0.cbp
new file mode 100644
index 0000000..8ba382a
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow3-2.0.cbp
new file mode 100644
index 0000000..eb05b9d
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow4-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow4-2.0.cbp
new file mode 100644
index 0000000..434a5da
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow4-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow5-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow5-2.0.cbp
new file mode 100644
index 0000000..37ec936
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow5-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow6-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow6-2.0.cbp
new file mode 100644
index 0000000..742388e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow6-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow7-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow7-2.0.cbp
new file mode 100644
index 0000000..e1f2854
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/flow/flow7-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach1-2.0.cbp
new file mode 100644
index 0000000..b7298e1
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach2-2.0.cbp
new file mode 100644
index 0000000..b845af3
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach3-2.0.cbp
new file mode 100644
index 0000000..221bb8a
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/foreach/ForEach3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If1-2.0.cbp
new file mode 100644
index 0000000..a11b7be
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If2-2.0.cbp
new file mode 100644
index 0000000..c0f6457
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If3-2.0.cbp
new file mode 100644
index 0000000..e396d97
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/if/If3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick3-2.0.cbp
new file mode 100644
index 0000000..e6d6076
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick4-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick4-2.0.cbp
new file mode 100644
index 0000000..b1ae6c7
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick4-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick5-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick5-2.0.cbp
new file mode 100644
index 0000000..d3ab996
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick5-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick6-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick6-2.0.cbp
new file mode 100644
index 0000000..b406dce
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/pick/Pick6-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow1-2.0.cbp
new file mode 100644
index 0000000..d650aa8
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow2-2.0.cbp
new file mode 100644
index 0000000..5cfde42
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/rethrow/Rethrow2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw1-2.0.cbp
new file mode 100644
index 0000000..cecfc2e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw2-2.0.cbp
new file mode 100644
index 0000000..aeb63f8
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw3-2.0.cbp
new file mode 100644
index 0000000..84b1997
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw4-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw4-2.0.cbp
new file mode 100644
index 0000000..0d5e426
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw4-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw5-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw5-2.0.cbp
new file mode 100644
index 0000000..6b0c9a1
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw5-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw6-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw6-2.0.cbp
new file mode 100644
index 0000000..6c9cc71
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw6-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw7-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw7-2.0.cbp
new file mode 100644
index 0000000..1740d09
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/throw/Throw7-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait1-2.0.cbp
new file mode 100644
index 0000000..3529a69
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait2-2.0.cbp
new file mode 100644
index 0000000..c6ce30e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/wait/Wait2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/while/While1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/while/While1-2.0.cbp
new file mode 100644
index 0000000..bb5202a
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/while/While1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData1-2.0.cbp
new file mode 100644
index 0000000..5be5134
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData2-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData2-2.0.cbp
new file mode 100644
index 0000000..489c301
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData2-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData3-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData3-2.0.cbp
new file mode 100644
index 0000000..1e2cea3
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData3-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData4-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData4-2.0.cbp
new file mode 100644
index 0000000..9cac3e3
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableData4-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableProperty1-2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableProperty1-2.0.cbp
new file mode 100644
index 0000000..ec5c18e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath10-func/GetVariableProperty1-2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData2-xp2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData2-xp2.0.cbp
new file mode 100644
index 0000000..c2b5179
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData2-xp2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData3-xp2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData3-xp2.0.cbp
new file mode 100644
index 0000000..f0bb039
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData3-xp2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData4-xp2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData4-xp2.0.cbp
new file mode 100644
index 0000000..f8c6388
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableData4-xp2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.cbp
new file mode 100644
index 0000000..c0c841e
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xpath20-func/GetVariableProperty1-xp2.0.cbp
Binary files differ
diff --git a/bpel-compiler/src/test/resources/oldcbp/2.0/good/xsd-import/helloworld-Server.cbp b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xsd-import/helloworld-Server.cbp
new file mode 100644
index 0000000..edcf2d4
--- /dev/null
+++ b/bpel-compiler/src/test/resources/oldcbp/2.0/good/xsd-import/helloworld-Server.cbp
Binary files differ
diff --git a/bpel-epr/src/main/java/org/apache/ode/bpel/epr/WSAEndpoint.java b/bpel-epr/src/main/java/org/apache/ode/bpel/epr/WSAEndpoint.java
index 7d8d6da..9a50bdf 100644
--- a/bpel-epr/src/main/java/org/apache/ode/bpel/epr/WSAEndpoint.java
+++ b/bpel-epr/src/main/java/org/apache/ode/bpel/epr/WSAEndpoint.java
@@ -185,7 +185,7 @@
try {
serviceNS = _eprElmt.getOwnerDocument().lookupNamespaceURI(prefix);
} catch (Exception e) {
- e.printStackTrace();
+ __log.error(e.getMessage(), e);
}
// Lookup failed, checking directly on our element
if (serviceNS == null) {
diff --git a/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java b/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
index 5697422..cc519bd 100644
--- a/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
+++ b/bpel-epr/src/main/java/org/apache/ode/il/config/OdeConfigProperties.java
@@ -189,7 +189,7 @@
try {
fis.close();
} catch (Exception ex) {
- ex.printStackTrace();
+ __log.error(ex.getMessage(), ex);
}
}
} else {
diff --git a/bpel-epr/src/main/java/org/apache/ode/il/dbutil/H2EmbeddedDB.java b/bpel-epr/src/main/java/org/apache/ode/il/dbutil/H2EmbeddedDB.java
index fea740d..e75cdcc 100644
--- a/bpel-epr/src/main/java/org/apache/ode/il/dbutil/H2EmbeddedDB.java
+++ b/bpel-epr/src/main/java/org/apache/ode/il/dbutil/H2EmbeddedDB.java
@@ -35,7 +35,7 @@
}
/**
- * Initialize embedded (DERBY) database.
+ * Initialize embedded (H2) database.
*/
@Override
protected void initDataSource() throws DatabaseConfigException {
@@ -47,7 +47,7 @@
hds.setUser("sa");
_datasource = hds;
} else {
- _dbUrl = "jdbc:h2:" + _workRoot + File.separator + db;
+ _dbUrl = "jdbc:h2:" + _workRoot + File.separator + db + ";DB_CLOSE_ON_EXIT=FALSE";
if (!_odeConfig.isDbEmbeddedCreate()) {
_dbUrl += ";IFEXISTS=TRUE";
}
diff --git a/bpel-nobj/Readme.md b/bpel-nobj/Readme.md
new file mode 100644
index 0000000..a9b4874
--- /dev/null
+++ b/bpel-nobj/Readme.md
@@ -0,0 +1,41 @@
+OModel
+=====
+Basically, the OModel class uses a map as container of all fields,
+and handles different serialization format\: java, json, smile. the latter
+two are with help with jackson.
+
+Migration and upgrade are also handled in this module. Testcases of
+Serialization and migration are involved with compiler, so main testcases
+are in bpel-compile module.
+
+Serialization File Format
+---------
+New OModel has the same magic number and is different with old OModel.
+Deserializer tell if it's old or new OModel by it's magic number. Magic
+number and some other infomation are stored in file header. Serialized files
+are as following:
+
+```
+ | Magic number |
+ |---------------|
+ | other headers |
+ |---------------|
+ | OProcess |
+
+```
+The magic number can be used to distinct new and old omodel.
+<code>Deserializer</code> is responsible for (de)serialize the while file.
+Since old serialization format serialize magic number the same position as
+we had here, <code>DeSerializer</code> can handle both old and new cbp files.
+
+The new OModel support three format to (de)serialize OProcess. which are java,
+json and smile. Corresponding <code>OmSerializer</code> and <code>OmDeserializer
+</code> are implemented respectly.
+format information are stored in file header. When deserialize, it will
+seek for corresponding deserializer. File extensions are not used to
+specify format. The default serialization format is java currently. Hope to
+be configurable soon.
+
+Migrations are done when deserialize Old omodel. upgrade to newest new omodel
+are checked and done(if necessary) when deserialize. And if specified, the
+upgraded OProcess will be writeback. (problems with the caller yet)
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10Expression.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10Expression.java
new file mode 100644
index 0000000..809c2d1
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10Expression.java
@@ -0,0 +1,375 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.elang.xpath10.obj;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.ExtensibleImpl;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
+import org.apache.ode.bpel.obj.OXslSheet;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+import org.apache.ode.utils.NSContext;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Jaxen-based compiled-xpath representation for XPATH 1.0 expression language.
+ */
+public class OXPath10Expression extends OLValueExpression implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ /** Map from query name to variable declaration. */
+ private static final String VARS = "vars";
+ private static final String PROPERTIES = "properties";
+
+ private static final String LINKS = "links";
+ /** Map getVariableData invocation signature to compiled objects. */
+ private final String GETVARIABLEDATASIGS = "_getVariableDataSigs";
+ private static final String XPATH = "xpath";
+
+ private static final String NAMESPACECTX = "namespaceCtx";
+ /** QName of the <code>bpws:getVariableData</code> function. */
+ private static final String QNAME_GETVARIABLEDATA = "qname_getVariableData";
+
+ /** QName of the <code>bpws:getVariableData</code> function. */
+ private static final String QNAME_GETVARIABLEPROPERTY = "qname_getVariableProperty";
+ /** QName of the <code>bpws:getVariableData</code> function. */
+ private static final String QNAME_GETLINKSTATUS = "qname_getLinkStatus";
+
+ private static final String XSLSHEETS = "xslSheets";
+
+ @JsonCreator
+ public OXPath10Expression(){}
+ public OXPath10Expression(OProcess owner, QName qname_getVariableData,
+ QName qname_getVariableProperty, QName qname_getLinkStatus) {
+ super(owner);
+ setQname_getLinkStatus(qname_getLinkStatus);
+ setQname_getVariableData(qname_getVariableData);
+ setQname_getVariableProperty(qname_getVariableProperty);
+ setVars(new HashMap<String,Variable>());
+ setProperties(new HashMap<String, OProperty>());
+ setLinks(new HashMap<String, OLink>());
+ setXslSheets(new HashMap<URI, OXslSheet>());
+ setGetVariableDataSigs(new HashMap<SigGetVariableData,OSigGetVariableData>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ private HashMap<SigGetVariableData,OSigGetVariableData> getGetVariableDataSigs(){
+ Object o = fieldContainer.get(GETVARIABLEDATASIGS);
+ return o == null ? null : (HashMap<SigGetVariableData,OSigGetVariableData>)o;
+ }
+ private void setGetVariableDataSigs(HashMap<SigGetVariableData,OSigGetVariableData> dataSigs){
+ fieldContainer.put(GETVARIABLEDATASIGS, dataSigs);
+ }
+ /**
+ * Add a compiled representation for a certain <code>bpws:getVariableData(...)</code> call.
+ * @param varname variable name
+ * @param partname part name
+ * @param location location query
+ * @param compiled compiled representation
+ */
+ public void addGetVariableDataSig(String varname, String partname,
+ String location, OSigGetVariableData compiled) {
+ getGetVariableDataSigs().put(new SigGetVariableData(varname, partname,
+ location), compiled);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String, OLink> getLinks() {
+ Object o = fieldContainer.get(LINKS);
+ return o == null ? null : (HashMap<String, OLink>)o;
+ }
+
+ @JsonIgnore
+ public NSContext getNamespaceCtx() {
+ Object o = fieldContainer.get(NAMESPACECTX);
+ return o == null ? null : (NSContext)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String, OProperty> getProperties() {
+ Object o = fieldContainer.get(PROPERTIES);
+ return o == null ? null : (HashMap<String, OProperty>)o;
+ }
+
+ @JsonIgnore
+ public QName getQname_getLinkStatus() {
+ Object o = fieldContainer.get(QNAME_GETLINKSTATUS);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQname_getVariableData() {
+ Object o = fieldContainer.get(QNAME_GETVARIABLEDATA);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQname_getVariableProperty() {
+ Object o = fieldContainer.get(QNAME_GETVARIABLEPROPERTY);
+ return o == null ? null : (QName)o;
+ }
+
+ /**
+ * @see org.apache.ode.bpel.o.OLValueExpression#getVariable()
+ */
+ @JsonIgnore
+ public Variable getVariable() {
+ if (getVars().size() == 0)
+ throw new IllegalStateException(
+ "LValue must have one variable reference.");
+ // We're interested in the first variable referenced by the LValue
+ for (String varName : getVars().keySet()) {
+ if (getXpath().substring(1, getXpath().length()).startsWith(varName))
+ return getVars().get(varName);
+ }
+ throw new IllegalStateException(
+ "Either the expression doesn't start with a variable reference or "
+ + "the reference is unknow.");
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String, Variable> getVars() {
+ Object o = fieldContainer.get(VARS);
+ return o == null ? null : (HashMap<String, Variable>)o;
+ }
+
+ @JsonIgnore
+ public String getXpath() {
+ Object o = fieldContainer.get(XPATH);
+ return o == null ? null : (String)o;
+ }
+
+ public OXslSheet getXslSheet(URI projectRelativeXslUri) {
+ return getXslSheets().get(projectRelativeXslUri);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ protected HashMap<URI, OXslSheet> getXslSheets() {
+ Object o = fieldContainer.get(XSLSHEETS);
+ return o == null ? null : (HashMap<URI, OXslSheet>)o;
+ }
+
+ /**
+ * Get the compiled representation of a certain <code>bpws:getVariableData(...)</code> call.
+ * @param varname variable name
+ * @param partname part name
+ * @param location location query
+ * @return compiled representation, or <code>null</code> if none found
+ */
+ public OSigGetVariableData resolveGetVariableDataSig(String varname,
+ String partname, String location) {
+ SigGetVariableData key = new SigGetVariableData(varname, partname,
+ location);
+ return getGetVariableDataSigs().get(key);
+ }
+
+ public void setLinks(HashMap<String, OLink> links) {
+ fieldContainer.put(LINKS, links);
+ }
+
+ public void setNamespaceCtx(NSContext namespaceCtx) {
+ fieldContainer.put(NAMESPACECTX, namespaceCtx);
+ }
+
+ public void setProperties(HashMap<String, OProperty> properties) {
+ fieldContainer.put(PROPERTIES, properties);
+ }
+
+ public void setQname_getLinkStatus(QName qname_getLinkStatus) {
+ fieldContainer.put(QNAME_GETLINKSTATUS, qname_getLinkStatus);
+ }
+
+ public void setQname_getVariableData(QName qname_getVariableData) {
+ fieldContainer.put(QNAME_GETVARIABLEDATA, qname_getVariableData);
+ }
+
+ public void setQname_getVariableProperty(QName qname_getVariableProperty) {
+ fieldContainer
+ .put(QNAME_GETVARIABLEPROPERTY, qname_getVariableProperty);
+ }
+
+ public void setVars(HashMap<String, Variable> vars) {
+ fieldContainer.put(VARS, vars);
+ }
+
+ public void setXpath(String xpath) {
+ fieldContainer.put(XPATH, xpath);
+ }
+
+ public void setXslSheet(URI projectRelativeXslUri, OXslSheet xslSheet) {
+ getXslSheets().put(projectRelativeXslUri, xslSheet);
+ }
+
+ protected void setXslSheets(HashMap<URI, OXslSheet> xslSheets) {
+ fieldContainer.put(XSLSHEETS, xslSheets);
+ }
+
+ public String toString() {
+ Object o = "}";
+ return o == null ? null : "{OXPath10Expression " + getXpath() +o;
+ }
+
+ /**
+ * Data structure representing the compiled signature of a <code>bpws:getVariableData</code>
+ * invocation.
+ */
+ public static class OSigGetVariableData extends OBase implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private static final String VARIABLE = "variable";
+ private static final String PART = "part";
+
+ private static final String LOCATION = "location";
+
+ @JsonCreator
+ public OSigGetVariableData(){}
+ public OSigGetVariableData(OProcess owner, OScope.Variable variable,
+ OMessageVarType.Part part, OExpression location) {
+ super(owner);
+ setVariable(variable);
+ setPart(part);
+ setLocation(location);
+ }
+
+ @JsonIgnore
+ public OExpression getLocation() {
+ Object o = fieldContainer.get(LOCATION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public Part getPart() {
+ Object o = fieldContainer.get(PART);
+ return o == null ? null : (Part)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setLocation(OExpression location) {
+ fieldContainer.put(LOCATION, location);
+ }
+
+ public void setPart(Part part) {
+ fieldContainer.put(PART, part);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+ }
+
+ /**
+ * Data structure representing the signature of a <code>bpws:getVariableData</code>
+ * invocation.
+ */
+ public static class SigGetVariableData extends ExtensibleImpl implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private final String VARNAME = "varname";
+ private final String PARTNAME = "partname";
+ private final String LOCATION = "location";
+
+ @JsonCreator
+ public SigGetVariableData(){}
+ private SigGetVariableData(String varname, String partname,
+ String location) {
+ setVarname(varname);
+ setPartname(partname);
+ setLocation(location);
+ }
+
+ public boolean equals(Object obj) {
+ SigGetVariableData other = (SigGetVariableData) obj;
+ if (getVarname() != null
+ && (other.getVarname() == null || !getVarname().equals(other.getVarname())))
+ return false;
+ if (getPartname() != null
+ && (other.getPartname() == null || !getPartname()
+ .equals(other.getPartname())))
+ return false;
+ if (getLocation() != null
+ && (other.getLocation() == null || !getLocation()
+ .equals(other.getLocation())))
+ return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int hashCode = 0;
+ if (getVarname() != null)
+ hashCode ^= getVarname().hashCode();
+ if (getPartname() != null)
+ hashCode ^= getPartname().hashCode();
+ if (getLocation() != null)
+ hashCode ^= getLocation().hashCode();
+ return hashCode;
+ }
+
+ @JsonIgnore
+ private String getVarname() {
+ return (String)fieldContainer.get(VARNAME);
+ }
+
+ @JsonIgnore
+ private String getPartname() {
+ return (String)fieldContainer.get(PARTNAME);
+ }
+
+ @JsonIgnore
+ private String getLocation() {
+ return (String)fieldContainer.get(LOCATION);
+ }
+
+ private void setVarname(String varname) {
+ fieldContainer.put(VARNAME, varname);
+
+ }
+ private void setPartname(String partname){
+ fieldContainer.put(PARTNAME, partname);
+ }
+ private void setLocation(String location){
+ fieldContainer.put(LOCATION, location);
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10ExpressionBPEL20.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10ExpressionBPEL20.java
new file mode 100644
index 0000000..85efcd7
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath10/obj/OXPath10ExpressionBPEL20.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.elang.xpath10.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.obj.OProcess;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Jaxen-based compiled-xpath representation for XPATH 1.0 expression language.
+ */
+public class OXPath10ExpressionBPEL20 extends OXPath10Expression implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ /** QName of the <code>bpws:getVariableData</code> function. */
+ private static final String QNAME_DOXSLTRANSFORM = "qname_doXslTransform";
+
+ /** Flags this expression as a joinCondition */
+ private static final String ISJOINEXPRESSION = "isJoinExpression";
+
+ @JsonCreator
+ public OXPath10ExpressionBPEL20(){
+ setIsJoinExpression(false);
+ }
+ public OXPath10ExpressionBPEL20(OProcess owner,
+ QName qname_getVariableData, QName qname_getVariableProperty,
+ QName qname_getLinkStatus, QName qname_doXslTransform,
+ boolean isJoinExpression) {
+ super(owner, qname_getVariableData, qname_getVariableProperty,
+ qname_getLinkStatus);
+ setQname_doXslTransform(qname_doXslTransform);
+ setIsJoinExpression(isJoinExpression);
+ }
+
+ @JsonIgnore
+ public boolean isIsJoinExpression() {
+ Object o = fieldContainer.get(ISJOINEXPRESSION);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public QName getQname_doXslTransform() {
+ Object o = fieldContainer.get(QNAME_DOXSLTRANSFORM);
+ return o == null ? null : (QName)o;
+ }
+
+ public void setIsJoinExpression(boolean isJoinExpression) {
+ fieldContainer.put(ISJOINEXPRESSION, isJoinExpression);
+ }
+
+ public void setQname_doXslTransform(QName qname_doXslTransform) {
+ fieldContainer.put(QNAME_DOXSLTRANSFORM, qname_doXslTransform);
+ }
+
+ public String toString() {
+ return "{OXPath10Expression " + getXpath() + "}";
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath20/obj/OXPath20ExpressionBPEL20.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath20/obj/OXPath20ExpressionBPEL20.java
new file mode 100644
index 0000000..8c77096
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xpath20/obj/OXPath20ExpressionBPEL20.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.elang.xpath20.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import net.sf.saxon.expr.Expression;
+
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OProcess;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * @author mriou <mriou at apache dot org>
+ */
+public class OXPath20ExpressionBPEL20 extends OXPath10ExpressionBPEL20 implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private final String COMPILEDEXPR = "_compiledExpr";
+
+ @JsonCreator
+ public OXPath20ExpressionBPEL20(){}
+ public OXPath20ExpressionBPEL20(OProcess owner,
+ QName qname_getVariableData, QName qname_getVariableProperty,
+ QName qname_getLinkStatus, QName qname_doXslTransform,
+ boolean isJoinExpression) {
+ super(owner, qname_getVariableData, qname_getVariableProperty,
+ qname_getLinkStatus, qname_doXslTransform, isJoinExpression);
+ }
+
+ @JsonIgnore
+ public Expression getCompiledExpr() {
+ return (Expression)fieldContainer.get(COMPILEDEXPR);
+ }
+
+ public void setCompiledExpr(Expression compiledExpr) {
+ fieldContainer.put(COMPILEDEXPR, compiledExpr);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xquery10/obj/OXQuery10ExpressionBPEL20.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xquery10/obj/OXQuery10ExpressionBPEL20.java
new file mode 100644
index 0000000..64f1f93
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/elang/xquery10/obj/OXQuery10ExpressionBPEL20.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.elang.xquery10.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.obj.OProcess;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * A representation of an XQuery expression
+ */
+public class OXQuery10ExpressionBPEL20 extends OXPath20ExpressionBPEL20 implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private static final String XQUERY = "xquery";
+
+ @JsonCreator
+ public OXQuery10ExpressionBPEL20(){}
+ public OXQuery10ExpressionBPEL20(OProcess owner,
+ QName qname_getVariableData, QName qname_getVariableProperty,
+ QName qname_getLinkStatus, QName qname_doXslTransform,
+ boolean isJoinExpression) {
+ super(owner, qname_getVariableData, qname_getVariableProperty,
+ qname_getLinkStatus, qname_doXslTransform, isJoinExpression);
+ }
+
+ @JsonIgnore
+ public String getXquery() {
+ Object o = fieldContainer.get(XQUERY);
+ return o == null ? null : (String)o;
+ }
+
+ public void setXquery(String xquery) {
+ fieldContainer.put(XQUERY, xquery);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/DebugInfo.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/DebugInfo.java
new file mode 100644
index 0000000..d08b325
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/DebugInfo.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Information about the source that was used to create a compiled object.
+ */
+public class DebugInfo extends ExtensibleImpl implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /**
+ * Change log of class version
+ * initial 1
+ * current 2
+ *
+ * 1->2:
+ * sourceURI attribute is more meaningful
+ * */
+ public static final int CURRENT_CLASS_VERSION = 2;
+
+ /** Source file / resource name. */
+ private static final String SOURCEURI = "sourceURI";
+ /** Source line number (start). */
+ private static final String STARTLINE = "startLine";
+ private static final String DESCRIPTION = "description";
+ private static final String EXTENSIBILITYELEMENTS = "extensibilityElements";
+ /** Source line number (end). */
+ private static final String ENDLINE = "endLine";
+
+ @JsonCreator
+ public DebugInfo(){
+ setStartLine(0);
+ setEndLine(0);
+ }
+ public DebugInfo(String sourceURI, int startLine, int endLine,
+ Map<QName, Object> extElmt) {
+ setSourceURI(sourceURI);
+ setStartLine(startLine);
+ setEndLine(endLine);
+ if (extElmt != null && extElmt.size() > 0) {
+ setExtensibilityElements(new HashMap<QName, Object>(extElmt));
+ } else {
+ setExtensibilityElements(new HashMap<QName, Object>());
+ }
+ }
+
+ public DebugInfo(String sourceURI, int line, Map<QName, Object> extElmt) {
+ this(sourceURI, line, line, extElmt);
+ }
+
+ @JsonIgnore
+ public String getDescription() {
+ Object o = fieldContainer.get(DESCRIPTION);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public int getEndLine() {
+ Object o = fieldContainer.get(ENDLINE);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<QName, Object> getExtensibilityElements() {
+ return (HashMap<QName, Object>) fieldContainer
+ .get(EXTENSIBILITYELEMENTS);
+ }
+
+ @JsonIgnore
+ public String getSourceURI() {
+ Object o = fieldContainer.get(SOURCEURI);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public int getStartLine() {
+ Object o = fieldContainer.get(STARTLINE);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ public void setDescription(String description) {
+ fieldContainer.put(DESCRIPTION, description);
+ }
+
+ public void setEndLine(int endLine) {
+ fieldContainer.put(ENDLINE, endLine);
+ }
+
+ public void setExtensibilityElements(
+ HashMap<QName, Object> extensibilityElements) {
+ fieldContainer.put(EXTENSIBILITYELEMENTS, extensibilityElements);
+ }
+
+ public void setSourceURI(String sourceURI) {
+ fieldContainer.put(SOURCEURI, sourceURI);
+ }
+
+ public void setStartLine(int startLine) {
+ fieldContainer.put(STARTLINE, startLine);
+ }
+
+ @Override
+ public boolean equals(Object obj){
+ if (!(obj instanceof DebugInfo)) return false;
+ DebugInfo other = (DebugInfo)obj;
+ boolean eq = this.getStartLine() == other.getStartLine() &&
+ this.getEndLine() == other.getEndLine();
+ if (this.getOriginalVersion() == 0 || other.getOriginalVersion() == 0){
+ return eq;
+ }else{
+ return eq && this.getSourceURI().equals(other.getSourceURI());
+ }
+ }
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException{
+ ois.defaultReadObject();
+ fieldContainer.remove(DESCRIPTION);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/Extensible.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/Extensible.java
new file mode 100644
index 0000000..488e8cf
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/Extensible.java
@@ -0,0 +1,36 @@
+package org.apache.ode.bpel.obj;
+
+/**
+ * defines interfaces for add/del/get fields.
+ *
+ */
+public interface Extensible<T> {
+ /**
+ * Add or update a field to the extensible object.
+ *
+ * @param fieldName
+ * @param value
+ */
+ public void addField(String fieldName, T value);
+
+ /**
+ * Delete and return a field with given name.
+ *
+ * @param fieldName
+ * @return
+ */
+ public T delField(String fieldName);
+
+ /**
+ * Return field value of given field name
+ * @param fieldName
+ * @return
+ */
+ public T getField(String fieldName);
+
+ /**
+ * Upgrade to newest version of this class.
+ * @return
+ */
+ public void upgrade2Newest();
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ExtensibleImpl.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ExtensibleImpl.java
new file mode 100644
index 0000000..eab0a08
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ExtensibleImpl.java
@@ -0,0 +1,128 @@
+package org.apache.ode.bpel.obj;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.ode.bpel.obj.serde.jacksonhack.UniqueStringIdGenerator;
+
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+@JsonIdentityInfo(generator = UniqueStringIdGenerator.class, property = "@id")
+public class ExtensibleImpl implements Extensible<Object>, Serializable{
+ public static final long serialVersionUID = -1L;
+ public static final int CURRENT_CLASS_VERSION = 1;
+
+ /** The wrapper wraps fields. Fields can be deleted, added or updated */
+ transient protected Map<String, Object> fieldContainer;
+ /** Version of this class*/
+ private static final String CLASSVERSION = "classVersion";
+ /** Original version before migration*/
+ private static final String ORIGINALVERSION = "originalVersion";
+
+ protected ExtensibleImpl() {
+ this(new LinkedHashMap<String, Object>());
+ }
+ protected ExtensibleImpl(Map<String, Object> container) {
+ fieldContainer = container;
+ int currentVersion = 0;
+ try {
+ currentVersion = (Integer) this.getClass().getField("CURRENT_CLASS_VERSION").get(this);
+ } catch (Exception e) {
+ // should never get here
+ e.printStackTrace();
+ }
+ setClassVersion(currentVersion);
+ setOriginalVersion(currentVersion); //if this is called by deserializer, original will be set later.
+ }
+
+// @JsonAnyGetter
+ public Map<String, Object> getFieldContainer() {
+ return fieldContainer;
+ }
+ public void setFieldContainer(Map<String, Object> fieldContainer){
+ this.fieldContainer = fieldContainer;
+ }
+
+// @JsonAnySetter
+ public void addField(String name, Object value) {
+ fieldContainer.put(name, value);
+ }
+
+ public Object getField(String name) {
+ return fieldContainer.get(name);
+ }
+
+ @Override
+ public Object delField(String fieldName) {
+ return fieldContainer.remove(fieldName);
+ }
+
+ @JsonIgnore
+ public int getClassVersion() {
+ Object o = fieldContainer.get(CLASSVERSION);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ public void setClassVersion(int version) {
+ fieldContainer.put(CLASSVERSION, version);
+ }
+
+ @JsonIgnore
+ public int getOriginalVersion(){
+ Object o = fieldContainer.get(ORIGINALVERSION);
+ return o == null? -1 : (Integer)o;
+ }
+ public void setOriginalVersion(int version){
+ fieldContainer.put(ORIGINALVERSION, version);
+ }
+
+ private void writeObject(ObjectOutputStream oos) throws IOException{
+ oos.defaultWriteObject();
+ oos.writeInt(fieldContainer.size());
+ oos.writeObject(fieldContainer.getClass().getName());
+ for (String key : fieldContainer.keySet()){
+ oos.writeObject(key);
+ oos.writeObject(fieldContainer.get(key));
+ }
+ }
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException{
+ ois.defaultReadObject();
+ int size = ois.readInt();
+ String cls = (String)ois.readObject();
+ try {
+ fieldContainer = (Map<String, Object>)(Class.forName(cls).newInstance());
+ } catch (Exception e) {
+ //should never get here
+ e.printStackTrace();
+ }
+ for (int i = 0; i < size; i++){
+ String key = (String)ois.readObject();
+ Object value = ois.readObject();
+ fieldContainer.put(key, value);
+ }
+ }
+
+ @Override
+ public void upgrade2Newest(){
+ int version = getClassVersion();
+ int currentVersion = version;
+ try {
+ currentVersion = (Integer) this.getClass().getField("CURRENT_CLASS_VERSION").get(this);
+ } catch (Exception e) {
+ // should never get here
+ e.printStackTrace();
+ }
+ if (version == currentVersion) return;
+ if (version > currentVersion){
+ //should never get here.
+ throw new RuntimeException("class version is newer than newest!");
+ }
+ setClassVersion(currentVersion);
+ return;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OActivity.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OActivity.java
new file mode 100644
index 0000000..719b955
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OActivity.java
@@ -0,0 +1,186 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import de.danielbechler.diff.annotation.ObjectDiffProperty;
+
+/**
+ * Compiled represnetation of a BPEL activity.
+ */
+public abstract class OActivity extends OAgent implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String JOINCONDITION = "joinCondition";
+ private static final String SUPPRESSJOINFAILURE = "suppressJoinFailure";
+ private static final String SOURCELINKS = "sourceLinks";
+ private static final String TARGETLINKS = "targetLinks";
+ private static final String NAME = "name";
+ private static final String FAILUREHANDLING = "failureHandling";
+ private static final String PARENT = "parent";
+
+ @JsonCreator
+ public OActivity() {
+ setSuppressJoinFailure(false);
+ }
+
+ public OActivity(OProcess owner, OActivity parent) {
+ super(owner);
+ setParent(parent);
+ setSourceLinks(new HashSet<OLink>());
+ setTargetLinks(new HashSet<OLink>());
+ setSuppressJoinFailure(false);
+ }
+
+ @Override
+ public String digest() {
+ StringBuffer buf = new StringBuffer(getClass().getSimpleName());
+ buf.append('#');
+ buf.append(getId());
+ buf.append("{");
+ List<OAgent> l = new ArrayList<OAgent>();
+ l.addAll(getNested());
+ Collections.sort(l, new Comparator<OAgent>() {
+ public int compare(OAgent o1, OAgent o2) {
+ return key(o1).compareTo(key(o2));
+ }
+
+ private String key(OAgent o) {
+ return o.getClass().getSimpleName() + "#" + o.getId();
+ }
+ });
+
+ for (OAgent child : l) {
+ buf.append(child.digest());
+ buf.append(";");
+ }
+ buf.append("}");
+ return buf.toString();
+ }
+
+ @ObjectDiffProperty(ignore = true)
+ @JsonIgnore
+ public OFailureHandling getFailureHandling() {
+ OFailureHandling handling = (OFailureHandling) fieldContainer
+ .get(FAILUREHANDLING);
+ if (handling == null) {
+ OActivity parent = this.getParent();
+ while (parent != null && handling == null) {
+ handling = parent.getFailureHandling();
+ parent = parent.getParent();
+ }
+ }
+ return handling;
+ }
+
+ @JsonIgnore
+ public OExpression getJoinCondition() {
+ Object o = fieldContainer.get(JOINCONDITION);
+ return o == null ? null : (OExpression) o;
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String) o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OLink> getSourceLinks() {
+ Object o = fieldContainer.get(SOURCELINKS);
+ return o == null ? null : (Set<OLink>) o;
+ }
+
+ @JsonIgnore
+ public boolean isSuppressJoinFailure() {
+ Object o = fieldContainer.get(SUPPRESSJOINFAILURE);
+ return o == null ? null : (Boolean) o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OLink> getTargetLinks() {
+ Object o = fieldContainer.get(TARGETLINKS);
+ return o == null ? null : (Set<OLink>) o;
+ }
+
+ @JsonIgnore
+ public String getType() {
+ return getClass().getSimpleName();
+ }
+
+ public void setFailureHandling(OFailureHandling failureHandling) {
+ fieldContainer.put(FAILUREHANDLING, failureHandling);
+ }
+
+ public void setJoinCondition(OExpression joinCondition) {
+ fieldContainer.put(JOINCONDITION, joinCondition);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setSourceLinks(Set<OLink> sourceLinks) {
+ if (getSourceLinks() == null) {
+ fieldContainer.put(SOURCELINKS, sourceLinks);
+ }
+ }
+
+ public void setSuppressJoinFailure(boolean suppressJoinFailure) {
+ fieldContainer.put(SUPPRESSJOINFAILURE, suppressJoinFailure);
+ }
+
+ public void setTargetLinks(Set<OLink> targetLinks) {
+ if (getTargetLinks() == null) {
+ fieldContainer.put(TARGETLINKS, targetLinks);
+ }
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(super.toString());
+ if (getName() != null) {
+ buf.append('-');
+ buf.append(getName());
+ }
+
+ return buf.toString();
+ }
+
+ @JsonIgnore
+ public OActivity getParent() {
+ Object o = fieldContainer.get(PARENT);
+ return o == null ? null : (OActivity)o;
+ }
+
+ private void setParent(OActivity parent) {
+ fieldContainer.put(PARENT, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAgent.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAgent.java
new file mode 100644
index 0000000..a391b00
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAgent.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Base class for active BPEL agents.
+ */
+public class OAgent extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** Links entering this agent. */
+ private static final String INCOMINGLINKS = "incomingLinks";
+
+ /** Links exiting this agent. */
+ private static final String OUTGOINGLINKS = "outgoingLinks";
+
+ /** Variables read from. */
+ private static final String VARIABLERD = "variableRd";
+
+ /** Variables written to. */
+ private static final String VARIABLEWR = "variableWr";
+
+ /** The children of this agent. */
+ private static final String NESTED = "nested";
+
+ @JsonCreator
+ public OAgent(){
+ }
+ public OAgent(OProcess owner) {
+ super(owner);
+ setIncomingLinks(new HashSet<OLink>());
+ setOutgoingLinks(new HashSet<OLink>());
+ setVariableRd(new HashSet<OScope.Variable>());
+ setVariableWr(new HashSet<OScope.Variable>());
+ setNested(new HashSet<OAgent>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OLink> getIncomingLinks() {
+ Object o = fieldContainer.get(INCOMINGLINKS);
+ return o == null ? null : (Set<OLink>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OAgent> getNested() {
+ Object o = fieldContainer.get(NESTED);
+ return o == null ? null : (Set<OAgent>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OLink> getOutgoingLinks() {
+ Object o = fieldContainer.get(OUTGOINGLINKS);
+ return o == null ? null : (Set<OLink>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OScope.Variable> getVariableRd() {
+ Object o = fieldContainer.get(VARIABLERD);
+ return o == null ? null : (Set<OScope.Variable>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OScope.Variable> getVariableWr() {
+ Object o = fieldContainer.get(VARIABLEWR);
+ return o == null ? null : (Set<OScope.Variable>)o;
+ }
+
+ public void setIncomingLinks(Set<OLink> incomingLinks) {
+ if (getIncomingLinks() == null){
+ fieldContainer.put(INCOMINGLINKS, incomingLinks);
+ }
+ }
+
+ public void setNested(Set<OAgent> nested) {
+ if (getNested() == null){
+ fieldContainer.put(NESTED, nested);
+ }
+ }
+
+ public void setOutgoingLinks(Set<OLink> outgoingLinks) {
+ if (getOutgoingLinks() == null){
+ fieldContainer.put(OUTGOINGLINKS, outgoingLinks);
+ }
+ }
+
+ public void setVariableRd(Set<OScope.Variable> variableRd) {
+ if (getVariableRd() == null){
+ fieldContainer.put(VARIABLERD, variableRd);
+ }
+ }
+
+ public void setVariableWr(Set<OScope.Variable> variableWr) {
+ if (getVariableWr() == null){
+ fieldContainer.put(VARIABLEWR, variableWr);
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAssign.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAssign.java
new file mode 100644
index 0000000..8db6375
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OAssign.java
@@ -0,0 +1,489 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OPropertyAlias;
+import org.apache.ode.bpel.obj.OScope.Variable;
+import org.w3c.dom.Document;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class OAssign extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String COPY = "copy";
+
+ @JsonCreator
+ public OAssign(){
+ }
+ public OAssign(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setCopy(new ArrayList<Copy>());
+ }
+
+ @Override
+ public void dehydrate() {
+ super.dehydrate();
+ for (Copy copy : getCopy()) {
+ copy.dehydrate();
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<Copy> getCopy() {
+ Object o = fieldContainer.get(COPY);
+ return o == null ? null : (List<Copy>)o;
+ }
+
+ public void setCopy(List<Copy> copy) {
+ if (getCopy() == null){
+ fieldContainer.put(COPY, copy);
+ }
+ }
+
+ public String toString() {
+ return "{OAssign : " + getName() + ", joinCondition="
+ + getJoinCondition() + "}";
+ }
+
+ /**
+ * Assignmenet copy entry, i.e. what the assignment consits of.
+ */
+ public static class Copy extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String TO = "to";
+ private static final String FROM = "from";
+ private static final String KEEPSRCELEMENTNAME = "keepSrcElementName";
+ private static final String IGNOREMISSINGFROMDATA = "ignoreMissingFromData";
+ private static final String IGNOREUNINITIALIZEDFROMVARIABLE = "ignoreUninitializedFromVariable";
+ private static final String INSERTMISSINGTODATA = "insertMissingToData";
+
+ @JsonCreator
+ public Copy(){
+ initPrimitive();
+ }
+ public Copy(OProcess owner) {
+ super(owner);
+ initPrimitive();
+ }
+ private void initPrimitive(){
+ setIgnoreMissingFromData(false);
+ setIgnoreUninitializedFromVariable(false);
+ setInsertMissingToData(false);
+ setKeepSrcElementName(false);
+ }
+
+ @Override
+ public void dehydrate() {
+ super.dehydrate();
+ setTo(null);
+ setFrom(null);
+ }
+
+ @JsonIgnore
+ public RValue getFrom() {
+ Object o = fieldContainer.get(FROM);
+ return o == null ? null : (RValue)o;
+ }
+
+ @JsonIgnore
+ public boolean isIgnoreMissingFromData() {
+ Object o = fieldContainer.get(IGNOREMISSINGFROMDATA);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public boolean isIgnoreUninitializedFromVariable() {
+ return (Boolean) fieldContainer
+ .get(IGNOREUNINITIALIZEDFROMVARIABLE);
+ }
+
+ @JsonIgnore
+ public boolean isInsertMissingToData() {
+ Object o = fieldContainer.get(INSERTMISSINGTODATA);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public boolean isKeepSrcElementName() {
+ Object o = fieldContainer.get(KEEPSRCELEMENTNAME);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public LValue getTo() {
+ Object o = fieldContainer.get(TO);
+ return o == null ? null : (LValue)o;
+ }
+
+ public void setFrom(RValue from) {
+ fieldContainer.put(FROM, from);
+ }
+
+ public void setIgnoreMissingFromData(boolean ignoreMissingFromData) {
+ fieldContainer.put(IGNOREMISSINGFROMDATA, ignoreMissingFromData);
+ }
+
+ public void setIgnoreUninitializedFromVariable(
+ boolean ignoreUninitializedFromVariable) {
+ fieldContainer.put(IGNOREUNINITIALIZEDFROMVARIABLE,
+ ignoreUninitializedFromVariable);
+ }
+
+ public void setInsertMissingToData(boolean insertMissingToData) {
+ fieldContainer.put(INSERTMISSINGTODATA, insertMissingToData);
+ }
+
+ public void setKeepSrcElementName(boolean keepSrcElementName) {
+ fieldContainer.put(KEEPSRCELEMENTNAME, keepSrcElementName);
+ }
+
+ public void setTo(LValue to) {
+ fieldContainer.put(TO, to);
+ }
+
+ public String toString() {
+ return "{OCopy " + getTo() + "=" + getFrom() + "}";
+ }
+ }
+
+ /**
+ * Direct reference: selects named child of the message document element.
+ * This is used for access to extensions (SOAP headers for example).
+ * @author mszefler
+ */
+ public static class DirectRef extends OBase implements RValue, LValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ /** Referenced Variable */
+ private static final String VARIABLE = "variable";
+
+ /** Name of the element referenced. */
+ private static final String ELNAME = "elName";
+
+ @JsonCreator
+ public DirectRef(){}
+
+ public DirectRef(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public QName getElName() {
+ Object o = fieldContainer.get(ELNAME);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public OScope.Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (OScope.Variable)o;
+ }
+
+ public void setElName(QName elName) {
+ fieldContainer.put(ELNAME, elName);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+ }
+
+ public static class Expression extends OBase implements RValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String EXPRESSION = "expression";
+
+ @JsonCreator
+ public Expression(){}
+ public Expression(OProcess owner, OExpression compiledExpression) {
+ super(owner);
+ setExpression(compiledExpression);
+ }
+
+ @JsonIgnore
+ public OExpression getExpression() {
+ Object o = fieldContainer.get(EXPRESSION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setExpression(OExpression expression) {
+ fieldContainer.put(EXPRESSION, expression);
+ }
+
+ public String toString() {
+ return getExpression().toString();
+ }
+ }
+
+ public static class Literal extends OBase implements RValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String XMLLITERAL = "xmlLiteral";
+
+ @JsonCreator
+ public Literal(){}
+
+ public Literal(OProcess owner, Document xmlLiteral) {
+ super(owner);
+ if (xmlLiteral == null)
+ throw new IllegalArgumentException("null xmlLiteral!");
+ setXmlLiteral(org.apache.ode.utils.DOMUtils.domToString(xmlLiteral));
+ }
+
+ @JsonIgnore
+ public String getXmlLiteral() {
+ Object o = fieldContainer.get(XMLLITERAL);
+ return o == null ? null : (String)o;
+ }
+
+ public void setXmlLiteral(String xmlLiteral) {
+ fieldContainer.put(XMLLITERAL, xmlLiteral);
+ }
+
+ public String toString() {
+ return "{Literal " + getXmlLiteral() + "}";
+ }
+ }
+
+ public interface LValue {
+ OScope.Variable getVariable();
+ }
+
+ public static class LValueExpression extends OBase implements LValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String EXPRESSION = "expression";
+
+ @JsonCreator
+ public LValueExpression(){}
+
+ public LValueExpression(OProcess owner,
+ OLValueExpression compiledExpression) {
+ super(owner);
+ setExpression(compiledExpression);
+ }
+
+ @JsonIgnore
+ public OLValueExpression getExpression() {
+ Object o = fieldContainer.get(EXPRESSION);
+ return o == null ? null : (OLValueExpression)o;
+ }
+
+ /**
+ * @see org.apache.ode.bpel.obj.OAssign.LValue#getVariable()
+ */
+ @JsonIgnore
+ public Variable getVariable() {
+ return getExpression().getVariable();
+ }
+
+ @JsonIgnore
+ public boolean isInsertMissingToData() {
+ return getExpression().isInsertMissingData();
+ }
+
+ public void setExpression(OLValueExpression expression) {
+ fieldContainer.put(EXPRESSION, expression);
+ }
+
+ public void setInsertMissingToData(boolean insertMissingToData) {
+ getExpression().setInsertMissingData(insertMissingToData);
+ }
+
+ public String toString() {
+ return getExpression().toString();
+ }
+
+ }
+
+ public static class PartnerLinkRef extends OBase implements RValue, LValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String PARTNERLINK = "partnerLink";
+ private static final String ISMYENDPOINTREFERENCE = "isMyEndpointReference";
+
+ @JsonCreator
+ public PartnerLinkRef(){
+ setIsMyEndpointReference(false);
+ }
+ public PartnerLinkRef(OProcess owner) {
+ super(owner);
+ setIsMyEndpointReference(false);
+ }
+
+ @JsonIgnore
+ public boolean isIsMyEndpointReference() {
+ Object o = fieldContainer.get(ISMYENDPOINTREFERENCE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink() {
+ Object o = fieldContainer.get(PARTNERLINK);
+ return o == null ? null : (OPartnerLink)o;
+ }
+
+ // Must fit in a LValue even if it's not variable based
+ @JsonIgnore
+ public Variable getVariable() {
+ return null;
+ }
+
+ public void setIsMyEndpointReference(boolean isMyEndpointReference) {
+ fieldContainer.put(ISMYENDPOINTREFERENCE, isMyEndpointReference);
+ }
+
+ public void setPartnerLink(OPartnerLink partnerLink) {
+ fieldContainer.put(PARTNERLINK, partnerLink);
+ }
+
+ public String toString() {
+ return "{PLinkRef " + getPartnerLink() + "!"
+ + isIsMyEndpointReference() + "}";
+ }
+ }
+
+ public static class PropertyRef extends OBase implements RValue, LValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String VARIABLE = "variable";
+ private static final String PROPERTYALIAS = "propertyAlias";
+
+ @JsonCreator
+ public PropertyRef(){}
+ public PropertyRef(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public OPropertyAlias getPropertyAlias() {
+ Object o = fieldContainer.get(PROPERTYALIAS);
+ return o == null ? null : (OPropertyAlias)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setPropertyAlias(OPropertyAlias propertyAlias) {
+ fieldContainer.put(PROPERTYALIAS, propertyAlias);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+
+ public String toString() {
+ return "{PropRef " + getVariable() + "!" + getPropertyAlias() + "}";
+ }
+ }
+
+ public interface RValue {
+ }
+
+ public static class VariableRef extends OBase implements RValue, LValue, Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String VARIABLE = "variable";
+ private static final String PART = "part";
+ private static final String HEADERPART = "headerPart";
+ private static final String LOCATION = "location";
+
+ @JsonCreator
+ public VariableRef(){}
+
+ public VariableRef(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public Part getHeaderPart() {
+ Object o = fieldContainer.get(HEADERPART);
+ return o == null ? null : (Part)o;
+ }
+
+ @JsonIgnore
+ public OExpression getLocation() {
+ Object o = fieldContainer.get(LOCATION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public Part getPart() {
+ Object o = fieldContainer.get(PART);
+ return o == null ? null : (Part)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ @JsonIgnore
+ public boolean isHeaderRef() {
+ return getVariable().getType() instanceof OMessageVarType && getHeaderPart() != null && getLocation() == null;
+ }
+
+ /**
+ * Report whether this is a reference to a whole "message"
+ * @return <code>true</code> if whole-message reference
+ */
+ @JsonIgnore
+ public boolean isMessageRef() {
+ return getVariable().getType() instanceof OMessageVarType && getPart() == null && getHeaderPart() == null && getLocation() == null;
+ }
+
+ /**
+ * Report whether this is a reference to a message part.
+ * @return <code>true</code> if reference to a message part
+ */
+ @JsonIgnore
+ public boolean isPartRef() {
+ return getVariable().getType() instanceof OMessageVarType && getPart() != null && getLocation() == null;
+ }
+
+ public void setHeaderPart(Part headerPart) {
+ fieldContainer.put(HEADERPART, headerPart);
+ }
+
+ public void setLocation(OExpression location) {
+ fieldContainer.put(LOCATION, location);
+ }
+
+ public void setPart(Part part) {
+ fieldContainer.put(PART, part);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+
+ public String toString() {
+ return "{VarRef " + getVariable()
+ + (getPart() == null ? "" : "." + getPart().getName())
+ + (getLocation() == null ? "" : getLocation().toString())
+ + "}";
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OBase.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OBase.java
new file mode 100644
index 0000000..5002214
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OBase.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.Map;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * base class for compiled BPEL objects. It gives some common fields.
+ *
+ */
+public class OBase extends ExtensibleImpl implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /** Our identifier, in terms of our parent. */
+ private static final String ID = "_id";
+ /** Owner OProcess */
+ private static final String OWNER = "_owner";
+ private static final String DEBUG_INFO = "debugInfo";
+
+ /**
+ * This should only be used by jackson when deserialize
+ */
+ protected OBase(){
+ setId(0);
+ }
+
+ protected OBase(OProcess owner) {
+ super();
+ init(owner);
+ }
+
+ protected OBase(OProcess owner, Map<String, Object> map) {
+ super(map);
+ init(owner);
+ }
+
+ private void init(OProcess owner) {
+ setOwner(owner);
+ if (owner == null) {
+ setId(0);
+ } else {
+ owner.setChildIdCounter(owner.getChildIdCounter() + 1);
+ setId(owner.getChildIdCounter());
+ owner.getChildren().add(this);
+ }
+ }
+
+ @JsonIgnore
+ public int getId() {
+ Object o = fieldContainer.get(ID);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ private void setId(int id) {
+ fieldContainer.put(ID, id);
+ }
+
+ @JsonIgnore
+ public OProcess getOwner() {
+ Object owner = fieldContainer.get(OWNER);
+ return (OProcess) (owner == null ? this : owner);
+ }
+
+ private void setOwner(OProcess process) {
+ fieldContainer.put(OWNER, process);
+ }
+
+ @JsonIgnore
+ public DebugInfo getDebugInfo() {
+ Object o = fieldContainer.get(DEBUG_INFO);
+ return o == null ? null : (DebugInfo)o;
+ }
+
+ public void setDebugInfo(DebugInfo debugInfo) {
+ fieldContainer.put(DEBUG_INFO, debugInfo);
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(getClass().getSimpleName());
+ buf.append('#');
+ buf.append(getId());
+ return buf.toString();
+ }
+
+ public void dehydrate() {
+ DebugInfo debugInfo = getDebugInfo();
+ if (debugInfo != null) {
+ debugInfo.setDescription(null);
+ debugInfo.setExtensibilityElements(null);
+ debugInfo = null;
+ }
+ }
+
+ public String digest() {
+ return "";
+ }
+
+ public int hashCode() {
+ return getId();
+ }
+
+ public boolean equals(Object obj) {
+ if (!(obj instanceof OBase))
+ return false;
+ OBase other = (OBase) obj;
+ return (getId() == 0 && other.getId() == 0) || getId() == other.getId()
+ && other.getOwner().equals(getOwner());
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCatch.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCatch.java
new file mode 100644
index 0000000..d623c46
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCatch.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * The catch pseudo-activity.
+ */
+public final class OCatch extends OScope implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String FAULTNAME = "faultName";
+ private static final String FAULTVARIABLE = "faultVariable";
+
+ @JsonCreator
+ public OCatch(){}
+ public OCatch(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ @JsonIgnore
+ public QName getFaultName() {
+ Object o = fieldContainer.get(FAULTNAME);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public Variable getFaultVariable() {
+ Object o = fieldContainer.get(FAULTVARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setFaultName(QName faultName) {
+ fieldContainer.put(FAULTNAME, faultName);
+ }
+
+ public void setFaultVariable(Variable faultVariable) {
+ fieldContainer.put(FAULTVARIABLE, faultVariable);
+ }
+
+ public String toString() {
+ return "{OCatch faultName=" + getFaultName() + ", faultVariable="
+ + getFaultVariable() + "}";
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensate.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensate.java
new file mode 100644
index 0000000..5226539
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensate.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of the BPEL <code><compensate></code> activity.
+ */
+public class OCompensate extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** The scope that is compensated by this activity. */
+ private static final String COMPENSATEDSCOPE = "compensatedScope";
+
+ @JsonCreator
+ public OCompensate(){}
+
+ @JsonIgnore
+ public OScope getCompensatedScope() {
+ Object o = fieldContainer.get(COMPENSATEDSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ public void setCompensatedScope(OScope compensatedScope) {
+ fieldContainer.put(COMPENSATEDSCOPE, compensatedScope);
+ }
+
+ public OCompensate(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensationHandler.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensationHandler.java
new file mode 100644
index 0000000..abad812
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OCompensationHandler.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class OCompensationHandler extends OScope implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ @JsonCreator
+ public OCompensationHandler(){}
+
+ public OCompensationHandler(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantExpression.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantExpression.java
new file mode 100644
index 0000000..793922f
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantExpression.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class OConstantExpression extends OExpression implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static String VAL = "_val";
+
+ @JsonCreator
+ public OConstantExpression(){}
+ public OConstantExpression(OProcess owner, Object val) {
+ super(owner);
+ setVal(val);
+ }
+
+ public Object getVal() {
+ return fieldContainer.get(VAL);
+ }
+
+ public void setVal(Object val) {
+ if (val == null)
+ throw new IllegalArgumentException("OConstatExpression cannot be null.");
+
+ fieldContainer.put(VAL, val);
+ }
+
+ public String toString() {
+ return "{OConstantExpression " + getVal() + "}";
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantVarType.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantVarType.java
new file mode 100644
index 0000000..bf31594
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstantVarType.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import org.apache.ode.utils.DOMUtils;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * @author Matthieu Riou <mriou at apache dot org>
+ */
+public class OConstantVarType extends OVarType implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String STRVALUE = "strValue";
+ private transient Node nodeValue;
+
+ @JsonCreator
+ public OConstantVarType(){}
+ public OConstantVarType(OProcess owner, Node value) {
+ super(owner);
+ setStrValue(DOMUtils.domToString(value));
+ }
+
+ public Node newInstance(Document doc) {
+ return getValue();
+ }
+
+ @JsonIgnore
+ public Node getValue() {
+ if (nodeValue == null)
+ try {
+ nodeValue = DOMUtils.stringToDOM(getStrValue());
+ } catch (Exception e) {
+ // Highly unexpected
+ throw new RuntimeException(e);
+ }
+ return nodeValue;
+ }
+
+ @JsonIgnore
+ public String getStrValue(){
+ return (String)fieldContainer.get(STRVALUE);
+ }
+ public void setStrValue(String value){
+ fieldContainer.put(STRVALUE, value);
+ }
+
+ //TODO: we changed field name here. May affect migration
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstants.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstants.java
new file mode 100644
index 0000000..13cb86c
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OConstants.java
@@ -0,0 +1,284 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled BPEL constants. Mostly the qualified names of the standard
+ * faults.
+ */
+public class OConstants extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String QNMISSINGREQUEST = "qnMissingRequest";
+ private static final String QNMISSINGREPLY = "qnMissingReply";
+ private static final String QNUNINITIALIZEDVARIABLE = "qnUninitializedVariable";
+ private static final String QNCONFLICTINGRECEIVE = "qnConflictingReceive";
+ private static final String QNCONFLICTINGREQUEST = "qnConflictingRequest";
+ private static final String QNSELECTIONFAILURE = "qnSelectionFailure";
+ private static final String QNMISMATCHEDASSIGNMENTFAILURE = "qnMismatchedAssignmentFailure";
+ private static final String QNJOINFAILURE = "qnJoinFailure";
+ private static final String QNFORCEDTERMINATION = "qnForcedTermination";
+ private static final String QNCORRELATIONVIOLATION = "qnCorrelationViolation";
+ private static final String QNXSLTINVALIDSOURCE = "qnXsltInvalidSource";
+ private static final String QNSUBLANGUAGEEXECUTIONFAULT = "qnSubLanguageExecutionFault";
+ private static final String QNUNINITIALIZEDPARTNERROLE = "qnUninitializedPartnerRole";
+ private static final String QNFOREACHCOUNTERERROR = "qnForEachCounterError";
+ private static final String QNINVALIDBRANCHCONDITION = "qnInvalidBranchCondition";
+ private static final String QNINVALIDEXPRESSIONVALUE = "qnInvalidExpressionValue";
+
+ // non-standard fault names
+ private static final String QNRETIREDPROCESS = "qnRetiredProcess";
+ private static final String QNTOOMANYINSTANCES = "qnTooManyInstances";
+ private static final String QNTOOMANYPROCESSES = "qnTooManyProcesses";
+ private static final String QNTOOHUGEPROCESSES = "qnTooHugeProcesses";
+ private static final String QNUNKNOWNFAULT = "qnUnknownFault";
+
+ @JsonCreator
+ public OConstants(){}
+ public OConstants(OProcess owner) {
+ super(owner);
+ }
+
+ private String getNS() {
+ return getQnMissingRequest().getNamespaceURI();
+ }
+ public QName qnAmbiguousReceive() {
+ return new QName(getNS(), "ambiguousReceive");
+ }
+
+ @JsonIgnore
+ public QName getQnConflictingReceive() {
+ Object o = fieldContainer.get(QNCONFLICTINGRECEIVE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnConflictingRequest() {
+ Object o = fieldContainer.get(QNCONFLICTINGREQUEST);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnCorrelationViolation() {
+ Object o = fieldContainer.get(QNCORRELATIONVIOLATION);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnForcedTermination() {
+ Object o = fieldContainer.get(QNFORCEDTERMINATION);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnForEachCounterError() {
+ Object o = fieldContainer.get(QNFOREACHCOUNTERERROR);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnInvalidBranchCondition() {
+ Object o = fieldContainer.get(QNINVALIDBRANCHCONDITION);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnInvalidExpressionValue() {
+ Object o = fieldContainer.get(QNINVALIDEXPRESSIONVALUE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnJoinFailure() {
+ Object o = fieldContainer.get(QNJOINFAILURE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnMismatchedAssignmentFailure() {
+ Object o = fieldContainer.get(QNMISMATCHEDASSIGNMENTFAILURE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnMissingReply() {
+ Object o = fieldContainer.get(QNMISSINGREPLY);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnMissingRequest() {
+ Object o = fieldContainer.get(QNMISSINGREQUEST);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnRetiredProcess() {
+ Object o = fieldContainer.get(QNRETIREDPROCESS);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnSelectionFailure() {
+ Object o = fieldContainer.get(QNSELECTIONFAILURE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnSubLanguageExecutionFault() {
+ Object o = fieldContainer.get(QNSUBLANGUAGEEXECUTIONFAULT);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnTooHugeProcesses() {
+ Object o = fieldContainer.get(QNTOOHUGEPROCESSES);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnTooManyInstances() {
+ Object o = fieldContainer.get(QNTOOMANYINSTANCES);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnTooManyProcesses() {
+ Object o = fieldContainer.get(QNTOOMANYPROCESSES);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnUninitializedPartnerRole() {
+ Object o = fieldContainer.get(QNUNINITIALIZEDPARTNERROLE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnUninitializedVariable() {
+ Object o = fieldContainer.get(QNUNINITIALIZEDVARIABLE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnUnknownFault() {
+ Object o = fieldContainer.get(QNUNKNOWNFAULT);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public QName getQnXsltInvalidSource() {
+ Object o = fieldContainer.get(QNXSLTINVALIDSOURCE);
+ return o == null ? null : (QName)o;
+ }
+
+ public void setQnConflictingReceive(QName qnConflictingReceive) {
+ fieldContainer.put(QNCONFLICTINGRECEIVE, qnConflictingReceive);
+ }
+
+ public void setQnConflictingRequest(QName qnConflictingRequest) {
+ fieldContainer.put(QNCONFLICTINGREQUEST, qnConflictingRequest);
+ }
+
+ public void setQnCorrelationViolation(QName qnCorrelationViolation) {
+ fieldContainer.put(QNCORRELATIONVIOLATION, qnCorrelationViolation);
+ }
+
+ public void setQnForcedTermination(QName qnForcedTermination) {
+ fieldContainer.put(QNFORCEDTERMINATION, qnForcedTermination);
+ }
+
+ public void setQnForEachCounterError(QName qnForEachCounterError) {
+ fieldContainer.put(QNFOREACHCOUNTERERROR, qnForEachCounterError);
+ }
+
+ public void setQnInvalidBranchCondition(QName qnInvalidBranchCondition) {
+ fieldContainer.put(QNINVALIDBRANCHCONDITION, qnInvalidBranchCondition);
+ }
+
+ public void setQnInvalidExpressionValue(QName qnInvalidExpressionValue) {
+ fieldContainer.put(QNINVALIDEXPRESSIONVALUE, qnInvalidExpressionValue);
+ }
+
+ public void setQnJoinFailure(QName qnJoinFailure) {
+ fieldContainer.put(QNJOINFAILURE, qnJoinFailure);
+ }
+
+ public void setQnMismatchedAssignmentFailure(
+ QName qnMismatchedAssignmentFailure) {
+ fieldContainer.put(QNMISMATCHEDASSIGNMENTFAILURE,
+ qnMismatchedAssignmentFailure);
+ }
+
+ public void setQnMissingReply(QName qnMissingReply) {
+ fieldContainer.put(QNMISSINGREPLY, qnMissingReply);
+ }
+
+ public void setQnMissingRequest(QName qnMissingRequest) {
+ fieldContainer.put(QNMISSINGREQUEST, qnMissingRequest);
+ }
+
+ public void setQnRetiredProcess(QName qnRetiredProcess) {
+ fieldContainer.put(QNRETIREDPROCESS, qnRetiredProcess);
+ }
+
+ public void setQnSelectionFailure(QName qnSelectionFailure) {
+ fieldContainer.put(QNSELECTIONFAILURE, qnSelectionFailure);
+ }
+
+ public void setQnSubLanguageExecutionFault(QName qnSubLanguageExecutionFault) {
+ fieldContainer.put(QNSUBLANGUAGEEXECUTIONFAULT,
+ qnSubLanguageExecutionFault);
+ }
+
+ public void setQnTooHugeProcesses(QName qnTooHugeProcesses) {
+ fieldContainer.put(QNTOOHUGEPROCESSES, qnTooHugeProcesses);
+ }
+
+ public void setQnTooManyInstances(QName qnTooManyInstances) {
+ fieldContainer.put(QNTOOMANYINSTANCES, qnTooManyInstances);
+ }
+
+ public void setQnTooManyProcesses(QName qnTooManyProcesses) {
+ fieldContainer.put(QNTOOMANYPROCESSES, qnTooManyProcesses);
+ }
+
+ public void setQnUninitializedPartnerRole(QName qnUninitializedPartnerRole) {
+ fieldContainer.put(QNUNINITIALIZEDPARTNERROLE,
+ qnUninitializedPartnerRole);
+ }
+
+ public void setQnUninitializedVariable(QName qnUninitializedVariable) {
+ fieldContainer.put(QNUNINITIALIZEDVARIABLE, qnUninitializedVariable);
+ }
+
+ public void setQnUnknownFault(QName qnUnknownFault) {
+ fieldContainer.put(QNUNKNOWNFAULT, qnUnknownFault);
+ }
+
+ public void setQnXsltInvalidSource(QName qnXsltInvalidSource) {
+ fieldContainer.put(QNXSLTINVALIDSOURCE, qnXsltInvalidSource);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OElementVarType.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OElementVarType.java
new file mode 100644
index 0000000..5d18111
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OElementVarType.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public class OElementVarType extends OVarType implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String ELEMENTTYPE = "elementType";
+
+ @JsonCreator
+ public OElementVarType(){}
+ public OElementVarType(OProcess owner, QName typeName) {
+ super(owner);
+ setElementType(typeName);
+ }
+
+ public Node newInstance(Document doc) {
+ Element el = doc.createElementNS(getElementType().getNamespaceURI(),
+ getElementType().getLocalPart());
+ return el;
+ }
+
+ @JsonIgnore
+ public QName getElementType() {
+ Object o = fieldContainer.get(ELEMENTTYPE);
+ return o == null ? null : (QName)o;
+ }
+
+ public void setElementType(QName elementType) {
+ fieldContainer.put(ELEMENTTYPE, elementType);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEmpty.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEmpty.java
new file mode 100644
index 0000000..6725a9c
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEmpty.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class OEmpty extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ @JsonCreator
+ public OEmpty(){}
+
+ public OEmpty(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEventHandler.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEventHandler.java
new file mode 100644
index 0000000..6560191
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OEventHandler.java
@@ -0,0 +1,248 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled represenation of a BPEL event handler.
+ */
+public class OEventHandler extends OAgent implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String ONMESSAGES = "onMessages";
+ private static final String ONALARMS = "onAlarms";
+
+ @JsonCreator
+ public OEventHandler(){}
+ public OEventHandler(OProcess owner) {
+ super(owner);
+ setOnMessages(new ArrayList<OEvent>());
+ setOnAlarms(new ArrayList<OAlarm>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OAlarm> getOnAlarms() {
+ Object o = fieldContainer.get(ONALARMS);
+ return o == null ? null : (List<OAlarm>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OEvent> getOnMessages() {
+ Object o = fieldContainer.get(ONMESSAGES);
+ return o == null ? null : (List<OEvent>)o;
+ }
+
+ public void setOnAlarms(List<OAlarm> onAlarms) {
+ fieldContainer.put(ONALARMS, onAlarms);
+ }
+
+ public void setOnMessages(List<OEvent> onMessages) {
+ fieldContainer.put(ONMESSAGES, onMessages);
+ }
+
+ public static class OAlarm extends OAgent implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String FOREXPR = "forExpr";
+ private static final String UNTILEXPR = "untilExpr";
+ private static final String REPEATEXPR = "repeatExpr";
+ private static final String ACTIVITY = "activity";
+
+ @JsonCreator
+ public OAlarm(){}
+
+ public OAlarm(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getForExpr() {
+ Object o = fieldContainer.get(FOREXPR);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public OExpression getRepeatExpr() {
+ Object o = fieldContainer.get(REPEATEXPR);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public OExpression getUntilExpr() {
+ Object o = fieldContainer.get(UNTILEXPR);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setForExpr(OExpression forExpr) {
+ fieldContainer.put(FOREXPR, forExpr);
+ }
+
+ public void setRepeatExpr(OExpression repeatExpr) {
+ fieldContainer.put(REPEATEXPR, repeatExpr);
+ }
+
+ public void setUntilExpr(OExpression untilExpr) {
+ fieldContainer.put(UNTILEXPR, untilExpr);
+ }
+ }
+
+ public static class OEvent extends OScope implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** Correlations to initialize. */
+ private static final String INITCORRELATIONS = "initCorrelations";
+
+ /** Correlation set to match on. */
+ private static final String MATCHCORRELATIONS = "matchCorrelations";
+
+ /** Correlation set to join on. */
+ private static final String JOINCORRELATIONS = "joinCorrelations";
+
+ private static final String PARTNERLINK = "partnerLink";
+
+ private static final String OPERATION = "operation";
+
+ private static final String VARIABLE = "variable";
+
+ /** OASIS addition for disambiguating receives (optional). */
+
+ private static final String MESSAGEEXCHANGEID = "messageExchangeId";
+
+ private static final String ROUTE = "route";
+
+ @JsonCreator
+ public OEvent(){}
+ public OEvent(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setInitCorrelations(new ArrayList<CorrelationSet>());
+ setMatchCorrelations(new ArrayList<CorrelationSet>());
+ setJoinCorrelations(new ArrayList<CorrelationSet>());
+ setMessageExchangeId("");
+ setRoute("one");
+ }
+
+ @JsonIgnore
+ public String getCorrelatorId() {
+ return getPartnerLink().getId() + "." + getOperation().getName();
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getInitCorrelations() {
+ Object o = fieldContainer.get(INITCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getJoinCorrelations() {
+ Object o = fieldContainer.get(JOINCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getMatchCorrelations() {
+ Object o = fieldContainer.get(MATCHCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @JsonIgnore
+ public String getMessageExchangeId() {
+ Object o = fieldContainer.get(MESSAGEEXCHANGEID);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Operation getOperation() {
+ Object o = fieldContainer.get(OPERATION);
+ return o == null ? null : (Operation)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink() {
+ Object o = fieldContainer.get(PARTNERLINK);
+ return o == null ? null : (OPartnerLink)o;
+ }
+
+ @JsonIgnore
+ public String getRoute() {
+ Object o = fieldContainer.get(ROUTE);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setInitCorrelations(List<CorrelationSet> initCorrelations) {
+ fieldContainer.put(INITCORRELATIONS, initCorrelations);
+ }
+
+ public void setJoinCorrelations(List<CorrelationSet> joinCorrelations) {
+ fieldContainer.put(JOINCORRELATIONS, joinCorrelations);
+ }
+
+ public void setMatchCorrelations(List<CorrelationSet> matchCorrelations) {
+ fieldContainer.put(MATCHCORRELATIONS, matchCorrelations);
+ }
+
+ public void setMessageExchangeId(String messageExchangeId) {
+ fieldContainer.put(MESSAGEEXCHANGEID, messageExchangeId);
+ }
+
+ public void setOperation(Operation operation) {
+ fieldContainer.put(OPERATION, operation);
+ }
+
+ public void setPartnerLink(OPartnerLink partnerLink) {
+ fieldContainer.put(PARTNERLINK, partnerLink);
+ }
+
+ public void setRoute(String route) {
+ fieldContainer.put(ROUTE, route);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+
+ //TODO: custom read object; private fields. backward compatibility;
+ }
+}
\ No newline at end of file
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpression.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpression.java
new file mode 100644
index 0000000..3d425da
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpression.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Base class for compiled expressions. The exact form of a compiled expression is
+ * dependent on the compiler implementation.
+ */
+public abstract class OExpression extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String EXPRESSIONLANGUAGE = "expressionLanguage";
+ @JsonCreator
+ public OExpression(){}
+ public OExpression(OProcess owner) {
+ super(owner);
+ }
+
+ /** Get the expression language used to generate this expression. */
+ @JsonIgnore
+ public OExpressionLanguage getExpressionLanguage() {
+ Object o = fieldContainer.get(EXPRESSIONLANGUAGE);
+ return o == null ? null : (OExpressionLanguage)o;
+ }
+
+ public void setExpressionLanguage(OExpressionLanguage expressionLanguage) {
+ fieldContainer.put(EXPRESSIONLANGUAGE, expressionLanguage);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpressionLanguage.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpressionLanguage.java
new file mode 100644
index 0000000..20c4124
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExpressionLanguage.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Compiled representation of an expression language dependency.
+ */
+public class OExpressionLanguage extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String EXPRESSIONLANGUAGEURI = "expressionLanguageUri";
+ private static final String PROPERTIES = "properties";
+
+ @JsonCreator
+ public OExpressionLanguage(){}
+ public OExpressionLanguage(OProcess owner, Map<String, String> properties) {
+ super(owner);
+ setProperties(new HashMap<String, String>());
+ if (properties != null)
+ getProperties().putAll(properties);
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof OExpressionLanguage)
+ return getExpressionLanguageUri()
+ .equals(getExpressionLanguageUri());
+ else
+ return super.equals(obj);
+ }
+
+ @JsonIgnore
+ public String getExpressionLanguageUri() {
+ Object o = fieldContainer.get(EXPRESSIONLANGUAGEURI);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Map<String, String> getProperties() {
+ Object o = fieldContainer.get(PROPERTIES);
+ return o == null ? null : (Map<String, String>)o;
+ }
+
+ public int hashCode() {
+ return getExpressionLanguageUri().hashCode();
+ }
+
+ public void setExpressionLanguageUri(String expressionLanguageUri) {
+ fieldContainer.put(EXPRESSIONLANGUAGEURI, expressionLanguageUri);
+ }
+
+ public void setProperties(Map<String, String> properties) {
+ fieldContainer.put(PROPERTIES, properties);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExtVar.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExtVar.java
new file mode 100644
index 0000000..201d005
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OExtVar.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of an external variable declaration.
+ *
+ * @author Maciej Szefler <mszefler at gmail dot com>
+ *
+ */
+public class OExtVar extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /**
+ * Unique identifier for the external variable. Will be referenced in the deployment descriptor.
+ */
+ private static final String EXTERNALVARIABLEID = "externalVariableId";
+
+ /** Related variable containing the identifying information. */
+ private static final String RELATED = "related";
+
+ @JsonCreator
+ public OExtVar(){}
+
+ public OExtVar(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public String getExternalVariableId() {
+ Object o = fieldContainer.get(EXTERNALVARIABLEID);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Variable getRelated() {
+ Object o = fieldContainer.get(RELATED);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setExternalVariableId(String externalVariableId) {
+ fieldContainer.put(EXTERNALVARIABLEID, externalVariableId);
+ }
+
+ public void setRelated(Variable related) {
+
+ fieldContainer.put(RELATED, related);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFailureHandling.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFailureHandling.java
new file mode 100644
index 0000000..9aa3409
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFailureHandling.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import javax.xml.namespace.QName;
+
+import java.io.Serializable;
+
+/**
+ * Holds information about the failure handling of this activity.
+ */
+public class OFailureHandling extends ExtensibleImpl implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ public static final String EXTENSION_NS_URI = "http://ode.apache.org/activityRecovery";
+ public static final QName FAILURE_FAULT_NAME = new QName(EXTENSION_NS_URI,
+ "activityFailure");
+ public static final QName FAILURE_EXT_ELEMENT = new QName(EXTENSION_NS_URI,
+ "failureHandling");
+
+ /** Number of times to retry the activity if failure occurs.
+ * Defaults to zero. */
+ private static final String RETRYFOR = "retryFor";
+
+ /** Time delay between retries of the activity, in seconds.*/
+ private static final String RETRYDELAY = "retryDelay";
+
+ /** If true, fault when failure occurs, otherwise, enter activity recovery state. */
+ private static final String FAULTONFAILURE = "faultOnFailure";
+
+ /**
+ * This can be used more than jackson deserializer
+ */
+ @JsonCreator
+ public OFailureHandling(){
+ setRetryDelay(0);
+ setRetryFor(0);
+ setFaultOnFailure(false);
+ }
+ @JsonIgnore
+ public boolean isFaultOnFailure() {
+ Object o = fieldContainer.get(FAULTONFAILURE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public int getRetryDelay() {
+ Object o = fieldContainer.get(RETRYDELAY);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ @JsonIgnore
+ public int getRetryFor() {
+ Object o = fieldContainer.get(RETRYFOR);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ public void setFaultOnFailure(boolean faultOnFailure) {
+ fieldContainer.put(FAULTONFAILURE, faultOnFailure);
+ }
+
+ public void setRetryDelay(int retryDelay) {
+ fieldContainer.put(RETRYDELAY, retryDelay);
+ }
+
+ public void setRetryFor(int retryFor) {
+ fieldContainer.put(RETRYFOR, retryFor);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFaultHandler.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFaultHandler.java
new file mode 100644
index 0000000..bec5499
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFaultHandler.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Compiled representation of a BPEL fault handler.
+ */
+public class OFaultHandler extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String CATCHBLOCKS = "catchBlocks";
+
+ @JsonCreator
+ public OFaultHandler(){}
+ public OFaultHandler(OProcess owner) {
+ super(owner);
+ setCatchBlocks(new ArrayList<OCatch>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OCatch> getCatchBlocks() {
+ Object o = fieldContainer.get(CATCHBLOCKS);
+ return o == null ? null : (List<OCatch>)o;
+ }
+
+ public Collection<OLink> outgoinglinks() {
+ throw new UnsupportedOperationException(); // TODO: implement me!
+ }
+
+ public void setCatchBlocks(List<OCatch> catchBlocks) {
+ if (getCatchBlocks() == null){
+ fieldContainer.put(CATCHBLOCKS, catchBlocks);
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFlow.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFlow.java
new file mode 100644
index 0000000..aba9bbe
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OFlow.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import org.apache.ode.utils.stl.CollectionsX;
+import org.apache.ode.utils.stl.MemberOfFunction;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ */
+public class OFlow extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** Links delcared within this activity. */
+ private static final String LOCALLINKS = "localLinks";
+ private static final String PARALLELACTIVITIES = "parallelActivities";
+
+ @JsonCreator
+ public OFlow(){}
+
+ public OFlow(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setLocalLinks(new HashSet<OLink>());
+ setParallelActivities(new HashSet<OActivity>());
+ }
+
+ @JsonIgnore
+ public OLink getLocalLink(final String linkName) {
+ return CollectionsX.find_if(getLocalLinks(),
+ new MemberOfFunction<OLink>() {
+ public boolean isMember(OLink o) {
+ return o.getName().equals(linkName);
+ }
+ });
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OLink> getLocalLinks() {
+ Object o = fieldContainer.get(LOCALLINKS);
+ return o == null ? null : (Set<OLink>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OActivity> getParallelActivities() {
+ Object o = fieldContainer.get(PARALLELACTIVITIES);
+ return o == null ? null : (Set<OActivity>)o;
+ }
+
+ public void setLocalLinks(Set<OLink> localLinks) {
+ if (getLocalLinks() == null){
+ fieldContainer.put(LOCALLINKS, localLinks);
+ }
+ }
+
+ public void setParallelActivities(Set<OActivity> parallelActivities) {
+ if (getParallelActivities() == null){
+ fieldContainer.put(PARALLELACTIVITIES, parallelActivities);
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OForEach.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OForEach.java
new file mode 100644
index 0000000..b3ca6b2
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OForEach.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Base model class for forEach activity.
+ */
+public class OForEach extends OActivity implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private static final String COUNTERVARIABLE = "counterVariable";
+ private static final String PARALLEL = "parallel";
+ private static final String STARTCOUNTERVALUE = "startCounterValue";
+ private static final String FINALCOUNTERVALUE = "finalCounterValue";
+ private static final String COMPLETIONCONDITION = "completionCondition";
+ private static final String INNERSCOPE = "innerScope";
+
+ @JsonCreator
+ public OForEach(){
+ setParallel(false);
+ }
+ public OForEach(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setParallel(false);
+ }
+
+ @JsonIgnore
+ public CompletionCondition getCompletionCondition() {
+ Object o = fieldContainer.get(COMPLETIONCONDITION);
+ return o == null ? null : (CompletionCondition)o;
+ }
+
+ @JsonIgnore
+ public Variable getCounterVariable() {
+ Object o = fieldContainer.get(COUNTERVARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ @JsonIgnore
+ public OExpression getFinalCounterValue() {
+ Object o = fieldContainer.get(FINALCOUNTERVALUE);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public OScope getInnerScope() {
+ Object o = fieldContainer.get(INNERSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ @JsonIgnore
+ public boolean isParallel() {
+ Object o = fieldContainer.get(PARALLEL);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public OExpression getStartCounterValue() {
+ Object o = fieldContainer.get(STARTCOUNTERVALUE);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setCompletionCondition(CompletionCondition completionCondition) {
+ fieldContainer.put(COMPLETIONCONDITION, completionCondition);
+ }
+
+ public void setCounterVariable(Variable counterVariable) {
+ fieldContainer.put(COUNTERVARIABLE, counterVariable);
+ }
+
+ public void setFinalCounterValue(OExpression finalCounterValue) {
+ fieldContainer.put(FINALCOUNTERVALUE, finalCounterValue);
+ }
+
+ public void setInnerScope(OScope innerScope) {
+ fieldContainer.put(INNERSCOPE, innerScope);
+ }
+
+ public void setParallel(boolean parallel) {
+ fieldContainer.put(PARALLEL, parallel);
+ }
+
+ public void setStartCounterValue(OExpression startCounterValue) {
+ fieldContainer.put(STARTCOUNTERVALUE, startCounterValue);
+ }
+
+ public String toString() {
+ return "+{OForEach : "
+ + getName()
+ + ", counterName="
+ + getCounterVariable().getName()
+ + ", parallel="
+ + isParallel()
+ + ", startCounterValue="
+ + getStartCounterValue()
+ + ", finalCounterValue="
+ + getFinalCounterValue()
+ + ", completionCondition="
+ + (getCompletionCondition() == null ? ""
+ : getCompletionCondition().getBranchCount()) + "}";
+ }
+
+ public static class CompletionCondition extends OBase implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ private static final String SUCCESSFULBRANCHESONLY = "successfulBranchesOnly";
+ private static final String BRANCHCOUNT = "branchCount";
+
+ @JsonCreator
+ public CompletionCondition(){
+ setSuccessfulBranchesOnly(false);
+ }
+ public CompletionCondition(OProcess owner) {
+ super(owner);
+ setSuccessfulBranchesOnly(false);
+ }
+
+ @JsonIgnore
+ public OExpression getBranchCount() {
+ Object o = fieldContainer.get(BRANCHCOUNT);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public boolean isSuccessfulBranchesOnly() {
+ Object o = fieldContainer.get(SUCCESSFULBRANCHESONLY);
+ return o == null ? false : (Boolean)o;
+ }
+
+ public void setBranchCount(OExpression branchCount) {
+ fieldContainer.put(BRANCHCOUNT, branchCount);
+ }
+
+ public void setSuccessfulBranchesOnly(boolean successfulBranchesOnly) {
+ fieldContainer.put(SUCCESSFULBRANCHESONLY, successfulBranchesOnly);
+ }
+ }
+}
\ No newline at end of file
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OInvoke.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OInvoke.java
new file mode 100644
index 0000000..581233f
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OInvoke.java
@@ -0,0 +1,233 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled rerpresentation of the BPEL <code><invoke></code> activity.
+ */
+public class OInvoke extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String PARTNERLINK = "partnerLink";
+ private static final String INPUTVAR = "inputVar";
+ private static final String OUTPUTVAR = "outputVar";
+ private static final String OPERATION = "operation";
+
+ /** Correlation sets initialized on the input message. */
+ private static final String INITCORRELATIONSINPUT = "initCorrelationsInput";
+
+ /** Correlation sets initialized on the output message. */
+ private static final String INITCORRELATIONSOUTPUT = "initCorrelationsOutput";
+
+ /** Correlation sets asserted on input. */
+ private static final String ASSERTCORRELATIONSINPUT = "assertCorrelationsInput";
+
+ /** Correlation sets asserted on output. */
+ private static final String ASSERTCORRELATIONSOUTPUT = "assertCorrelationsOutput";
+
+ /** Correlation sets joined on input. */
+ private static final String JOINCORRELATIONSINPUT = "joinCorrelationsInput";
+
+ /** Correlation sets joined on output. */
+ private static final String JOINCORRELATIONSOUTPUT = "joinCorrelationsOutput";
+
+ @JsonCreator
+ public OInvoke(){}
+ public OInvoke(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setInitCorrelationsInput(new ArrayList<CorrelationSet>());
+ setInitCorrelationsOutput(new ArrayList<CorrelationSet>());
+ setAssertCorrelationsInput(new ArrayList<CorrelationSet>());
+ setAssertCorrelationsOutput(new ArrayList<CorrelationSet>());
+ setJoinCorrelationsInput(new ArrayList<CorrelationSet>());
+ setJoinCorrelationsOutput(new ArrayList<CorrelationSet>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getAssertCorrelationsInput() {
+ return (List<CorrelationSet>) fieldContainer
+ .get(ASSERTCORRELATIONSINPUT);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getAssertCorrelationsOutput() {
+ return (List<CorrelationSet>) fieldContainer
+ .get(ASSERTCORRELATIONSOUTPUT);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getInitCorrelationsInput() {
+ Object o = fieldContainer.get(INITCORRELATIONSINPUT);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getInitCorrelationsOutput() {
+ return (List<CorrelationSet>) fieldContainer
+ .get(INITCORRELATIONSOUTPUT);
+ }
+
+ @JsonIgnore
+ public Variable getInputVar() {
+ Object o = fieldContainer.get(INPUTVAR);
+ return o == null ? null : (Variable)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getJoinCorrelationsInput() {
+ Object o = fieldContainer.get(JOINCORRELATIONSINPUT);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getJoinCorrelationsOutput() {
+ return (List<CorrelationSet>) fieldContainer
+ .get(JOINCORRELATIONSOUTPUT);
+ }
+
+ @JsonIgnore
+ public Operation getOperation() {
+ Object o = fieldContainer.get(OPERATION);
+ return o == null ? null : (Operation)o;
+ }
+
+ @JsonIgnore
+ public Variable getOutputVar() {
+ Object o = fieldContainer.get(OUTPUTVAR);
+ return o == null ? null : (Variable)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink() {
+ Object o = fieldContainer.get(PARTNERLINK);
+ return o == null ? null : (OPartnerLink)o;
+ }
+
+ //TODO: custom read Object -- backward compatibility
+// private void readObject(ObjectInputStream in) throws IOException,
+// ClassNotFoundException {
+// in.defaultReadObject();
+//
+// // backward compatibility; joinCorrelationInput could be null if read from old definition
+// if (getJoinCorrelationsInput() == null) {
+// try {
+// Field field = getClass().getDeclaredField(
+// "joinCorrelationsInput");
+// field.setAccessible(true);
+// field.set(this, new ArrayList<OScope.CorrelationSet>());
+// } catch (NoSuchFieldException nfe) {
+// throw new IOException(nfe.getMessage());
+// } catch (IllegalAccessException iae) {
+// throw new IOException(iae.getMessage());
+// }
+// }
+// // backward compatibility; joinCorrelationOutput could be null if read from old definition
+// if (getJoinCorrelationsOutput() == null) {
+// try {
+// Field field = getClass().getDeclaredField(
+// "joinCorrelationsOutput");
+// field.setAccessible(true);
+// field.set(this, new ArrayList<CorrelationSet>());
+// } catch (NoSuchFieldException nfe) {
+// throw new IOException(nfe.getMessage());
+// } catch (IllegalAccessException iae) {
+// throw new IOException(iae.getMessage());
+// }
+// }
+// }
+
+ public void setAssertCorrelationsInput(
+ List<CorrelationSet> assertCorrelationsInput) {
+ if (getAssertCorrelationsInput() == null){
+ fieldContainer.put(ASSERTCORRELATIONSINPUT, assertCorrelationsInput);
+ }
+ }
+
+ public void setAssertCorrelationsOutput(
+ List<CorrelationSet> assertCorrelationsOutput) {
+ if (getAssertCorrelationsOutput() == null){
+ fieldContainer.put(ASSERTCORRELATIONSOUTPUT, assertCorrelationsOutput);
+ }
+ }
+
+ public void setInitCorrelationsInput(
+ List<CorrelationSet> initCorrelationsInput) {
+ if (getInitCorrelationsInput() == null){
+ fieldContainer.put(INITCORRELATIONSINPUT, initCorrelationsInput);
+ }
+ }
+
+ public void setInitCorrelationsOutput(
+ List<CorrelationSet> initCorrelationsOutput) {
+ if (getInitCorrelationsOutput() == null){
+ fieldContainer.put(INITCORRELATIONSOUTPUT, initCorrelationsOutput);
+ }
+ }
+
+ public void setInputVar(Variable inputVar) {
+ fieldContainer.put(INPUTVAR, inputVar);
+ }
+
+ public void setJoinCorrelationsInput(
+ List<CorrelationSet> joinCorrelationsInput) {
+ if (getJoinCorrelationsInput() == null){
+ fieldContainer.put(JOINCORRELATIONSINPUT, joinCorrelationsInput);
+ }
+ }
+
+ public void setJoinCorrelationsOutput(
+ List<CorrelationSet> joinCorrelationsOutput) {
+ if (getJoinCorrelationsOutput() == null){
+ fieldContainer.put(JOINCORRELATIONSOUTPUT, joinCorrelationsOutput);
+ }
+ }
+
+ public void setOperation(Operation operation) {
+ fieldContainer.put(OPERATION, operation);
+ }
+
+ public void setOutputVar(Variable outputVar) {
+ fieldContainer.put(OUTPUTVAR, outputVar);
+ }
+
+ public void setPartnerLink(OPartnerLink partnerLink) {
+ fieldContainer.put(PARTNERLINK, partnerLink);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLValueExpression.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLValueExpression.java
new file mode 100644
index 0000000..d9b3e84
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLValueExpression.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public abstract class OLValueExpression extends OExpression implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /**
+ * Indicates whether the expression, if it is a simple path, must
+ * be created if missing By a simple path, we mean a path expression whose
+ * steps are fully-qualified names separated by slashes. In case any of
+ * the steps in the simple path is non-existent, then we must create it.
+ */
+ private static final String INSERTMISSINGDATA = "insertMissingData";
+
+ @JsonCreator
+ public OLValueExpression(){
+ setInsertMissingData(false);
+ }
+ /**
+ * @param owner
+ */
+ public OLValueExpression(OProcess owner) {
+ super(owner);
+ setInsertMissingData(false);
+ }
+
+ @JsonIgnore
+ public boolean isInsertMissingData() {
+ Object o = fieldContainer.get(INSERTMISSINGDATA);
+ return o == null ? false : (Boolean)o;
+ }
+
+ public abstract OScope.Variable getVariable();
+
+ public void setInsertMissingData(boolean insertMissingData) {
+ fieldContainer.put(INSERTMISSINGDATA, insertMissingData);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLink.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLink.java
new file mode 100644
index 0000000..b1693ef
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OLink.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of a BPEL control link.
+ */
+public class OLink extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /** The flow in which the link is declared. */
+ private static final String DECLARINGFLOW = "declaringFlow";
+
+ /** The name of the link. */
+ private static final String NAME = "name";
+
+ /** The link's transition condition. */
+ private static final String TRANSITIONCONDITION = "transitionCondition";
+
+ /** The source activity. */
+ private static final String SOURCE = "source";
+
+ /** The target activity. */
+ private static final String TARGET = "target";
+
+ @JsonCreator
+ public OLink(){}
+ public OLink(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public OFlow getDeclaringFlow() {
+ Object o = fieldContainer.get(DECLARINGFLOW);
+ return o == null ? null : (OFlow)o;
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public OActivity getSource() {
+ Object o = fieldContainer.get(SOURCE);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OActivity getTarget() {
+ Object o = fieldContainer.get(TARGET);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getTransitionCondition() {
+ Object o = fieldContainer.get(TRANSITIONCONDITION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setDeclaringFlow(OFlow declaringFlow) {
+ fieldContainer.put(DECLARINGFLOW, declaringFlow);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setSource(OActivity source) {
+ fieldContainer.put(SOURCE, source);
+ }
+
+ public void setTarget(OActivity target) {
+ fieldContainer.put(TARGET, target);
+ }
+
+ public void setTransitionCondition(OExpression transitionCondition) {
+ fieldContainer.put(TRANSITIONCONDITION, transitionCondition);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OMessageVarType.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OMessageVarType.java
new file mode 100644
index 0000000..e1d41a9
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OMessageVarType.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Message variable type.
+ */
+public class OMessageVarType extends OVarType implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String MESSAGETYPE = "messageType";
+
+ private static final String PARTS = "parts";
+
+ /** For doc-lit-like message types , the element type of the only part. */
+ private static final String DOCLITTYPE = "docLitType";
+
+ @JsonCreator
+ public OMessageVarType(){}
+ public OMessageVarType(OProcess owner, QName messageType,
+ Collection<Part> parts) {
+ super(owner);
+ setParts(new LinkedHashMap<String, Part>());
+ setMessageType(messageType);
+ for (Iterator<Part> i = parts.iterator(); i.hasNext();) {
+ Part part = i.next();
+ getParts().put(part.getName(), part);
+ }
+
+ if ((parts.size() == 1 && parts.iterator().next().getType() instanceof OElementVarType))
+ setDocLitType((OElementVarType) parts.iterator().next().getType());
+ else
+ setDocLitType(null);
+ }
+
+ @JsonIgnore
+ public OElementVarType getDocLitType() {
+ Object o = fieldContainer.get(DOCLITTYPE);
+ return o == null ? null : (OElementVarType)o;
+ }
+
+ @JsonIgnore
+ public QName getMessageType() {
+ Object o = fieldContainer.get(MESSAGETYPE);
+ return o == null ? null : (QName)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Map<String, Part> getParts() {
+ Object o = fieldContainer.get(PARTS);
+ return o == null ? null : (Map<String, Part>)o;
+ }
+
+ @JsonIgnore
+ boolean isDocLit() {
+ return getDocLitType() != null;
+ }
+
+ public Node newInstance(Document doc) {
+ Element el = doc.createElementNS(null, "message");
+ for (OMessageVarType.Part part : getParts().values()) {
+ Element partElement = doc.createElementNS(null, part.getName());
+ partElement.appendChild(part.getType().newInstance(doc));
+ el.appendChild(partElement);
+ }
+ return el;
+ }
+
+ public void setDocLitType(OElementVarType docLitType) {
+ if (getDocLitType() == null){
+ fieldContainer.put(DOCLITTYPE, docLitType);
+ }
+ }
+
+ public void setMessageType(QName messageType) {
+ fieldContainer.put(MESSAGETYPE, messageType);
+ }
+
+ public void setParts(Map<String, Part> parts) {
+ if (getParts() == null){
+ fieldContainer.put(PARTS, parts);
+ }
+ }
+
+ public String toString() {
+ StringBuffer buf = new StringBuffer(super.toString());
+ buf.append('(');
+ buf.append(getMessageType().toString());
+ buf.append(')');
+ return buf.toString();
+ }
+
+ public static class Part extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String NAME = "name";
+ private static final String TYPE = "type";
+
+ @JsonCreator
+ public Part(){}
+ public Part(OProcess owner, String partName, OVarType partType) {
+ super(owner);
+ setName(partName);
+ setType(partType);
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public OVarType getType() {
+ Object o = fieldContainer.get(TYPE);
+ return o == null ? null : (OVarType)o;
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setType(OVarType type) {
+ fieldContainer.put(TYPE, type);
+ }
+
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OModelException.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OModelException.java
new file mode 100644
index 0000000..92cc865
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OModelException.java
@@ -0,0 +1,10 @@
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+
+public class OModelException extends Exception implements Serializable{
+ private static final long serialVersionUID = -3148845461985443106L;
+ public OModelException(String message){
+ super(message);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPartnerLink.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPartnerLink.java
new file mode 100644
index 0000000..7d302b0
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPartnerLink.java
@@ -0,0 +1,309 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+/**
+ * Compiled representation of a BPEL partnerLink.
+ */
+public class OPartnerLink extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /** partnerLink name. */
+ private static final String NAME = "name";
+
+ /** Scope in which this partnerLink is declared. */
+ private static final String DECLARINGSCOPE = "declaringScope";
+
+ /** The type of this partnerLink. */
+ private static final String PARTNERLINKTYPE = "partnerLinkType";
+
+ private static final String PARTNERROLENAME = "partnerRoleName";
+ private static final String MYROLENAME = "myRoleName";
+ private static final String MYROLEPORTTYPE = "myRolePortType";
+ private static final String PARTNERROLEPORTTYPE = "partnerRolePortType";
+ private static final String INITIALIZEPARTNERROLE = "initializePartnerRole";
+
+ /** The set of CorrelationSets that may be used as a match criteria, organized by {@link Operation} */
+ private static final String NONINITIATINGCORRELATIONSETS = "_nonIntitiatingCorrelationSets";
+ /** The set of joining CorrelationSets that may be used as a match criteria, organized by {@link Operation} */
+ private static final String JOININGCORRELATIONSETS = "_joiningCorrelationSets";
+ /** The set of {@link Operation}s that can be used to create a process instance. */
+ private static final String CREATEINSTANCEOPERATIONS = "_createInstanceOperations";
+
+ @JsonCreator
+ public OPartnerLink(){
+ setInitializePartnerRole(false);
+ }
+ public OPartnerLink(OProcess owner) {
+ super(owner);
+ setNonIntitiatingCorrelationSets(new HashMap<String, Set<CorrelationSet>>());
+ setJoiningCorrelationSets(new HashMap<String, Set<CorrelationSet>>());
+ setCreateInstanceOperations(new HashSet<String>());
+
+ setInitializePartnerRole(false);
+ }
+
+ /**
+ * Add a {@link org.apache.ode.bpel.obj.OScope.CorrelationSet} to an {@link Operation}'s list
+ * of "non-initiating" correlation sets. The non-initiating correlation sets are those
+ * sets that are used (along with the operation) to "match" incoming messages.
+ * We need to know which correlation sets are used with which operation in order to
+ * pre-compute correlation keys at the time of message receipt.
+ * @param operation WSDL {@link Operation}
+ * @param cset non-initiating correlation used in this operation
+ */
+ public void addCorrelationSetForOperation(Operation operation,
+ OScope.CorrelationSet cset, boolean isJoin) {
+ if (!isJoin) {
+ Set<OScope.CorrelationSet> ret = getNonIntitiatingCorrelationSets()
+ .get(operation.getName());
+ if (ret == null) {
+ ret = new HashSet<OScope.CorrelationSet>();
+ getNonIntitiatingCorrelationSets()
+ .put(operation.getName(), ret);
+ }
+ ret.add(cset);
+ } else {
+ // serialization backward compatibility; joiningCorrelationSets could be null if read from old definition
+ if (getJoiningCorrelationSets() == null) {
+ setJoiningCorrelationSets(new java.util.HashMap<java.lang.String, java.util.Set<org.apache.ode.bpel.obj.OScope.CorrelationSet>>());
+ }
+ Set<OScope.CorrelationSet> ret = getJoiningCorrelationSets().get(
+ operation.getName());
+ if (ret == null) {
+ ret = new HashSet<OScope.CorrelationSet>();
+ getJoiningCorrelationSets().put(operation.getName(), ret);
+ }
+ ret.add(cset);
+ }
+ }
+
+ public void addCreateInstanceOperation(Operation operation) {
+ getCreateInstanceOperations().add(operation.getName());
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof OPartnerLink))
+ return false;
+ OPartnerLink other = (OPartnerLink) obj;
+ return (getName() == null && other.getName() == null && super.equals(obj))
+ || getName().equals(other.getName());
+ }
+
+ @JsonIgnore
+ public OScope getDeclaringScope() {
+ Object o = fieldContainer.get(DECLARINGSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ @JsonIgnore
+ public boolean isInitializePartnerRole() {
+ Object o = fieldContainer.get(INITIALIZEPARTNERROLE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ /**
+ * Get all joining correlation sets that are ever used to qualify a receive for a the given
+ * operation.
+ * @param operation the operation
+ * @return all non-initiating correlation sets used in the given operation
+ */
+ @SuppressWarnings("unchecked")
+ public Set<OScope.CorrelationSet> getJoinningCorrelationSetsForOperation(
+ Operation operation) {
+ if (getJoiningCorrelationSets() == null)
+ return new HashSet<CorrelationSet>();
+
+ Set<OScope.CorrelationSet> ret = getJoiningCorrelationSets().get(
+ operation.getName());
+ if (ret == null) {
+ return Collections.EMPTY_SET;
+ }
+ return Collections.unmodifiableSet(ret);
+ }
+
+ @JsonIgnore
+ public String getMyRoleName() {
+ Object o = fieldContainer.get(MYROLENAME);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ @SuppressWarnings("unchecked")
+ public Operation getMyRoleOperation(String name) {
+ for (Operation op : (List<Operation>) getMyRolePortType()
+ .getOperations())
+ if (op.getName().equals(name))
+ return op;
+ return null;
+ }
+
+ @JsonIgnore
+ public PortType getMyRolePortType() {
+ Object o = fieldContainer.get(MYROLEPORTTYPE);
+ return o == null ? null : (PortType)o;
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ /**
+ * Get all non-initiating correlation sets that are ever used to qualify a receive for a the given
+ * operation.
+ * @param operation the operation
+ * @return all non-initiating correlation sets used in the given operation
+ */
+ @SuppressWarnings("unchecked")
+ public Set<OScope.CorrelationSet> getNonInitiatingCorrelationSetsForOperation(
+ Operation operation) {
+ Set<OScope.CorrelationSet> ret = getNonIntitiatingCorrelationSets()
+ .get(operation.getName());
+ if (ret == null) {
+ return Collections.EMPTY_SET;
+ }
+ return Collections.unmodifiableSet(ret);
+ }
+
+ @JsonIgnore
+ public QName getPartnerLinkType() {
+ Object o = fieldContainer.get(PARTNERLINKTYPE);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public String getPartnerRoleName() {
+ Object o = fieldContainer.get(PARTNERROLENAME);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Operation getPartnerRoleOperation(String name) {
+ for (Operation op : (List<Operation>) getPartnerRolePortType()
+ .getOperations())
+ if (op.getName().equals(name))
+ return op;
+ return null;
+ }
+
+ @JsonIgnore
+ public PortType getPartnerRolePortType() {
+ Object o = fieldContainer.get(PARTNERROLEPORTTYPE);
+ return o == null ? null : (PortType)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashSet<String> getCreateInstanceOperations() {
+ return (HashSet<String>)fieldContainer.get(CREATEINSTANCEOPERATIONS);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String,Set<CorrelationSet>> getJoiningCorrelationSets(){
+ Object o = fieldContainer.get(JOININGCORRELATIONSETS);
+ return o == null ? null : (HashMap<String,Set<CorrelationSet>>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String,Set<CorrelationSet>> getNonIntitiatingCorrelationSets(){
+ Object o = fieldContainer.get(NONINITIATINGCORRELATIONSETS);
+ return o == null ? null : (HashMap<String,Set<CorrelationSet>>)o;
+ }
+
+ @Override
+ public int hashCode() {
+ return getName().hashCode();
+ }
+
+ public boolean hasMyRole() {
+ return getMyRolePortType() != null;
+ }
+
+ public boolean hasPartnerRole() {
+ return getPartnerRolePortType() != null;
+ }
+
+ public boolean isCreateInstanceOperation(Operation op) {
+ return getCreateInstanceOperations().contains(op.getName());
+ }
+
+ public void setDeclaringScope(OScope declaringScope) {
+ fieldContainer.put(DECLARINGSCOPE, declaringScope);
+ }
+
+ public void setInitializePartnerRole(boolean initializePartnerRole) {
+ fieldContainer.put(INITIALIZEPARTNERROLE, initializePartnerRole);
+ }
+
+ public void setMyRoleName(String myRoleName) {
+ fieldContainer.put(MYROLENAME, myRoleName);
+ }
+
+ public void setMyRolePortType(PortType myRolePortType) {
+ fieldContainer.put(MYROLEPORTTYPE, myRolePortType);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setPartnerLinkType(QName partnerLinkType) {
+ fieldContainer.put(PARTNERLINKTYPE, partnerLinkType);
+ }
+
+ public void setPartnerRoleName(String partnerRoleName) {
+ fieldContainer.put(PARTNERROLENAME, partnerRoleName);
+ }
+
+ public void setPartnerRolePortType(PortType partnerRolePortType) {
+ fieldContainer.put(PARTNERROLEPORTTYPE, partnerRolePortType);
+ }
+
+ private void setJoiningCorrelationSets(
+ HashMap<String, Set<OScope.CorrelationSet>> joiningCorrelationSets) {
+ fieldContainer.put(JOININGCORRELATIONSETS, joiningCorrelationSets);
+ }
+ private void setNonIntitiatingCorrelationSets(HashMap<String, Set<CorrelationSet>> nics){
+ fieldContainer.put(NONINITIATINGCORRELATIONSETS, nics);
+ }
+ private void setCreateInstanceOperations(HashSet<String> cio){
+ fieldContainer.put(CREATEINSTANCEOPERATIONS, cio);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPickReceive.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPickReceive.java
new file mode 100644
index 0000000..2e8809c
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OPickReceive.java
@@ -0,0 +1,271 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of the BPEL <code><pick></code> and
+ * <codE><receive></code> activities. Because the latter is essentially
+ * a simplified version of the former, at run-time we do not distinguish
+ * between the two.
+ */
+public class OPickReceive extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String ONMESSAGES = "onMessages";
+ private static final String ONALARMS = "onAlarms";
+ private static final String CREATEINSTANCEFLAG = "createInstanceFlag";
+
+ @JsonCreator
+ public OPickReceive(){
+ setCreateInstanceFlag(false);
+ }
+ public OPickReceive(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setOnMessages(new ArrayList<OnMessage>());
+ setOnAlarms(new ArrayList<OnAlarm>());
+ setCreateInstanceFlag(false);
+ }
+
+ @JsonIgnore
+ public boolean isCreateInstanceFlag() {
+ Object o = fieldContainer.get(CREATEINSTANCEFLAG);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OnAlarm> getOnAlarms() {
+ Object o = fieldContainer.get(ONALARMS);
+ return o == null ? null : (List<OnAlarm>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OnMessage> getOnMessages() {
+ Object o = fieldContainer.get(ONMESSAGES);
+ return o == null ? null : (List<OnMessage>)o;
+ }
+
+ public void setCreateInstanceFlag(boolean createInstanceFlag) {
+ fieldContainer.put(CREATEINSTANCEFLAG, createInstanceFlag);
+ }
+
+ public void setOnAlarms(List<OnAlarm> onAlarms) {
+ fieldContainer.put(ONALARMS, onAlarms);
+ }
+
+ public void setOnMessages(List<OnMessage> onMessages) {
+ fieldContainer.put(ONMESSAGES, onMessages);
+ }
+
+ public static class OnAlarm extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String ACTIVITY = "activity";
+ private static final String FOREXPR = "forExpr";
+ private static final String UNTILEXPR = "untilExpr";
+
+ @JsonCreator
+ public OnAlarm(){}
+
+ public OnAlarm(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getForExpr() {
+ Object o = fieldContainer.get(FOREXPR);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public OExpression getUntilExpr() {
+ Object o = fieldContainer.get(UNTILEXPR);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setForExpr(OExpression forExpr) {
+ fieldContainer.put(FOREXPR, forExpr);
+ }
+
+ public void setUntilExpr(OExpression untilExpr) {
+ fieldContainer.put(UNTILEXPR, untilExpr);
+ }
+ }
+
+ public static class OnMessage extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** Correlations to initialize. */
+ private static final String INITCORRELATIONS = "initCorrelations";
+ /** Correlations to match on. */
+ private static final String MATCHCORRELATIONS = "matchCorrelations";
+
+ /** Correlations to join on. */
+ private static final String JOINCORRELATIONS = "joinCorrelations";
+ private static final String PARTNERLINK = "partnerLink";
+ private static final String OPERATION = "operation";
+ private static final String VARIABLE = "variable";
+ private static final String ACTIVITY = "activity";
+ /** OASIS addition for disambiguating receives (optional). */
+ private static final String MESSAGEEXCHANGEID = "messageExchangeId";
+ private static final String ROUTE = "route";
+
+ @JsonCreator
+ public OnMessage(){
+
+ }
+ public OnMessage(OProcess owner) {
+ super(owner);
+ setInitCorrelations(new ArrayList<CorrelationSet>());
+ setJoinCorrelations(new ArrayList<CorrelationSet>());
+ setMatchCorrelations(new ArrayList<CorrelationSet>());
+ setRoute("one");
+ setMessageExchangeId("");
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public String getCorrelatorId() {
+ return getPartnerLink().getId() + "." + getOperation().getName();
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getInitCorrelations() {
+ Object o = fieldContainer.get(INITCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getJoinCorrelations() {
+ Object o = fieldContainer.get(JOINCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getMatchCorrelations() {
+ Object o = fieldContainer.get(MATCHCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @JsonIgnore
+ public String getMessageExchangeId() {
+ Object o = fieldContainer.get(MESSAGEEXCHANGEID);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Operation getOperation() {
+ Object o = fieldContainer.get(OPERATION);
+ return o == null ? null : (Operation)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink() {
+ Object o = fieldContainer.get(PARTNERLINK);
+ return o == null ? null : (OPartnerLink)o;
+ }
+
+ @JsonIgnore
+ public String getRoute() {
+ Object o = fieldContainer.get(ROUTE);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setInitCorrelations(List<CorrelationSet> initCorrelations) {
+ if (getInitCorrelations() == null){
+ fieldContainer.put(INITCORRELATIONS, initCorrelations);
+ }
+ }
+
+ public void setJoinCorrelations(List<CorrelationSet> joinCorrelations) {
+ if (getJoinCorrelations() == null){
+ fieldContainer.put(JOINCORRELATIONS, joinCorrelations);
+ }
+ }
+
+ public void setMatchCorrelations(List<CorrelationSet> matchCorrelations) {
+ if (getMatchCorrelations() == null){
+ fieldContainer.put(MATCHCORRELATIONS, matchCorrelations);
+ }
+ }
+
+ public void setMessageExchangeId(String messageExchangeId) {
+ fieldContainer.put(MESSAGEEXCHANGEID, messageExchangeId);
+ }
+
+ public void setOperation(Operation operation) {
+ fieldContainer.put(OPERATION, operation);
+ }
+
+ public void setPartnerLink(OPartnerLink partnerLink) {
+ fieldContainer.put(PARTNERLINK, partnerLink);
+ }
+
+ public void setRoute(String route) {
+ fieldContainer.put(ROUTE, route);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+ //TODO: custom readObject -- backward compatibility
+ }
+}
\ No newline at end of file
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcess.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcess.java
new file mode 100644
index 0000000..2296210
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcess.java
@@ -0,0 +1,571 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.wsdl.Operation;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.utils.NSContext;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.deser.ResolvableDeserializer;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+
+import de.danielbechler.diff.annotation.ObjectDiffProperty;
+
+/**
+ * Compiled BPEL process representation.
+ */
+public class OProcess extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /**
+ * Change log of class version
+ * initial 1
+ * current 2
+ *
+ * 1->2:
+ * added namespaceContext attribute
+ * */
+ public static final int CURRENT_CLASS_VERSION = 2;
+
+ public static int instanceCount = 0;
+ private static final String GUID = "guid";
+ /** BPEL version. */
+ private static final String VERSION = "version";
+ /** Various constants that are needed at runtime. */
+ private static final String CONSTANTS = "constants";
+ /** Universally Unique Identifier */
+ private static final String UUID = "uuid";
+ /** Namespace of the process. */
+ private static final String TARGETNAMESPACE = "targetNamespace";
+ /** Name of the process. */
+ private static final String PROCESSNAME = "processName";
+ /** ProcessImpl-level scope. */
+ private static final String PROCESSCOPE = "procesScope";
+ /** All partner links in the process. */
+ private static final String ALLPARTNERLINKS = "allPartnerLinks";
+ private static final String PROPERTIES = "properties";
+ /** Date process was compiled. */
+ private static final String COMPILEDATE = "compileDate";
+ private static final String CHILDIDCOUNTER = "_childIdCounter";
+ private static final String CHILDREN = "_children";
+ private static final String EXPRESSIONLANGUAGES = "expressionLanguages";
+ private static final String MESSAGETYPES = "messageTypes";
+ private static final String ELEMENTTYPES = "elementTypes";
+ private static final String XSDTYPES = "xsdTypes";
+ private static final String XSLSHEETS = "xslSheets";
+ private static final String NAMESPACECONTEXT = "namespaceContext";
+
+ /**
+ * This constructor should only be used by Jackson when deserialize.
+ */
+ @JsonCreator
+ public OProcess() {
+ instanceCount ++;
+ setChildIdCounter(0);
+ }
+ public OProcess(String version) {
+ super(null);
+ setVersion(version);
+ instanceCount++;
+ setAllPartnerLinks(new HashSet<OPartnerLink>());
+ setProperties(new ArrayList<OProperty>());
+ setChildren(new ArrayList<OBase>());
+ setExpressionLanguages(new HashSet<OExpressionLanguage>());
+ setMessageTypes(new HashMap<QName, OMessageVarType>());
+ setElementTypes(new HashMap<QName, OElementVarType>());
+ setXsdTypes(new HashMap<QName, OXsdTypeVarType>());
+ setXslSheets(new HashMap<URI, OXslSheet>());
+
+ setChildIdCounter(0);
+ }
+
+ @Override
+ public void dehydrate() {
+ super.dehydrate();
+ getProcesScope().dehydrate();
+ getAllPartnerLinks().clear();
+ for (OBase obase : getChildren()) {
+ obase.dehydrate();
+ }
+ getChildren().clear();
+ getMessageTypes().clear();
+ getElementTypes().clear();
+ getXsdTypes().clear();
+ getXslSheets().clear();
+ }
+
+ @Override
+ public String digest() {
+ return getProcessName() + ";" + getProcesScope().digest();
+ }
+
+ protected void finalize() throws Throwable {
+ instanceCount--;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OPartnerLink> getAllPartnerLinks() {
+ Set<OPartnerLink> links = (Set<OPartnerLink>) fieldContainer
+ .get(ALLPARTNERLINKS);
+ return links;
+ }
+
+ public OBase getChild(final int id) {
+ for (int i = getChildren().size() - 1; i >= 0; i--) {
+ OBase child = getChildren().get(i);
+ if (child.getId() == id)
+ return child;
+ }
+ return null;
+ }
+
+ @JsonIgnore
+ int getChildIdCounter() {
+ Object o = fieldContainer.get(CHILDIDCOUNTER);
+ return o == null ? 0 : (Integer)o;
+ }
+
+ @JsonIgnore
+ public List<OBase> getChildren() {
+ Object o = fieldContainer.get(CHILDREN);
+ return o == null ? null : (List<OBase>)o;
+ }
+
+ @JsonIgnore
+ public Date getCompileDate() {
+ Object o = fieldContainer.get(COMPILEDATE);
+ return o == null ? null : (Date)o;
+ }
+
+ @JsonIgnore
+ public OConstants getConstants() {
+ Object o = fieldContainer.get(CONSTANTS);
+ return o == null ? null : (OConstants)o;
+ }
+
+ @ObjectDiffProperty(ignore = true)
+ @JsonIgnore
+ @SuppressWarnings("unchecked")
+ public List<String> getCorrelators() {
+ // MOVED from ProcessSchemaGenerator
+ List<String> correlators = new ArrayList<String>();
+
+ for (OPartnerLink plink : getAllPartnerLinks()) {
+ if (plink.hasMyRole()) {
+ for (Iterator opI = plink.getMyRolePortType().getOperations()
+ .iterator(); opI.hasNext();) {
+ Operation op = (Operation) opI.next();
+ correlators.add(plink.getName() + "." + op.getName());
+ }
+ }
+ }
+
+ return correlators;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<QName, OElementVarType> getElementTypes() {
+ return (HashMap<QName, OElementVarType>) fieldContainer
+ .get(ELEMENTTYPES);
+ }
+
+ @JsonIgnore
+ @SuppressWarnings("unchecked")
+ public HashSet<OExpressionLanguage> getExpressionLanguages() {
+ //TODO conflicts with legacy impl of this method
+ return (HashSet<OExpressionLanguage>) fieldContainer
+ .get(EXPRESSIONLANGUAGES);
+ }
+
+ @JsonIgnore
+ public String getGuid() {
+ Object o = fieldContainer.get(GUID);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<QName, OMessageVarType> getMessageTypes() {
+ return (HashMap<QName, OMessageVarType>) fieldContainer
+ .get(MESSAGETYPES);
+ }
+
+ @JsonIgnore
+ public String getName() {
+ return getProcessName();
+ }
+
+ @JsonIgnore
+ public NSContext getNamespaceContext() {
+ Object o = fieldContainer.get(NAMESPACECONTEXT);
+ return o == null ? null : (NSContext)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink(String name) {
+ for (OPartnerLink partnerLink : getAllPartnerLinks()) {
+ if (partnerLink.getName().equals(name)) {
+ return partnerLink;
+ }
+ }
+ return null;
+ }
+
+ @JsonIgnore
+ public OScope getProcesScope() {
+ Object o = fieldContainer.get(PROCESSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ @JsonIgnore
+ public String getProcessName() {
+ Object o = fieldContainer.get(PROCESSNAME);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OProperty> getProperties() {
+ Object o = fieldContainer.get(PROPERTIES);
+ return o == null ? null : (List<OProperty>)o;
+ }
+
+ @ObjectDiffProperty(ignore = true)
+ @JsonIgnore
+ public QName getQName() {
+ return new QName(getTargetNamespace(), getProcessName());
+ }
+
+ public OScope getScope(String scopeName) {
+ throw new UnsupportedOperationException();
+ }
+
+ @JsonIgnore
+ public String getTargetNamespace() {
+ Object o = fieldContainer.get(TARGETNAMESPACE);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public String getUuid() {
+ Object o = fieldContainer.get(UUID);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public String getVersion() {
+ Object o = fieldContainer.get(VERSION);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<QName, OXsdTypeVarType> getXsdTypes() {
+ Object o = fieldContainer.get(XSDTYPES);
+ return o == null ? null : (HashMap<QName, OXsdTypeVarType>)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<URI, OXslSheet> getXslSheets() {
+ Object o = fieldContainer.get(XSLSHEETS);
+ return o == null ? null : (HashMap<URI, OXslSheet>)o;
+ }
+
+ public void setAllPartnerLinks(Set<OPartnerLink> allPartnerLinks) {
+ if (getAllPartnerLinks() == null) {
+ fieldContainer.put(ALLPARTNERLINKS, allPartnerLinks);
+ }
+ }
+
+ void setChildIdCounter(int childIdCounter) {
+ fieldContainer.put(CHILDIDCOUNTER, childIdCounter);
+ }
+
+ void setChildren(List<OBase> children) {
+ fieldContainer.put(CHILDREN, children);
+ }
+
+ public void setCompileDate(Date compileDate) {
+ fieldContainer.put(COMPILEDATE, compileDate);
+ }
+
+ public void setConstants(OConstants constants) {
+ fieldContainer.put(CONSTANTS, constants);
+ }
+
+ public void setElementTypes(HashMap<QName, OElementVarType> elementTypes) {
+ if (getElementTypes() == null) {
+ fieldContainer.put(ELEMENTTYPES, elementTypes);
+ }
+ }
+
+ public void setExpressionLanguages(
+ HashSet<OExpressionLanguage> expressionLanguages) {
+ if (getExpressionLanguages() == null) {
+ fieldContainer.put(EXPRESSIONLANGUAGES, expressionLanguages);
+ }
+ }
+
+ public void setGuid(String guid) {
+ fieldContainer.put(GUID, guid);
+ }
+
+ public void setMessageTypes(HashMap<QName, OMessageVarType> messageTypes) {
+ if (getMessageTypes() == null) {
+ fieldContainer.put(MESSAGETYPES, messageTypes);
+ }
+ }
+
+ public void setNamespaceContext(NSContext namespaceContext) {
+ fieldContainer.put(NAMESPACECONTEXT, namespaceContext);
+ }
+
+ public void setProcesScope(OScope procesScope) {
+ fieldContainer.put(PROCESSCOPE, procesScope);
+ }
+
+ public void setProcessName(String processName) {
+ fieldContainer.put(PROCESSNAME, processName);
+ }
+
+ public void setProperties(List<OProperty> properties) {
+ if (getProperties() == null) {
+ fieldContainer.put(PROPERTIES, properties);
+ }
+ }
+
+ public void setTargetNamespace(String targetNamespace) {
+ fieldContainer.put(TARGETNAMESPACE, targetNamespace);
+ }
+
+ public void setUuid(String uuid) {
+ fieldContainer.put(UUID, uuid);
+ }
+
+ public void setVersion(String version) {
+ fieldContainer.put(VERSION, version);
+ }
+
+ public void setXsdTypes(HashMap<QName, OXsdTypeVarType> xsdTypes) {
+ if (getXsdTypes() == null) {
+ fieldContainer.put(XSDTYPES, xsdTypes);
+ }
+ }
+
+ public void setXslSheets(HashMap<URI, OXslSheet> xslSheets) {
+ if (getXslSheets() == null) {
+ fieldContainer.put(XSLSHEETS, xslSheets);
+ }
+ }
+
+ private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException{
+ ois.defaultReadObject();
+ fieldContainer.remove(NAMESPACECONTEXT);
+ }
+
+ public static class OProperty extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String ALIASES = "aliases";
+ private static final String NAME = "name";
+
+ @JsonCreator
+ public OProperty(){}
+ public OProperty(OProcess process) {
+ super(process);
+ setAliases(new ArrayList<OPropertyAlias>());
+ }
+
+ public OPropertyAlias getAlias(OVarType messageType) {
+ for (OPropertyAlias aliase : getAliases())
+ if (aliase.getVarType().equals(messageType))
+ return aliase;
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OPropertyAlias> getAliases() {
+ Object o = fieldContainer.get(ALIASES);
+ return o == null ? null : (List<OPropertyAlias>)o;
+ }
+
+ @JsonIgnore
+ public QName getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (QName)o;
+ }
+
+ public void setAliases(List<OPropertyAlias> aliases) {
+ fieldContainer.put(ALIASES, aliases);
+ }
+
+ public void setName(QName name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public String toString() {
+ return "{OProperty " + getName() + "}";
+ }
+ }
+
+ public static class OPropertyAlias extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /**
+ * Change log of class version
+ * initial 1
+ * current 2
+ *
+ * 1->2:
+ * added header attribute
+ * */
+ public static final int CURRENT_CLASS_VERSION = 2;
+
+ private static final String VARTYPE = "varType";
+
+ /** For BPEL 1.1 */
+ private static final String PART = "part";
+ private static final String HEADER = "header";
+ private static final String LOCATION = "location";
+
+ @JsonCreator
+ public OPropertyAlias(){}
+
+ public OPropertyAlias(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public String getDescription() {
+ StringBuffer buf = new StringBuffer(getVarType().toString());
+ buf.append('[');
+ buf.append(getPart() != null ? getPart().getName() : "");
+ buf.append(getHeader() != null ? "header: " + getHeader() : "");
+ if (getLocation() != null) {
+ buf.append("][");
+ buf.append(getLocation().toString());
+ }
+ buf.append(']');
+ return buf.toString();
+ }
+
+ @JsonIgnore
+ public String getHeader() {
+ Object o = fieldContainer.get(HEADER);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public OExpression getLocation() {
+ Object o = fieldContainer.get(LOCATION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public Part getPart() {
+ Object o = fieldContainer.get(PART);
+ return o == null ? null : (Part)o;
+ }
+
+ @JsonIgnore
+ public OVarType getVarType() {
+ Object o = fieldContainer.get(VARTYPE);
+ return o == null ? null : (OVarType)o;
+ }
+
+ public void setHeader(String header) {
+ fieldContainer.put(HEADER, header);
+ }
+
+ public void setLocation(OExpression location) {
+ fieldContainer.put(LOCATION, location);
+ }
+
+ public void setPart(Part part) {
+ fieldContainer.put(PART, part);
+ }
+
+ public void setVarType(OVarType varType) {
+ fieldContainer.put(VARTYPE, varType);
+ }
+
+ public String toString() {
+ return "{OPropertyAlias " + getDescription() + "}";
+ }
+
+ }
+
+ /**
+ * custom deserializer of OProcess.
+ * @author fangzhen
+ * @deprecated unnecessary now
+ */
+ public static class OProcessDeser extends StdDeserializer<OProcess>
+ implements ResolvableDeserializer {
+ private static final long serialVersionUID = 7750214662590623362L;
+ private JsonDeserializer<?> defaultDeserializer;
+
+ public OProcessDeser(JsonDeserializer<?> defaultDeserializer) {
+ super(OProcess.class);
+ this.defaultDeserializer = defaultDeserializer;
+ }
+
+ @Override
+ public OProcess deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ OProcess process = (OProcess) defaultDeserializer.deserialize(jp,
+ ctxt);
+ OProcess.instanceCount++;
+ return process;
+ }
+
+ // for some reason you have to implement ResolvableDeserializer when modifying BeanDeserializer
+ // otherwise deserializing throws JsonMappingException??
+ @Override
+ public void resolve(DeserializationContext ctxt)
+ throws JsonMappingException {
+ ((ResolvableDeserializer) defaultDeserializer).resolve(ctxt);
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcessWrapper.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcessWrapper.java
new file mode 100644
index 0000000..baf2674
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OProcessWrapper.java
@@ -0,0 +1,134 @@
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory.SerializeFormat;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * The class maintains all data that should be serialized. Including headers
+ * like magic number, format etc. and the BPEL process. The header and whole
+ * class could be extended.
+ *
+ * An example:
+ * {
+ * "MAGIC":"VTVTAE9GSCAUBSk=",
+ * "FORMAT":16,
+ * "COMPILE_TIME":1401935206665,
+ * "OTHER_HEADERS":{},
+ * "PROCESS":{}
+ * }
+ *
+ * @author fangzhen
+ */
+public class OProcessWrapper extends ExtensibleImpl implements Serializable{
+ public static final long serialVersionUID = -1L;
+ // constants
+ public static final byte[] MAGIC_NUMBER_OFH_20140529 = new byte[] { 0x55,
+ '5', 'S', 0x00, 'O', 'F', 'H', 0x20, 0x14, 0x05, 0x29 };
+ public static final byte[] CURRENT_MAGIC_NUMBER = MAGIC_NUMBER_OFH_20140529;
+ // key constants
+ private static final String MAGIC_NUMBER = "magic";
+ private static final String FORMAT = "format";
+ private static final String COMPILE_TIME = "compileTime";
+ private static final String GUID = "guid";
+ private static final String PROCESS = "process";
+ private static final String OTHER_HEADERS = "otherHeaders";
+ private static final String TYPE = "type";
+
+ public OProcessWrapper() {
+ super(new LinkedHashMap<String, Object>());
+ setMagic(OProcessWrapper.CURRENT_MAGIC_NUMBER);
+ setCompileTime(0);
+ setFormat(SerializeFormat.FORMAT_UNINITIALIZED);
+ setOtherHeaders(new LinkedHashMap<String, Object>());
+
+ }
+
+ public OProcessWrapper(long compileTime) {
+ this();
+ setCompileTime(compileTime);
+ }
+
+
+ public void checkValid() throws OModelException {
+ if (!Arrays.equals(getMagic(), MAGIC_NUMBER_OFH_20140529)){
+ throw new OModelException("Unrecognized magic number");
+ }
+ }
+
+ //Accessors
+ @JsonIgnore
+ public QName getType(){
+ return (QName)fieldContainer.get(TYPE);
+ }
+ public void setType(QName qname){
+ fieldContainer.put(TYPE, qname);
+ }
+ private void setType(String namespace, String local){
+ fieldContainer.put(TYPE, new QName(namespace, local));
+ }
+ @JsonIgnore
+ public byte[] getMagic() {
+ return (byte[])fieldContainer.get(MAGIC_NUMBER);
+ }
+
+ public void setMagic(byte[] magic) {
+ fieldContainer.put(MAGIC_NUMBER, magic);
+ }
+
+ @JsonIgnore
+ public SerializeFormat getFormat() {
+ return (SerializeFormat)fieldContainer.get(FORMAT);
+ }
+
+ public void setFormat(SerializeFormat format) {
+ fieldContainer.put(FORMAT, format);
+ }
+
+ @JsonIgnore
+ public long getCompileTime() {
+ return (Long)fieldContainer.get(COMPILE_TIME);
+ }
+
+ public void setCompileTime(long compileTime) {
+ fieldContainer.put(COMPILE_TIME, compileTime);
+ }
+
+ @JsonIgnore
+ public String getGuid() {
+ return (String)fieldContainer.get(GUID);
+ }
+
+ public void setGuid(String guid) {
+ fieldContainer.put(GUID, guid);
+ }
+
+ @JsonIgnore
+ @SuppressWarnings("unchecked")
+ public Map<String, Object> getOtherHeaders() {
+ Object o = fieldContainer.get(OTHER_HEADERS);
+ return o == null ? null : (Map<String,Object>)o;
+ }
+
+ public void setOtherHeaders(Map<String, Object> otherHeaders) {
+ fieldContainer.put(OTHER_HEADERS, otherHeaders);
+ }
+
+ @JsonIgnore
+ public OProcess getProcess() {
+ return (OProcess)fieldContainer.get(PROCESS);
+ }
+ public void setProcess(OProcess process) {
+ setGuid(process.getGuid());
+ setType(process.getTargetNamespace(), process.getProcessName());
+ fieldContainer.put(OProcessWrapper.PROCESS, process);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORepeatUntil.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORepeatUntil.java
new file mode 100644
index 0000000..8403d29
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORepeatUntil.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of a <code><repeatUntil></code> activity.
+ *
+ * @author Maciej Szefler ( m s z e f l e r @ g m a i l . c o m )
+ */
+public class ORepeatUntil extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** The repeat until condition. */
+ private static final String UNTILCONDITION = "untilCondition";
+
+ private static final String ACTIVITY = "activity";
+
+ @JsonCreator
+ public ORepeatUntil(){}
+ public ORepeatUntil(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getUntilCondition() {
+ Object o = fieldContainer.get(UNTILCONDITION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setUntilCondition(OExpression untilCondition) {
+ fieldContainer.put(UNTILCONDITION, untilCondition);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OReply.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OReply.java
new file mode 100644
index 0000000..de290c2
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OReply.java
@@ -0,0 +1,176 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.wsdl.Operation;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of the BPEL <code><reply></code> activity.
+ */
+public class OReply extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /** Is this a Fault reply? */
+ private static final String ISFAULTREPLY = "isFaultReply";
+
+ /** The type of the fault (if isFaultReply). */
+ private static final String FAULT = "fault";
+
+ private static final String PARTNERLINK = "partnerLink";
+ private static final String OPERATION = "operation";
+ private static final String VARIABLE = "variable";
+ /** Correlation sets initialized. */
+ private static final String INITCORRELATIONS = "initCorrelations";
+
+ /** Correlation sets asserted. */
+ private static final String ASSERTCORRELATIONS = "assertCorrelations";
+
+ /** Correlation sets joined. */
+ private static final String JOINCORRELATIONS = "joinCorrelations";
+
+ /** OASIS modification - Message Exchange Id. */
+ private static final String MESSAGEEXCHANGEID = "messageExchangeId";
+
+ @JsonCreator
+ public OReply(){
+ setIsFaultReply(false);
+ }
+ public OReply(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setInitCorrelations(new ArrayList<CorrelationSet>());
+ setJoinCorrelations(new ArrayList<CorrelationSet>());
+ setAssertCorrelations(new ArrayList<CorrelationSet>());
+ setMessageExchangeId("");
+ setIsFaultReply(false);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getAssertCorrelations() {
+ Object o = fieldContainer.get(ASSERTCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @JsonIgnore
+ public QName getFault() {
+ Object o = fieldContainer.get(FAULT);
+ return o == null ? null : (QName)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getInitCorrelations() {
+ Object o = fieldContainer.get(INITCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @JsonIgnore
+ public boolean isIsFaultReply() {
+ Object o = fieldContainer.get(ISFAULTREPLY);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<CorrelationSet> getJoinCorrelations() {
+ Object o = fieldContainer.get(JOINCORRELATIONS);
+ return o == null ? null : (List<CorrelationSet>)o;
+ }
+
+ @JsonIgnore
+ public String getMessageExchangeId() {
+ Object o = fieldContainer.get(MESSAGEEXCHANGEID);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public Operation getOperation() {
+ Object o = fieldContainer.get(OPERATION);
+ return o == null ? null : (Operation)o;
+ }
+
+ @JsonIgnore
+ public OPartnerLink getPartnerLink() {
+ Object o = fieldContainer.get(PARTNERLINK);
+ return o == null ? null : (OPartnerLink)o;
+ }
+
+ @JsonIgnore
+ public Variable getVariable() {
+ Object o = fieldContainer.get(VARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setAssertCorrelations(List<CorrelationSet> assertCorrelations) {
+ if (getAssertCorrelations() == null){
+ fieldContainer.put(ASSERTCORRELATIONS, assertCorrelations);
+ }
+ }
+
+ public void setFault(QName fault) {
+ fieldContainer.put(FAULT, fault);
+ }
+
+ public void setInitCorrelations(List<CorrelationSet> initCorrelations) {
+ if (getInitCorrelations() == null){
+ fieldContainer.put(INITCORRELATIONS, initCorrelations);
+ }
+ }
+
+ public void setIsFaultReply(boolean isFaultReply) {
+ fieldContainer.put(ISFAULTREPLY, isFaultReply);
+ }
+
+ public void setJoinCorrelations(List<CorrelationSet> joinCorrelations) {
+ if (getJoinCorrelations() == null){
+ fieldContainer.put(JOINCORRELATIONS, joinCorrelations);
+ }
+ }
+
+ public void setMessageExchangeId(String messageExchangeId) {
+ fieldContainer.put(MESSAGEEXCHANGEID, messageExchangeId);
+ }
+
+ public void setOperation(Operation operation) {
+ fieldContainer.put(OPERATION, operation);
+ }
+
+ public void setPartnerLink(OPartnerLink partnerLink) {
+ fieldContainer.put(PARTNERLINK, partnerLink);
+ }
+
+ public void setVariable(Variable variable) {
+ fieldContainer.put(VARIABLE, variable);
+ }
+ //TODO: custom readObject -- backward compatibility
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORethrow.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORethrow.java
new file mode 100644
index 0000000..803886c
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/ORethrow.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class ORethrow extends OActivity implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ @JsonCreator
+ public ORethrow(){}
+ public ORethrow(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OScope.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OScope.java
new file mode 100644
index 0000000..3527b1e
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OScope.java
@@ -0,0 +1,490 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of a BPEL scope. Instances of this class
+ * are generated by the BPEL compiler.
+ */
+public class OScope extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ /**
+ * Change log of class version
+ * initial 1
+ * current 2
+ *
+ * 1->2:
+ * added isolatedScope attribute
+ * */
+ public static final int CURRENT_CLASS_VERSION = 2;
+ /** Name of the scope. */
+ private static final String NAME = "name";
+
+ /** ScopeLikeConstructImpl's fault handler. */
+ private static final String FAULTHANDLER = "faultHandler";
+
+ /** The activity that gets executed within this scope. */
+ private static final String ACTIVITY = "activity";
+
+ /** ScopeLikeConstructImpl's compensation handler. */
+ private static final String COMPENSATIONHANDLER = "compensationHandler";
+
+ /** ScopeLikeConstructImpl's termination handler. */
+ private static final String TERMINATIONHANDLER = "terminationHandler";
+
+ /** ScopeLikeConstructImpl's event handler. */
+ private static final String EVENTHANDLER = "eventHandler";
+
+ /** Variables declared within the scope. */
+ private static final String VARIABLES = "variables";
+
+ /** OCorrelation sets declared within the scope. */
+ private static final String CORRELATIONSETS = "correlationSets";
+
+ private static final String PARTNERLINKS = "partnerLinks";
+
+ /** The descendants of this scope that can be compensated from the FH/CH of this scope. */
+ private static final String COMPENSATABLE = "compensatable";
+
+ private static final String IMPLICITSCOPE = "implicitScope";
+
+ /** Is this scope <em>atomic</em> i.e. meant to execute in a single transaction. */
+ private static final String ATOMICSCOPE = "atomicScope";
+
+ /** Is this scope <em>isolated</em> i.e. protected against concurrent access to its variables. */
+ private static final String ISOLATEDSCOPE = "isolatedScope";
+
+ @JsonCreator
+ public OScope(){
+ initPrimitive();
+ }
+ public OScope(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setVariables(new HashMap<String, Variable>());
+ setCorrelationSets(new HashMap<String, CorrelationSet>());
+ setPartnerLinks(new HashMap<String, OPartnerLink>());
+ setCompensatable(new HashSet<OScope>());
+
+ initPrimitive();
+ }
+ private void initPrimitive(){
+ setAtomicScope(false);
+ setImplicitScope(false);
+ setIsolatedScope(false);
+ }
+
+ public void addCorrelationSet(CorrelationSet ocset) {
+ getCorrelationSets().put(ocset.getName(), ocset);
+ }
+
+ public void addLocalVariable(Variable variable) {
+ getVariables().put(variable.getName(), variable);
+ }
+
+ @Override
+ public void dehydrate() {
+ super.dehydrate();
+ setActivity(null);
+ if (getCompensatable() != null) {
+ getCompensatable().clear();
+ }
+ if (getCompensationHandler() != null) {
+ getCompensationHandler().dehydrate();
+ setCompensationHandler(null);
+ }
+ if (getTerminationHandler() != null) {
+ getTerminationHandler().dehydrate();
+ setTerminationHandler(null);
+ }
+ if (getEventHandler() != null) {
+ getEventHandler().dehydrate();
+ setEventHandler(null);
+ }
+ if (getVariables() != null) {
+ getVariables().clear();
+ }
+ if (getCorrelationSets() != null) {
+ getCorrelationSets().clear();
+ }
+ if (getPartnerLinks() != null) {
+ getPartnerLinks().clear();
+ }
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public boolean isAtomicScope() {
+ Object o = fieldContainer.get(ATOMICSCOPE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Set<OScope> getCompensatable() {
+ Object o = fieldContainer.get(COMPENSATABLE);
+ return o == null ? null : (Set<OScope>)o;
+ }
+
+ @JsonIgnore
+ public OCompensationHandler getCompensationHandler() {
+ Object o = fieldContainer.get(COMPENSATIONHANDLER);
+ return o == null ? null : (OCompensationHandler)o;
+ }
+
+ /**
+ * Obtains the correlation set visible in current scope or parent scope.
+ *
+ * @param corrName correlation set name
+ *
+ * @return
+ */
+ public CorrelationSet getCorrelationSet(String corrName) {
+ return getCorrelationSets().get(corrName);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Map<String, CorrelationSet> getCorrelationSets() {
+ return (Map<String, CorrelationSet>) fieldContainer
+ .get(CORRELATIONSETS);
+ }
+
+ @JsonIgnore
+ public OEventHandler getEventHandler() {
+ Object o = fieldContainer.get(EVENTHANDLER);
+ return o == null ? null : (OEventHandler)o;
+ }
+
+ @JsonIgnore
+ public OFaultHandler getFaultHandler() {
+ Object o = fieldContainer.get(FAULTHANDLER);
+ return o == null ? null : (OFaultHandler)o;
+ }
+
+ @JsonIgnore
+ public boolean isImplicitScope() {
+ Object o = fieldContainer.get(IMPLICITSCOPE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public boolean isIsolatedScope() {
+ Object o = fieldContainer.get(ISOLATEDSCOPE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ public OPartnerLink getLocalPartnerLink(String name) {
+ return getPartnerLinks().get(name);
+ }
+
+ /**
+ *
+ * Get a localy-defined variable by name.
+ * @param varName name of variable
+ *
+ * @return
+ */
+ public Variable getLocalVariable(final String varName) {
+ return getVariables().get(varName);
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public Map<String, OPartnerLink> getPartnerLinks() {
+ Object o = fieldContainer.get(PARTNERLINKS);
+ return o == null ? null : (Map<String, OPartnerLink>)o;
+ }
+
+ @JsonIgnore
+ public OTerminationHandler getTerminationHandler() {
+ Object o = fieldContainer.get(TERMINATIONHANDLER);
+ return o == null ? null : (OTerminationHandler)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public HashMap<String, Variable> getVariables() {
+ Object o = fieldContainer.get(VARIABLES);
+ return o == null ? null : (HashMap<String, Variable>)o;
+ }
+
+ public OPartnerLink getVisiblePartnerLink(String name) {
+ OActivity current = this;
+ OPartnerLink plink;
+ while (current != null) {
+ if (current instanceof OScope) {
+ plink = ((OScope) current).getLocalPartnerLink(name);
+ if (plink != null)
+ return plink;
+ }
+ current = current.getParent();
+ }
+ return null;
+ }
+
+ public Variable getVisibleVariable(String varName) {
+ OActivity current = this;
+ Variable variable;
+ while (current != null) {
+ if (current instanceof OScope) {
+ variable = ((OScope) current).getLocalVariable(varName);
+ if (variable != null)
+ return variable;
+ }
+ current = current.getParent();
+ }
+ return null;
+ }
+ @JsonIgnore
+ public boolean isInAtomicScope() {
+ OActivity current = this;
+ while (current != null) {
+ if (current instanceof OScope && ((OScope)current).isAtomicScope())
+ return true;
+ current = current.getParent();
+ }
+ return false;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setAtomicScope(boolean atomicScope) {
+ fieldContainer.put(ATOMICSCOPE, atomicScope);
+ }
+
+ public void setCompensatable(Set<OScope> compensatable) {
+ if (getCompensatable() == null) {
+ fieldContainer.put(COMPENSATABLE, compensatable);
+ }
+ }
+
+ public void setCompensationHandler(OCompensationHandler compensationHandler) {
+ fieldContainer.put(COMPENSATIONHANDLER, compensationHandler);
+ }
+
+ public void setCorrelationSets(Map<String, CorrelationSet> correlationSets) {
+ if (getCorrelationSets() == null) {
+ fieldContainer.put(CORRELATIONSETS, correlationSets);
+ }
+ }
+
+ public void setEventHandler(OEventHandler eventHandler) {
+ fieldContainer.put(EVENTHANDLER, eventHandler);
+ }
+
+ public void setFaultHandler(OFaultHandler faultHandler) {
+ fieldContainer.put(FAULTHANDLER, faultHandler);
+ }
+
+ public void setImplicitScope(boolean implicitScope) {
+ fieldContainer.put(IMPLICITSCOPE, implicitScope);
+ }
+
+ public void setIsolatedScope(boolean isolatedScope) {
+ fieldContainer.put(ISOLATEDSCOPE, isolatedScope);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setPartnerLinks(Map<String, OPartnerLink> partnerLinks) {
+ if (getPartnerLinks() == null) {
+ fieldContainer.put(PARTNERLINKS, partnerLinks);
+ }
+ }
+
+ public void setTerminationHandler(OTerminationHandler terminationHandler) {
+ fieldContainer.put(TERMINATIONHANDLER, terminationHandler);
+ }
+
+ public void setVariables(HashMap<String, Variable> variables) {
+ if (getVariables() == null) {
+ fieldContainer.put(VARIABLES, variables);
+ }
+ }
+
+ public String toString() {
+ return "{OScope '" + getName() + "' id=" + getId() + "}";
+ }
+
+ public static final class CorrelationSet extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ private static final String NAME = "name";
+ private static final String DECLARINGSCOPE = "declaringScope";
+ private static final String PROPERTIES = "properties";
+
+ /**
+ * Indicates that this correlation set has a join use case in the scope.
+ */
+ private static final String HASJOINUSECASES = "hasJoinUseCases";
+
+ @JsonCreator
+ public CorrelationSet(){
+ setHasJoinUseCases(false);
+ }
+ public CorrelationSet(OProcess owner) {
+ super(owner);
+ setProperties(new ArrayList<OProcess.OProperty>());
+ setHasJoinUseCases(false);
+ }
+
+ @JsonIgnore
+ public OScope getDeclaringScope() {
+ Object o = fieldContainer.get(DECLARINGSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ @JsonIgnore
+ public boolean isHasJoinUseCases() {
+ Object o = fieldContainer.get(HASJOINUSECASES);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OProperty> getProperties() {
+ Object o = fieldContainer.get(PROPERTIES);
+ return o == null ? null : (List<OProperty>)o;
+ }
+
+ public void setDeclaringScope(OScope declaringScope) {
+ fieldContainer.put(DECLARINGSCOPE, declaringScope);
+ }
+
+ public void setHasJoinUseCases(boolean hasJoinUseCases) {
+ fieldContainer.put(HASJOINUSECASES, hasJoinUseCases);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setProperties(List<OProperty> properties) {
+ fieldContainer.put(PROPERTIES, properties);
+ }
+
+ public String toString() {
+ return "{CSet " + getName() + " " + getProperties() + "}";
+ }
+ }
+
+ public static final class Variable extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String NAME = "name";
+ private static final String DECLARINGSCOPE = "declaringScope";
+ private static final String TYPE = "type";
+ /** If not-null indicates that this variable has an external representation. */
+ private static final String EXTVAR = "extVar";
+
+ @JsonCreator
+ public Variable(){}
+ public Variable(OProcess owner, OVarType type) {
+ super(owner);
+ setType(type);
+ }
+
+ @JsonIgnore
+ public OScope getDeclaringScope() {
+ Object o = fieldContainer.get(DECLARINGSCOPE);
+ return o == null ? null : (OScope)o;
+ }
+
+ @JsonIgnore
+ public String getDescription() {
+ StringBuffer buf = new StringBuffer(getDeclaringScope().getName());
+ buf.append('.');
+ buf.append(getName());
+ return buf.toString();
+ }
+
+ @JsonIgnore
+ public OExtVar getExtVar() {
+ Object o = fieldContainer.get(EXTVAR);
+ return o == null ? null : (OExtVar)o;
+ }
+
+ @JsonIgnore
+ public String getName() {
+ Object o = fieldContainer.get(NAME);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public OVarType getType() {
+ Object o = fieldContainer.get(TYPE);
+ return o == null ? null : (OVarType)o;
+ }
+
+ public void setDeclaringScope(OScope declaringScope) {
+ fieldContainer.put(DECLARINGSCOPE, declaringScope);
+ }
+
+ public void setExtVar(OExtVar extVar) {
+ fieldContainer.put(EXTVAR, extVar);
+ }
+
+ public void setName(String name) {
+ fieldContainer.put(NAME, name);
+ }
+
+ public void setType(OVarType type) {
+ fieldContainer.put(TYPE, type);
+ }
+
+ public String toString() {
+ return "{Variable " + getDescription() + ":" + getType() + "}";
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSequence.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSequence.java
new file mode 100644
index 0000000..c4e46ab
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSequence.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of the BPEL <code><sequence></code> activity.
+ */
+public class OSequence extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String SEQUENCE = "sequence";
+
+ @JsonCreator
+ public OSequence(){}
+ public OSequence(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setSequence(new ArrayList<OActivity>());
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OActivity> getSequence() {
+ Object o = fieldContainer.get(SEQUENCE);
+ return o == null ? null : (List<OActivity>)o;
+ }
+
+ public void setSequence(List<OActivity> sequence) {
+ fieldContainer.put(SEQUENCE, sequence);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSwitch.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSwitch.java
new file mode 100644
index 0000000..04957da
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OSwitch.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of a BPEL <code><switch></code>. The
+ * BPEL compiler generates instances of this class.
+ */
+public class OSwitch extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ /**
+ * The cases declared within the <code><switch></code> actvity.
+ */
+ private static final String CASES = "_cases";
+
+ public OSwitch(){}
+ public OSwitch(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ setCases(new ArrayList<OCase>());
+ }
+
+ @SuppressWarnings("unchecked")
+ public void addCase(OCase acase) {
+ ((List<OCase>)fieldContainer.get(CASES)).add(acase);
+ }
+
+ @SuppressWarnings("unchecked")
+ @JsonIgnore
+ public List<OCase> getCases() {
+ return (List<OCase>)fieldContainer.get(CASES);
+ }
+ private void setCases(List<OCase> cases){
+ fieldContainer.put(CASES, cases);
+ }
+
+ public static class OCase extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String EXPRESSION = "expression";
+ private static final String ACTIVITY = "activity";
+
+ @JsonCreator
+ public OCase(){}
+ public OCase(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getExpression() {
+ Object o = fieldContainer.get(EXPRESSION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setExpression(OExpression expression) {
+ fieldContainer.put(EXPRESSION, expression);
+ }
+ }
+}
\ No newline at end of file
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminate.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminate.java
new file mode 100644
index 0000000..9b4fbe6
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminate.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+/**
+ * Compiled representation of the BPEL <code><terminate></code> activity.
+ */
+public class OTerminate extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ @JsonCreator
+ public OTerminate(){}
+
+ public OTerminate(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminationHandler.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminationHandler.java
new file mode 100644
index 0000000..65566d0
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OTerminationHandler.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+public class OTerminationHandler extends OScope implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ @JsonCreator
+ public OTerminationHandler(){}
+
+ public OTerminationHandler(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OThrow.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OThrow.java
new file mode 100644
index 0000000..134e4dc
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OThrow.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.OScope.Variable;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of the BPEL <code><throw></code> activity.
+ */
+public class OThrow extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String FAULTVARIABLE = "faultVariable";
+
+ private static final String FAULTNAME = "faultName";
+
+ @JsonCreator
+ public OThrow(){}
+ public OThrow(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ @JsonIgnore
+ public QName getFaultName() {
+ Object o = fieldContainer.get(FAULTNAME);
+ return o == null ? null : (QName)o;
+ }
+
+ @JsonIgnore
+ public Variable getFaultVariable() {
+ Object o = fieldContainer.get(FAULTVARIABLE);
+ return o == null ? null : (Variable)o;
+ }
+
+ public void setFaultName(QName faultName) {
+ fieldContainer.put(FAULTNAME, faultName);
+ }
+
+ public void setFaultVariable(Variable faultVariable) {
+ fieldContainer.put(FAULTVARIABLE, faultVariable);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OVarType.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OVarType.java
new file mode 100644
index 0000000..2604d59
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OVarType.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+
+/**
+ * Base class for variable types.
+ */
+public abstract class OVarType extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+
+ @JsonCreator
+ public OVarType(){}
+
+ public OVarType(OProcess owner) {
+ super(owner);
+ }
+
+ /**
+ * Create a new instance of this variable.
+ * @return a "skeleton" representation of this variable
+ */
+ public abstract Node newInstance(Document doc);
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWait.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWait.java
new file mode 100644
index 0000000..d8a0bde
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWait.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Wait object
+ */
+public class OWait extends OActivity implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String FOREXPRESSION = "forExpression";
+ private static final String UNTILEXPRESSION = "untilExpression";
+
+ @JsonCreator
+ public OWait(){}
+
+ public OWait(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ @JsonIgnore
+ public OExpression getForExpression() {
+ Object o = fieldContainer.get(FOREXPRESSION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ @JsonIgnore
+ public OExpression getUntilExpression() {
+ Object o = fieldContainer.get(UNTILEXPRESSION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ /**
+ * Is wait a duration?
+ * @return
+ */
+ public boolean hasFor() {
+ return getForExpression() != null;
+ }
+
+ /**
+ * Is wait an until?
+ * @return
+ */
+ public boolean hasUntil() {
+ return getUntilExpression() != null;
+ }
+
+ public void setForExpression(OExpression forExpression) {
+ fieldContainer.put(FOREXPRESSION, forExpression);
+ }
+
+ public void setUntilExpression(OExpression untilExpression) {
+ fieldContainer.put(UNTILEXPRESSION, untilExpression);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWhile.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWhile.java
new file mode 100644
index 0000000..2b09ef5
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OWhile.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of a <code><while></code> activity.
+ */
+public class OWhile extends OActivity implements Serializable{
+ private static final long serialVersionUID = -1L;
+
+ /** The while condition. */
+ private static final String WHILECONDITION = "whileCondition";
+
+ private static final String ACTIVITY = "activity";
+
+ @JsonCreator
+ public OWhile(){}
+ public OWhile(OProcess owner, OActivity parent) {
+ super(owner, parent);
+ }
+
+ @JsonIgnore
+ public OActivity getActivity() {
+ Object o = fieldContainer.get(ACTIVITY);
+ return o == null ? null : (OActivity)o;
+ }
+
+ @JsonIgnore
+ public OExpression getWhileCondition() {
+ Object o = fieldContainer.get(WHILECONDITION);
+ return o == null ? null : (OExpression)o;
+ }
+
+ public void setActivity(OActivity activity) {
+ fieldContainer.put(ACTIVITY, activity);
+ }
+
+ public void setWhileCondition(OExpression whileCondition) {
+ fieldContainer.put(WHILECONDITION, whileCondition);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXsdTypeVarType.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXsdTypeVarType.java
new file mode 100644
index 0000000..8dc42c2
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXsdTypeVarType.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * XSD-typed variable type.
+ */
+public class OXsdTypeVarType extends OVarType implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String XSDTYPE = "xsdType";
+ private static final String SIMPLE = "simple";
+
+ @JsonCreator
+ public OXsdTypeVarType(){
+ setSimple(false);
+ }
+ public OXsdTypeVarType(OProcess owner) {
+ super(owner);
+ setSimple(false);
+ }
+
+ @JsonIgnore
+ public boolean isSimple() {
+ Object o = fieldContainer.get(SIMPLE);
+ return o == null ? false : (Boolean)o;
+ }
+
+ @JsonIgnore
+ public QName getXsdType() {
+ Object o = fieldContainer.get(XSDTYPE);
+ return o == null ? null : (QName)o;
+ }
+
+ public Node newInstance(Document doc) {
+ if (isSimple())
+ return doc.createTextNode("");
+ else {
+ Element el = doc.createElementNS(null, "xsd-complex-type-wrapper");
+ return el;
+ }
+ }
+
+ public void setSimple(boolean simple) {
+ fieldContainer.put(SIMPLE, simple);
+ }
+
+ public void setXsdType(QName xsdType) {
+ fieldContainer.put(XSDTYPE, xsdType);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXslSheet.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXslSheet.java
new file mode 100644
index 0000000..a6ca34e
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/OXslSheet.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.obj;
+
+import java.io.Serializable;
+import java.net.URI;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/**
+ * Compiled representation of an XSL sheet.
+ */
+public class OXslSheet extends OBase implements Serializable{
+ public static final long serialVersionUID = -1L;
+ private static final String URI = "uri";
+
+ private static final String SHEETBODY = "sheetBody";
+
+ @JsonCreator
+ public OXslSheet(){}
+ public OXslSheet(OProcess owner) {
+ super(owner);
+ }
+
+ @JsonIgnore
+ public String getSheetBody() {
+ Object o = fieldContainer.get(SHEETBODY);
+ return o == null ? null : (String)o;
+ }
+
+ @JsonIgnore
+ public URI getUri() {
+ Object o = fieldContainer.get(URI);
+ return o == null ? null : (URI)o;
+ }
+
+ public void setSheetBody(String sheetBody) {
+ fieldContainer.put(SHEETBODY, sheetBody);
+ }
+
+ public void setUri(URI uri) {
+ fieldContainer.put(URI, uri);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/AbstractObjectVisitor.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/AbstractObjectVisitor.java
new file mode 100644
index 0000000..b5c2f13
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/AbstractObjectVisitor.java
@@ -0,0 +1,183 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Array;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.apache.ode.bpel.obj.migrate.ObjectTraverser.HandleTable;
+
+public abstract class AbstractObjectVisitor implements ObjectVisitor{
+ protected ReplaceTable rtab = new ReplaceTable(1000, 0.8f);
+ protected ObjectTraverser traverse;
+ protected Map<Class, ObjectVisitor> visitors = new HashMap<Class, ObjectVisitor>();
+
+ @Override
+ public Object visited(Object obj) {
+ if (visitors.get(obj.getClass()) != null){
+ return visitors.get(obj.getClass()).visited(obj);
+ }
+ return rtab.lookup(obj);
+ }
+
+ @Override
+ public ObjectTraverser getTraverse(){
+ return traverse;
+ }
+ @Override
+ public Object visit(Object obj) {
+ ObjectVisitor customVisitor = visitors.get(obj.getClass());
+ if (customVisitor != null){
+ return customVisitor.visit(obj);
+ }
+ Object n;
+ if (isMap(obj)){
+ n = visitMap(obj);
+ }else if (isSet(obj)){
+ n = visitSet(obj);
+ }
+ else if (isCollection(obj)){
+ n = visitCollection(obj);
+ }else if (isArray(obj)){
+ n = visitArray(obj);
+ }else{
+ n = visitPojo(obj);
+ }
+ rtab.assign(obj, n);
+ return n;
+ }
+
+ /**
+ * determine if obj is collections that order doesn't matter.
+ * @param obj
+ * @return
+ */
+ protected boolean isSet(Object obj) {
+ return obj instanceof Set;
+ }
+
+ protected boolean isArray(Object old) {
+ return old.getClass().isArray();
+ }
+
+ /**
+ * determine if obj is collections that order does matter.
+ * @param obj
+ * @return
+ */
+ protected boolean isCollection(Object old) {
+ return (old instanceof Collection) && !isSet(old);
+ }
+
+ protected boolean isMap(Object old) {
+ return old instanceof Map;
+ }
+ @Override
+ public void setTraverse(ObjectTraverser traverseObject) {
+ this.traverse = traverseObject;
+ }
+
+ public void addCustomVisitor(Class cls, ObjectVisitor visitor){
+ visitors.put(cls, visitor);
+ }
+ public Object visitMap(Object obj) {
+ Map m = (Map)obj;
+ Set<Entry> entries = m.entrySet();
+ for (Entry e : entries){
+ traverse.traverseObject(e.getKey());
+ traverse.traverseObject(e.getValue());
+ }
+ return null;
+ }
+
+ public Object visitCollection(Object obj) {
+ Collection c = (Collection)obj;
+ for (Object item : c){
+ traverse.traverseObject(item);
+ }
+ return null;
+ }
+
+ public Object visitArray(Object obj) {
+ int len = Array.getLength(obj);
+ int i;
+ for (i = 0; i < len; i++){
+ traverse.traverseObject(Array.get(obj, i));
+ }
+ return null;
+ }
+
+ public Object visitSet(Object obj) {
+ //nothing to do
+ return null;
+ }
+
+ public abstract Object visitPojo(Object obj);
+ /**
+ * Lightweight identity hash table which maps objects to replacement
+ * objects.
+ */
+ public static class ReplaceTable {
+
+ /* maps object -> index */
+ private final HandleTable htab;
+ /* maps index -> replacement object */
+ private Object[] reps;
+
+ /**
+ * Creates new ReplaceTable with given capacity and load factor.
+ */
+ ReplaceTable(int initialCapacity, float loadFactor) {
+ htab = new HandleTable(initialCapacity, loadFactor);
+ reps = new Object[initialCapacity];
+ }
+
+ /**
+ * Enters mapping from object to replacement object.
+ */
+ void assign(Object obj, Object rep) {
+ int index = htab.assign(obj);
+ while (index >= reps.length) {
+ grow();
+ }
+ reps[index] = rep;
+ }
+
+ /**
+ * Looks up and returns replacement for given object. If no
+ * replacement is found, returns the lookup object itself.
+ */
+ Object lookup(Object obj) {
+ int index = htab.lookup(obj);
+ return (index >= 0) ? reps[index] : obj;
+ }
+
+ /**
+ * Resets table to its initial (empty) state.
+ */
+ void clear() {
+ Arrays.fill(reps, 0, htab.size(), null);
+ htab.clear();
+ }
+
+ /**
+ * Returns the number of mappings currently in table.
+ */
+ int size() {
+ return htab.size();
+ }
+
+ /**
+ * Increases table capacity.
+ */
+ private void grow() {
+ Object[] newReps = new Object[(reps.length << 1) + 1];
+ System.arraycopy(reps, 0, newReps, 0, reps.length);
+ reps = newReps;
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DeepEqualityHelper.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DeepEqualityHelper.java
new file mode 100644
index 0000000..5ddab47
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DeepEqualityHelper.java
@@ -0,0 +1,386 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * compare two object for equality. default strategy:
+ * for collections and maps, compare their contents
+ * for POJO,
+ * if any custom equality comparator can handle it, then use it;
+ * if it has an equals() method defined, use it.
+ * or compare their non-transient accessible fields by reflection.
+ * @author fangzhen
+ *
+ */
+public class DeepEqualityHelper{
+
+ private static final Log __log = LogFactory.getLog(ObjectTraverser.class);
+ public boolean logFalseThrough = false;
+ private Stack<String> st = new Stack<String>();
+
+ private List<EqualityComparator> comparators = new LinkedList<EqualityComparator>();
+ private Stack<Long> ongoing = new Stack<Long>();
+
+ private Map<Long, Boolean> cache = new HashMap<Long, Boolean>();
+
+ private final List<String> IGNORE_FIELDS = new ArrayList<String>();
+ {
+ // due to ODE-1023, we set all document element to null in compiled process models. Thus we need to exclude them
+ // from the comparison because the were still set in old CBP files.
+ IGNORE_FIELDS.add("protected org.w3c.dom.Element com.ibm.wsdl.AbstractWSDLElement.docEl");
+ }
+
+ public boolean deepEquals(Object obj1, Object obj2){
+ // __log.debug("comparing Objects: " + obj1 + " and " + obj2); //will cause too much log
+ Boolean c = cachedRes(obj1, obj2);
+ if (c != null) {
+ return c;
+ }
+ Long h12 = hash(obj1, obj2);
+ if (ongoing.contains(h12)) {
+ return true;
+ }
+ ongoing.push(h12);
+
+ boolean n;
+ if (isMap(obj1)){
+ n = visitMap(obj1, obj2);
+ }else if (isSet(obj1)){
+ n = visitSet(obj1, obj2);
+ }else if (isCollection(obj1)){
+ n = visitCollection(obj1, obj2);
+ }else if (isArray(obj1)){
+ n = visitArray(obj1, obj2);
+ }else{
+ n = visitPojo(obj1, obj2);
+ }
+ cacheRes(obj1, obj2, n);
+ ongoing.pop();
+ return n;
+ }
+
+ private void cacheRes(Object obj1, Object obj2, Boolean n) {
+ cache.put(hash(obj1, obj2), n);
+ }
+
+ private Boolean cachedRes(Object obj1, Object obj2) {
+ return cache.get(hash(obj1, obj2));
+ }
+
+ public Boolean visitMap(Object obj, Object other) {
+ if (obj == other) return true;
+ if (other == null) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Map: Object2 is null. " + st);
+ }
+ return false;
+ }
+ Map m1 = (Map)obj;
+ Map m2 = null;
+ try{
+ m2 = (Map)other;
+ }catch (ClassCastException e){
+ if (!logFalseThrough){
+ __log.debug("Unequal in Map: Object2 is not a map, it's a" + other.getClass() + "\n" + st);
+ }
+ return false;
+ }
+ if (m1.size() != m2.size()) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Map: size mismatch. " + st +
+ "\n size: " + m1.size() + " and " + m2.size());
+ }
+ return false;
+ }
+ Set ks1 = m1.keySet();
+ Set ks2 = m2.keySet();
+ for (Object k1 : ks1){
+ st.push(k1.toString());
+ Object k2 = contains(ks2, k1);
+ if (k2 == null){
+ if (!logFalseThrough){
+ __log.debug("Unequal in Map: cant find key. " + st + "\n missing key: " + k1);
+ }
+ st.pop();
+ return false;
+ }
+ Object o1 = m1.get(k1);
+ Object o2 = m2.get(k2);
+ if (o1 == null){
+ if (!(o2 == null)){
+ if (!logFalseThrough){
+ __log.debug("Unequal in Map: mismatch, one is null" + st +
+ "\n When dealing with " + o1 + " and " + o2);
+ }
+ st.pop();
+ return false;
+ }
+ }
+
+ st.pop();
+ st.push(k1.toString() + ":" + o1.getClass().getSimpleName());
+
+ Boolean e = deepEquals(o1, o2);
+ if (!e) {
+ st.pop();
+ return false;
+ }
+ st.pop();
+ }
+ return true;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Boolean visitSet(Object obj, Object other){
+ if (obj == other) return true;
+ if (other == null) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Set, Object2 is null. " + st);
+ }
+ return false;
+ }
+
+ Collection c1 = (Collection)obj;
+ Collection c2 = null;
+ try {
+ c2 = (Collection)other;
+ }catch(ClassCastException e){
+ if (!logFalseThrough){
+ __log.debug("Unequal in Set: Object2 is not a Set, it's a" + other.getClass() + "\n" + st);
+ }
+ return false;
+ }
+ if (c1.size() != c2.size()) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Set: size mismatch. " + st +
+ "\n. sizes are " + c1.size() + " and " + c2.size());
+ }
+ return false;
+ }
+ Iterator i1 = c1.iterator();
+ while (i1.hasNext()){
+ Object o1 = i1.next();
+ st.push(":" + o1.getClass().getSimpleName());
+ if (contains(c2, o1) == null) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Set: Object mismatch. " + st +
+ "\n" + "can't find " + o1);
+ }
+ st.pop();
+ return false;
+ }
+ st.pop();
+ }
+ return true;
+ }
+
+ private Object contains(Collection c, Object t1) {
+ Iterator itor = c.iterator();
+ Object t2;
+ logFalseThrough = true;
+ while (itor.hasNext()){
+ t2 = itor.next();
+ if (deepEquals(t1, t2)) {
+ logFalseThrough = false;
+ return t2;
+ }
+ }
+ logFalseThrough = false;
+ return null;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public Boolean visitCollection(Object obj, Object other) {
+ if (obj == other) return true;
+ if (other == null) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Collection, Object2 is null. " + st);
+ }
+ return false;
+ }
+
+ Collection c = (Collection)obj;
+ Collection c2 = null;
+ try {
+ c2 = (Collection)other;
+ }catch(ClassCastException e){
+ if (!logFalseThrough){
+ __log.debug("Unequal in Collection: Object2 is not a Collection, it's a" + other.getClass() + "\n" + st);
+ }
+ return false;
+ }
+ if (c.size() != c2.size()) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in Collection: size mismatch. " + st +
+ "\n. sizes are " + c.size() + " and " + c2.size());
+ }
+ return false;
+ }
+
+ Iterator i1 = c.iterator();
+ Iterator i2 = c2.iterator();
+ while (i1.hasNext()){
+ Object o1 = i1.next();
+ Object o2 = i2.next();
+ st.push(":" + o1.getClass().getSimpleName());
+ Boolean e = deepEquals(o1, o2);
+ if (!e) {
+ st.pop();
+ return false;
+ }
+ st.pop();
+ }
+ return true;
+ }
+
+ public Boolean visitArray(Object obj, Object other) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Boolean visitPojo(Object obj, Object other) {
+ EqualityComparator customComp = getCustomComparator(obj);
+ if (customComp != null){
+ return customComp.objectsEqual(obj, other);
+ }
+ if (obj == other) return true;
+ if (other == null) {
+ if (!logFalseThrough){
+ __log.debug("Unequal in POJO: Object2 is null." + st);
+ }
+ return false;
+ }
+ if (obj.getClass() != other.getClass()) {
+ if(!logFalseThrough){
+ __log.debug("Unequal in POJO: type mistach. " + st +
+ "\nmismatched types are: " + obj.getClass().getSimpleName() +
+ " and " + other.getClass().getSimpleName());
+ }
+ return false;
+ }
+ try{
+ obj.getClass().getDeclaredMethod("equals", Object.class);
+ boolean e = obj.equals(other);
+ if (!e){
+ if (!logFalseThrough){
+ __log.debug("Unequal in POJO: not equal by equals() method" + st);
+ }
+ }
+ return e;
+ }catch (NoSuchMethodException e){
+ return equalityByReflection(obj, other);
+ }
+ }
+
+ private EqualityComparator getCustomComparator(Object obj) {
+ for (EqualityComparator c : comparators){
+ if (c.canHanle(obj)){
+ return c;
+ }
+ }
+ return null;
+ }
+ public Boolean equalityByReflection(Object obj, Object other) {
+ List<Field> fields = MigUtils.getAllFields(obj.getClass());
+ List<Field> fields2 = MigUtils.getAllFields(other.getClass());
+ if (!fields.equals(fields2)){
+ if (!logFalseThrough){
+ __log.debug("Unequal: getFields() of two Object do not match " + st);
+ }
+ return false;
+ }
+
+ for (Field f : fields){
+ f.setAccessible(true);
+ if (((Modifier.TRANSIENT | Modifier.STATIC) & f.getModifiers()) != 0){
+ continue; //skip transient fields
+ }
+ try {
+ Object v2 = f.get(other);
+ Object v1 = f.get(obj);
+ if (v1 == null && v2 == null){
+ continue;
+ }
+
+ if (IGNORE_FIELDS.contains(f.toString())) {
+ __log.debug("Ignoring field " + f.getName() + " with values " + v1 + " and " + v2);
+
+ continue;
+ }
+
+ st.push(f.getName()+ ":" + f.getType().getSimpleName());
+ if (v1 == null || v2 == null){
+ if (!logFalseThrough){
+ __log.debug("Unequal: one field is null" + st + ".\n When dealing with "
+ + v1 + " and " + v2);
+ }
+ st.pop();
+ return false;
+ }
+ Boolean res = deepEquals(v1, v2);
+ if (!res){
+ st.pop();
+ return false;
+ }
+ st.pop();
+ } catch (Exception e) {
+ //should not get here
+ e.printStackTrace();
+ }
+ }
+ return true;
+ }
+
+ /**
+ * determine if obj is collections that order doesn't matter.
+ * @param obj
+ * @return
+ */
+ protected boolean isSet(Object obj) {
+ return obj instanceof Set;
+ }
+
+ protected boolean isArray(Object old) {
+ return old.getClass().isArray();
+ }
+
+ /**
+ * determine if obj is collections that order does matter.
+ * @param obj
+ * @return
+ */
+ protected boolean isCollection(Object old) {
+ return (old instanceof Collection) && !isSet(old);
+ }
+
+ protected boolean isMap(Object old) {
+ return old instanceof Map;
+ }
+
+ private Long hash(Object obj1, Object obj2) {
+ int h1 = System.identityHashCode(obj1);
+ int h2 = System.identityHashCode(obj2);
+ return ((long)h1) << 32 | h2;
+ }
+
+ public void addCustomComparator(EqualityComparator oe){
+ comparators.add(0, oe);
+ oe.setDeepEquality(this);
+ }
+ public Stack<String> getSt() {
+ return st;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DomElementComparator.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DomElementComparator.java
new file mode 100644
index 0000000..92b496c
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/DomElementComparator.java
@@ -0,0 +1,92 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.io.StringWriter;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSSerializer;
+
+/**
+ * DeepEqual of two DomElement.
+ * @see DeepEqualityHelper
+ */
+public class DomElementComparator implements EqualityComparator{
+ private static final Log __log = LogFactory.getLog(DomElementComparator.class);
+ private DeepEqualityHelper deepEquality;
+ @Override
+ public Boolean objectsEqual(Object obj1, Object obj2) {
+ if (obj1 == obj2) return true;
+ if (!(obj2 instanceof Element)){
+ if (!deepEquality.logFalseThrough){
+ __log.debug("Unequal in Dom Element: Type mismatch. " + deepEquality.getSt()
+ + "Object2 has type " + obj2.getClass());
+ }
+ return false;
+ }
+ try{
+ String str1 = Element2String((Element)obj1);
+ String str2 = Element2String((Element)obj2);
+ boolean e = str1.equals(str2);
+ if (!e){
+ if (!deepEquality.logFalseThrough){
+ __log.debug("Unequal in Dom Element: " + deepEquality.getSt() +
+ "\n" + str1 + "\nand\n " + str2);
+ }
+ }
+ return e;
+ }catch(Exception e){
+ if (!deepEquality.logFalseThrough){
+ __log.debug("Unequal in Dom Element: Exception when comparing. " +
+ deepEquality.getSt() + e);
+ }
+ return false;
+ }
+ }
+
+ public String Element2String(Element node){
+ Document document = node.getOwnerDocument();
+ DOMImplementationLS domImplLS = (DOMImplementationLS) document
+ .getImplementation();
+ LSSerializer serializer = domImplLS.createLSSerializer();
+ String str = serializer.writeToString(node);
+ serializer .getDomConfig().setParameter("xml-declaration", false);
+ return str;
+ }
+ /**
+ * Another option
+ */
+ public String Element2String2(Element obj1) throws TransformerException{
+ TransformerFactory transFactory = TransformerFactory.newInstance();
+ Transformer transformer = transFactory.newTransformer();
+ StringWriter buffer = new StringWriter();
+ transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+ transformer.transform(new DOMSource(obj1),
+ new StreamResult(buffer));
+ String str = buffer.toString();
+ return str;
+ }
+ @Override
+ public Boolean canHanle(Object obj) {
+ return obj instanceof Element;
+ }
+
+ public DeepEqualityHelper getDeepEquality() {
+ return deepEquality;
+ }
+
+ @Override
+ public void setDeepEquality(DeepEqualityHelper deepEquality) {
+ this.deepEquality = deepEquality;
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/EqualityComparator.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/EqualityComparator.java
new file mode 100644
index 0000000..69ad056
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/EqualityComparator.java
@@ -0,0 +1,19 @@
+package org.apache.ode.bpel.obj.migrate;
+
+/**
+ * Used by {@link DeepEqualityHelper} for custom comparator.
+ */
+public interface EqualityComparator {
+ /**
+ * return true if specified obj1 and obj2 are equal, false otherwise.
+ */
+ Boolean objectsEqual(Object obj1, Object obj2);
+
+ /**
+ * decide if the comparator can handle the specified object.
+ * Usually called before {@link EqualityComparator#objectsEqual(Object, Object)} are invoked.
+ */
+ Boolean canHanle(Object obj);
+
+ void setDeepEquality(DeepEqualityHelper deepEquality);
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ExtensibeImplEqualityComp.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ExtensibeImplEqualityComp.java
new file mode 100644
index 0000000..17a14d9
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ExtensibeImplEqualityComp.java
@@ -0,0 +1,95 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.DebugInfo;
+import org.apache.ode.bpel.obj.ExtensibleImpl;
+import org.apache.ode.bpel.obj.OProcess;
+
+/**
+ * DeepEquality comparator for OModel classes. It will compare backed map recursively.
+ * @see DeepEqualityHelper
+ */
+public class ExtensibeImplEqualityComp implements EqualityComparator{
+ private static final Log __log = LogFactory.getLog(ExtensibeImplEqualityComp.class);
+ private DeepEqualityHelper deepEquality;
+ public ExtensibeImplEqualityComp() {
+ }
+
+ @Override
+ public Boolean objectsEqual(Object obj1, Object obj2) {
+ if (obj2 == null) {
+ if (!deepEquality.logFalseThrough){
+ __log.debug("Unequal in ExtensibleImpl: Object2 is null. " +
+ deepEquality.getSt());
+ }
+ return false;
+ }
+ ExtensibleImpl esi = (ExtensibleImpl)obj1;
+ ExtensibleImpl esio = null;
+ if (obj1.getClass() != obj2.getClass()){
+ if (!deepEquality.logFalseThrough){
+ __log.debug("Unequal in ExtensibleImpl: Type mismatch. " + deepEquality.getSt() +
+ "\nmismatched type: " + obj1.getClass().getSimpleName() +
+ " and " + obj2.getClass().getSimpleName());
+ }
+ return false;
+ }
+ try{
+ esio = (ExtensibleImpl)obj2;
+ }catch(ClassCastException e){
+ //won't get here
+ return false;
+ }
+ if (obj1 instanceof DebugInfo){
+ boolean r = obj1.equals(obj2);
+ if (!r){
+ if(!deepEquality.logFalseThrough){
+ __log.debug("Unequal in ExtensibleImpl: DebugInfo unequal." + deepEquality.getSt());
+ }
+ }
+ return r;
+ }
+ Map m1 = new LinkedHashMap(esi.getFieldContainer());
+ Map m2 = new LinkedHashMap(esio.getFieldContainer());
+ dehydrate(m1);
+ dehydrate(m2);
+ if (obj1 instanceof OProcess){
+ dehydrateOProcess(m1);
+ dehydrateOProcess(m2);
+ }
+ return (Boolean) deepEquality.deepEquals(m1, m2);
+ }
+ private void dehydrateOProcess(Map m) {
+ m.remove("compileDate");
+ m.remove("namespaceContext");
+ }
+ @SuppressWarnings("rawtypes")
+ private void dehydrate(Map map) {
+ if (map == null) return;
+ map.remove("originalVersion");
+ Set<Entry> entries = map.entrySet();
+ Iterator<Entry> itor = entries.iterator();
+ while (itor.hasNext()){
+ Entry entry = itor.next();
+ if (entry.getValue() == null){
+ itor.remove();
+ }
+ }
+ }
+ @Override
+ public Boolean canHanle(Object obj) {
+ return obj instanceof ExtensibleImpl;
+ }
+
+ @Override
+ public void setDeepEquality(DeepEqualityHelper deepEquality) {
+ this.deepEquality = deepEquality;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/LegacySerializerAdapter.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/LegacySerializerAdapter.java
new file mode 100644
index 0000000..307dcef
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/LegacySerializerAdapter.java
@@ -0,0 +1,42 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.io.InputStream;
+
+import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.OmDeserializer;
+import org.apache.ode.bpel.obj.serde.SerializaionRtException;
+
+/**
+ * Adaptor for legacy Omodel serializer. Used to deserialize and migrate
+ * old format compiled bpels.
+ * @see Serializer
+ */
+public class LegacySerializerAdapter implements OmDeserializer {
+ private Serializer serializer;
+
+ public LegacySerializerAdapter(InputStream in) {
+ serializer = new Serializer();
+ serializer._inputStream = in;
+ }
+
+ /**
+ * Read the old OModel and migrate it to new omodel.
+ */
+ @Override
+ public OProcess deserialize() throws SerializaionRtException {
+ org.apache.ode.bpel.o.OProcess old;
+ try {
+ old = serializer.readOProcess();
+ } catch (Exception e) {
+ throw new SerializaionRtException(
+ "Error when deserializing old OModle classes");
+ }
+ //migrate to new OModel
+ OmOld2new mig = new OmOld2new();
+ ObjectTraverser mtraverse = new ObjectTraverser();
+ mtraverse.accept(mig);
+ OProcess migrated = (OProcess) mtraverse.traverseObject(old);
+ return migrated;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/MigUtils.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/MigUtils.java
new file mode 100644
index 0000000..a44696b
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/MigUtils.java
@@ -0,0 +1,33 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+public class MigUtils {
+ public static List<Field> getAllFields(Class cls) {
+ List<Field> fields = getFieldsRec(cls.getSuperclass(), new ArrayList<Field>());
+ fields.addAll(Arrays.asList(cls.getDeclaredFields()));
+ return fields;
+ }
+ /**
+ * get fields that are accessible to its sub-classes.
+ * @param cls
+ * @param fields
+ * @return
+ */
+ private static List<Field> getFieldsRec(Class cls, ArrayList<Field> fields) {
+ if (cls != null){
+ Field[] fs = cls.getDeclaredFields();
+ for (Field f : fs){
+ if ((f.getModifiers() & Modifier.PRIVATE) == 0){
+ fields.add(f);
+ }
+ }
+ getFieldsRec(cls.getSuperclass(), fields);
+ }
+ return fields;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectTraverser.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectTraverser.java
new file mode 100644
index 0000000..30865dd
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectTraverser.java
@@ -0,0 +1,179 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Traverse an Object with help of an {@link ObjectVisitor}, taking into consideration of cyclic references.
+ *
+ */
+public class ObjectTraverser{
+ private static final Log __log = LogFactory.getLog(ObjectTraverser.class);
+
+ private HandleTable htab = new HandleTable(1000, 0.8f);
+ private ObjectVisitor visitor;
+
+ public HandleTable getHtab() {
+ return htab;
+ }
+
+ public void accept(ObjectVisitor visitor){
+ this.visitor = visitor;
+ visitor.setTraverse(this);
+ }
+ public Object traverseObject(Object obj){
+ return traverseObject(obj, true);
+ }
+
+ /**
+ *
+ * @param obj current object
+ * @param assign should we record this visit. Usually, this should be true to avoid infinite loop of cyclic reference.
+ * Sometime set to false when we need visit an object more than once.
+ * @return anything the visitor returns.
+ */
+ public Object traverseObject(Object obj, boolean assign){
+ __log.debug("current object " + obj);
+ if (obj == null) return null;
+ if (htab.lookup(obj) != -1){
+ return visitor.visited(obj);
+ }
+ if (assign) htab.assign(obj);
+ Object n;
+ n = visitor.visit(obj);
+ return n;
+ }
+
+ /**
+ * Stole from openjdk ObjectOutputStream
+ * Lightweight identity hash table which maps objects to integer handles,
+ * assigned in ascending order.
+ */
+ public static class HandleTable {
+
+ /* number of mappings in table/next available handle */
+ private int size;
+ /* size threshold determining when to expand hash spine */
+ private int threshold;
+ /* factor for computing size threshold */
+ private final float loadFactor;
+ /* maps hash value -> candidate handle value */
+ private int[] spine;
+ /* maps handle value -> next candidate handle value */
+ private int[] next;
+ /* maps handle value -> associated object */
+ private Object[] objs;
+
+ /**
+ * Creates new HandleTable with given capacity and load factor.
+ */
+ HandleTable(int initialCapacity, float loadFactor) {
+ this.loadFactor = loadFactor;
+ spine = new int[initialCapacity];
+ next = new int[initialCapacity];
+ objs = new Object[initialCapacity];
+ threshold = (int) (initialCapacity * loadFactor);
+ clear();
+ }
+
+ /**
+ * Assigns next available handle to given object, and returns handle
+ * value. Handles are assigned in ascending order starting at 0.
+ */
+ int assign(Object obj) {
+ if (size >= next.length) {
+ growEntries();
+ }
+ if (size >= threshold) {
+ growSpine();
+ }
+ insert(obj, size);
+ return size++;
+ }
+
+ /**
+ * Looks up and returns handle associated with given object, or -1 if
+ * no mapping found.
+ */
+ int lookup(Object obj) {
+ if (size == 0) {
+ return -1;
+ }
+ int index = hash(obj) % spine.length;
+ for (int i = spine[index]; i >= 0; i = next[i]) {
+ if (objs[i] == obj) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+ /**
+ * Resets table to its initial (empty) state.
+ */
+ void clear() {
+ Arrays.fill(spine, -1);
+ Arrays.fill(objs, 0, size, null);
+ size = 0;
+ }
+
+ /**
+ * Returns the number of mappings currently in table.
+ */
+ int size() {
+ return size;
+ }
+
+ /**
+ * Inserts mapping object -> handle mapping into table. Assumes table
+ * is large enough to accommodate new mapping.
+ */
+ private void insert(Object obj, int handle) {
+ int index = hash(obj) % spine.length;
+ objs[handle] = obj;
+ next[handle] = spine[index];
+ spine[index] = handle;
+ }
+
+ /**
+ * Expands the hash "spine" -- equivalent to increasing the number of
+ * buckets in a conventional hash table.
+ */
+ private void growSpine() {
+ spine = new int[(spine.length << 1) + 1];
+ threshold = (int) (spine.length * loadFactor);
+ Arrays.fill(spine, -1);
+ for (int i = 0; i < size; i++) {
+ insert(objs[i], i);
+ }
+ }
+
+ /**
+ * Increases hash table capacity by lengthening entry arrays.
+ */
+ private void growEntries() {
+ int newLength = (next.length << 1) + 1;
+ int[] newNext = new int[newLength];
+ System.arraycopy(next, 0, newNext, 0, size);
+ next = newNext;
+
+ Object[] newObjs = new Object[newLength];
+ System.arraycopy(objs, 0, newObjs, 0, size);
+ objs = newObjs;
+ }
+
+ /**
+ * Returns hash value for given object.
+ */
+ private int hash(Object obj) {
+ return System.identityHashCode(obj) & 0x7FFFFFFF;
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectVisitor.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectVisitor.java
new file mode 100644
index 0000000..fd18807
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/ObjectVisitor.java
@@ -0,0 +1,24 @@
+package org.apache.ode.bpel.obj.migrate;
+
+/**
+ * Object visitor used when traverse an object.
+ * @author fangzhen
+ *
+ */
+public interface ObjectVisitor {
+ /**
+ * Operation if obj has been visited before
+ * @return we may need to return new object corresponding to the visiting object.
+ */
+ Object visited(Object obj);
+
+ /**
+ * Operation when obj is first visited or its former wasn't recorded.
+ * @return we may need to return new object corresponding to the visiting object.
+ */
+ Object visit(Object obj);
+
+ void setTraverse(ObjectTraverser traverseObject);
+ void addCustomVisitor(Class cls, ObjectVisitor visitor);
+ ObjectTraverser getTraverse();
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmOld2new.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmOld2new.java
new file mode 100644
index 0000000..31f5280
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmOld2new.java
@@ -0,0 +1,219 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.ExtensibleImpl;
+
+/**
+ * Migrate from old Omodel classes to new ones.
+ * @author fangzhen
+ * @see ObjectTraverser
+ */
+public class OmOld2new extends AbstractObjectVisitor{
+ private static final Log __log = LogFactory.getLog(OmOld2new.class);
+
+ private static Map<String, String> beanPkgMap = new HashMap<String, String>();
+ static{
+ beanPkgMap.put("org.apache.ode.bpel.o", "org.apache.ode.bpel.obj");
+ beanPkgMap.put("org.apache.ode.bpel.elang.xpath10.o", "org.apache.ode.bpel.elang.xpath10.obj");
+ beanPkgMap.put("org.apache.ode.bpel.elang.xpath20.o", "org.apache.ode.bpel.elang.xpath20.obj");
+ beanPkgMap.put("org.apache.ode.bpel.elang.xquery10.o", "org.apache.ode.bpel.elang.xquery10.obj");
+ }
+
+ public Object visit(Object obj){
+ __log.debug("migrating object: " + obj.getClass() + "@" + System.identityHashCode(obj));
+ Object n;
+ /*
+ * we use two category of visitXXX methods here. The first visitXXX(Object)
+ * return corresponding new object instance without fulfilling its contents,
+ * which avoids recursively call. And then assign the new object. then fill contents.
+ * other wise, on cyclic reference case, the object re-visited but hasn't prepared yet.
+ * However, this workaround assumes that the new object is mutable, which is true in our case.
+ */
+ if (isMap(obj)){
+ n = visitMap(obj);
+ }else if (isCollection(obj)){
+ n = visitCollection(obj);
+ }else if (isArray(obj)){
+ n = visitArray(obj);
+ }else{
+ n = visitPojo(obj);
+ }
+ rtab.assign(obj, n);
+
+ if (isMap(obj)){
+ visitMap(obj, n);
+ }else if (isCollection(obj)){
+ visitCollection(obj, n);
+ }else if (isArray(obj)){
+ visitArray(obj, n);
+ }else{
+ visitPojo(obj, n);
+ }
+ return n;
+ }
+
+
+ @Override
+ protected boolean isCollection(Object old) {
+ return (old instanceof Collection);
+ }
+
+ private boolean isOmodelBean(Object old){
+ Class<?> cls = old.getClass();
+ if (beanPkgMap.containsKey(cls.getPackage().getName()) &&
+ !cls.getSimpleName().equals("Serializer")){
+ return true;
+ }
+ return false;
+ }
+ @Override
+ public Object visitArray(Object old) {
+ throw new UnsupportedOperationException("Create new Array is unsupported");
+ }
+
+ private void visitArray(Object obj, Object n) {
+ throw new UnsupportedOperationException("We don't need the method here");
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes"})
+ public Object visitCollection(Object old) {
+ Collection o = (Collection) old;
+ try {
+ Collection n = o.getClass().newInstance();
+ return n;
+ } catch (Exception e){
+ //should not get here
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private void visitCollection(Object old, Object nu) {
+ Collection o = (Collection) old;
+ Collection n = (Collection) nu;
+ for (Object obj : o){
+ n.add(traverse.traverseObject(obj));
+ }
+ }
+
+ @Override
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ public Object visitMap(Object old) {
+ Map o = (Map) old;
+ try{
+ Map n = o.getClass().newInstance();
+ return n;
+ }catch (Exception e){
+ //should not get here
+ e.printStackTrace();
+ }
+ return null;
+ }
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ private void visitMap(Object obj, Object nu) {
+ Set<Entry> entries = ((Map)obj).entrySet();
+ Map n = (Map)nu;
+ for (Entry e : entries){
+ n.put(traverse.traverseObject(e.getKey()), traverse.traverseObject(e.getValue()));
+ }
+ }
+
+ @Override
+ public Object visitPojo(Object old) {
+ if (!isOmodelBean(old)){
+ return old;
+ }else{
+ return initiateNew(old);
+ }
+ }
+
+ private void visitPojo(Object old, Object n) {
+ if (isOmodelBean(old)){
+ constructNewOm(old, n);
+ }
+ }
+ /**
+ * construct new omodel instances from old ones. Assume <code>old</code> is an old OmodelBean
+ * @param old
+ * @return
+ */
+ private Object constructNewOm(Object old, Object tn) {
+ assert tn instanceof ExtensibleImpl;
+ ExtensibleImpl n = (ExtensibleImpl) tn;
+ List<Field> fields = getAllFields(old.getClass());
+ Map<String, Object> fieldMap = n.getFieldContainer();
+ for (Field f : fields){
+ if ((f.getModifiers() & Modifier.STATIC) != 0){
+ continue; //skip static fields
+ }
+ f.setAccessible(true);
+ try{
+ String fname = f.getName();
+ Object fvalue = f.get(old);
+ if (fvalue != null){
+ fieldMap.put(fname, traverse.traverseObject(fvalue));
+ }else{
+ fieldMap.put(fname, null);
+ }
+ } catch (Exception e) {
+ RuntimeException rte = new RuntimeException(
+ "Error when try to construct corresponding new Omodel class from old one:"
+ +old.getClass() + "; Failed on field:" + f.getName());
+ rte.initCause(e);
+ throw rte;
+ }
+ }
+ n.setClassVersion(1);
+ n.setOriginalVersion(0);
+ return n;
+ }
+
+ private List<Field> getAllFields(Class cls) {
+ return getAllFieldsRec(cls, new ArrayList<Field>());
+ }
+
+ private List<Field> getAllFieldsRec(Class cls, ArrayList<Field> fields) {
+ Class par = cls.getSuperclass();
+ if (par != null){
+ getAllFieldsRec(par, fields);
+ }
+ fields.addAll(Arrays.asList(cls.getDeclaredFields()));
+ return fields;
+ }
+
+ private Object initiateNew(Object old) {
+ String clsName = old.getClass().getName();
+ String qcls = clsName.replace(".o.", ".obj.");
+ try {
+ Constructor cons = Class.forName(qcls).getConstructor();
+ cons.setAccessible(true);
+ return cons.newInstance();
+ } catch (Exception e) {
+ RuntimeException rte = new RuntimeException(
+ "Error when try to initiate corresponding new Omodel class of old one:"
+ + old.getClass());
+ rte.initCause(e);
+ throw rte;
+ }
+ }
+
+ @Override
+ public Object visitSet(Object obj) {
+ throw new UnsupportedOperationException("We don't really need this operatiion here");
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmUpgradeVisitor.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmUpgradeVisitor.java
new file mode 100644
index 0000000..f92b36f
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/OmUpgradeVisitor.java
@@ -0,0 +1,50 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Field;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.ode.bpel.obj.Extensible;
+
+/**
+ * Upgrade Omodel Object to newest version. Used as
+ * visitor of {@link ObjectTraverser}
+ * @see ObjectTraverser
+ */
+public class OmUpgradeVisitor extends AbstractObjectVisitor{
+
+ @Override
+ protected boolean isCollection(Object old) {
+ return old instanceof Collection;
+ }
+ @Override
+ protected boolean isSet(Object obj){
+ return false;
+ }
+
+ @Override
+ public Object visitPojo(Object obj) {
+ if (! (obj instanceof Extensible)){
+ return null;
+ }
+ visitExtensible(obj);
+ return null;
+ }
+
+ private void visitExtensible(Object obj) {
+ ((Extensible)obj).upgrade2Newest();
+ List<Field> fields = MigUtils.getAllFields(obj.getClass());
+ for (Field f : fields){
+ f.setAccessible(true);
+ try {
+ Object value = f.get(obj);
+ if (value != null){
+ traverse.traverseObject(value);
+ }
+ } catch (Exception e){
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/UpgradeChecker.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/UpgradeChecker.java
new file mode 100644
index 0000000..41809d8
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/migrate/UpgradeChecker.java
@@ -0,0 +1,60 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.ExtensibleImpl;
+
+/**
+ * Check if the specified OModel Object is newest. Used as a visitor of
+ * {@link ObjectTraverser}.
+ *
+ * @see ObjectTraverser
+ */
+public class UpgradeChecker extends AbstractObjectVisitor{
+ private static final Log __log = LogFactory.getLog(UpgradeChecker.class);
+
+ private boolean newest = true;
+ @Override
+ public Object visitPojo(Object obj) {
+ if (! (obj instanceof ExtensibleImpl)){
+ return null;
+ }
+ visitExtensible(obj);
+ return null;
+ }
+
+ private void visitExtensible(Object obj) {
+ ExtensibleImpl eobj = (ExtensibleImpl)obj;
+ int currentVersion = 1;
+ try {
+ currentVersion = (Integer) eobj.getClass().getField("CURRENT_CLASS_VERSION").get(obj);
+ } catch (Exception e) {
+ // should never get here
+ e.printStackTrace();
+ }
+ if (eobj.getClassVersion() != currentVersion){
+ newest = false;
+ __log.debug(obj.getClass() + "hasn't upgraded to newest version. current: "
+ + eobj.getClassVersion() + ", newest: " + currentVersion);
+ }
+ List<Field> fields = MigUtils.getAllFields(obj.getClass());
+ for (Field f : fields){
+ f.setAccessible(true);
+ try {
+ Object value = f.get(obj);
+ if (value != null){
+ traverse.traverseObject(value);
+ }
+ } catch (Exception e){
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ public boolean isNewest() {
+ return newest;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/DeSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/DeSerializer.java
new file mode 100644
index 0000000..300ca12
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/DeSerializer.java
@@ -0,0 +1,229 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OProcessWrapper;
+import org.apache.ode.bpel.obj.migrate.ObjectTraverser;
+import org.apache.ode.bpel.obj.migrate.OmUpgradeVisitor;
+import org.apache.ode.bpel.obj.migrate.UpgradeChecker;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory.SerializeFormat;
+
+/**
+ * Main Serializer and Deserializer of OModel classes. This class handles different
+ * serialization format. (De)Serialize header information. It will upgrade the deserialized
+ * OProcess to newest version. And write it back if the write back file is specified.
+ * @see OmSerdeFactory
+ */
+public class DeSerializer {
+ private static final Log __log = LogFactory.getLog(DeSerializer.class);
+
+ private OProcessWrapper wrapper = new OProcessWrapper();
+ private InputStream is;
+ private File writeBackFile;
+ private File cbpFile;
+
+ /**
+ * Constructor to create deserializer to deserialize from file.
+ * @param cbpFile the serialized compiled cbp file
+ * @throws FileNotFoundException
+ */
+ public DeSerializer(File cbpFile) throws FileNotFoundException {
+ this(new FileInputStream(cbpFile));
+ this.cbpFile = cbpFile;
+ }
+
+ DeSerializer(InputStream is) {
+ this.is = new BufferedInputStream(is);
+ deserializeHeader();
+ }
+
+ /**
+ * Constructor to create serializer.
+ */
+ public DeSerializer() {
+ }
+
+ public void serialize(OutputStream out, OProcess process) {
+ serialize(out, process, OmSerdeFactory.FORMAT_SERIALIZED_DEFAULT);
+ }
+
+ public void serialize(OutputStream out, OProcess process,
+ SerializeFormat format) {
+ wrapper.setCompileTime(System.currentTimeMillis());
+ wrapper.setProcess(process);
+ wrapper.setFormat(format);
+ serialize(out);
+ }
+
+ private void serialize(OutputStream out) {
+ try {
+ DataOutputStream dos = new DataOutputStream(out);
+ dos.write(wrapper.getMagic());
+ ObjectOutputStream oos = new ObjectOutputStream(out);
+ oos.writeObject(wrapper.getFormat());
+ oos.writeLong(wrapper.getCompileTime());
+ oos.writeObject(wrapper.getGuid());
+ oos.writeObject(wrapper.getType());
+ oos.writeObject(wrapper.getOtherHeaders());
+ } catch (IOException e1) {
+ SerializaionRtException e = new SerializaionRtException(
+ "Error when serialize Headers.");
+ e.initCause(e1);
+ throw e;
+ }
+ OmSerdeFactory factory = new OmSerdeFactory();
+ factory.setFormat(wrapper.getFormat());
+ OmSerializer serializer = factory.createOmSerializer(out,
+ wrapper.getProcess());
+ serializer.serialize();
+ }
+
+ private void deserializeHeader() {
+ try {
+ DataInputStream oin = new DataInputStream(is);
+ oin.mark(OProcessWrapper.CURRENT_MAGIC_NUMBER.length + 2);
+ byte[] magic = new byte[OProcessWrapper.CURRENT_MAGIC_NUMBER.length];
+ oin.read(magic, 0, magic.length);
+ if (Arrays.equals(Serializer.MAGIC_NUMBER_OFH_20040908, magic)
+ || Arrays.equals(Serializer.MAGIC_NUMBER_OFH_20061101,
+ magic)) {
+ oin.reset();
+ Serializer serializer = new Serializer(is);
+ wrapper.setMagic(magic);
+ wrapper.setGuid(serializer.guid);
+ wrapper.setCompileTime(serializer.compileTime);
+ wrapper.setType(serializer.type);
+ wrapper.setFormat(SerializeFormat.FORMAT_SERIALIZED_LEGACY);
+ } else {
+ ObjectInputStream ois = new ObjectInputStream(is);
+ wrapper = new OProcessWrapper();
+ wrapper.setMagic(magic);
+ wrapper.setFormat((SerializeFormat) ois.readObject());
+ wrapper.setCompileTime(ois.readLong());
+ wrapper.setGuid((String) ois.readObject());
+ wrapper.setType((QName) ois.readObject());
+ wrapper.setOtherHeaders((Map<String, Object>) (ois.readObject()));
+ wrapper.checkValid();
+ }
+ } catch (Exception e1) {
+ try {
+ is.close();
+ } catch (IOException e2) {
+ e2.printStackTrace();
+ }
+ SerializaionRtException e = new SerializaionRtException(
+ "Error when reading Headers during deseriazation");
+ e.initCause(e1);
+ throw e;
+ }
+ }
+
+ /**
+ * Deserialize the compiled <code>OProcess</code>.
+ * @return The deserialized OProcess
+ */
+ public OProcess deserialize() {
+ OmSerdeFactory factory = new OmSerdeFactory();
+ factory.setFormat(wrapper.getFormat());
+ OProcess process = null;
+ try {
+ OmDeserializer de = factory.createOmDeserializer(is);
+ process = de.deserialize();
+ } finally {
+ if (cbpFile != null) {
+ //this means that <code>is</code> is constructed from cbpFile,
+ // and we are reaponsible to close it.
+ try {
+ is.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ wrapper.setProcess(process);
+ //upgrade
+ UpgradeChecker checker = new UpgradeChecker();
+ ObjectTraverser traverser = new ObjectTraverser();
+ traverser.accept(checker);
+ traverser.traverseObject(process);
+ if (!checker.isNewest()) {
+ OmUpgradeVisitor upgrader = new OmUpgradeVisitor();
+ traverser = new ObjectTraverser();
+ traverser.accept(upgrader);
+ traverser.traverseObject(process);
+ writeBack();
+ }
+ return process;
+ }
+
+ private void writeBack() {
+ if (writeBackFile == null && cbpFile == null) {
+ // we dont kown where to writeback;
+ return;
+ }
+ if (writeBackFile == null) {
+ // write back to original cbp file;
+ writeBackFile = cbpFile;
+ }
+ byte[] magic = wrapper.getMagic();
+ if (Arrays.equals(Serializer.MAGIC_NUMBER_OFH_20040908, magic)
+ || Arrays.equals(Serializer.MAGIC_NUMBER_OFH_20061101, magic)) {
+ //upgrade to new omodel magic and format
+ wrapper.setMagic(OProcessWrapper.CURRENT_MAGIC_NUMBER);
+ wrapper.setFormat(OmSerdeFactory.FORMAT_SERIALIZED_DEFAULT);
+ }
+ OutputStream wbStream = null;
+ if (writeBackFile.exists()) {
+ if (writeBackFile.renameTo(new File(writeBackFile.getAbsolutePath()
+ + ".bak"))) {
+ try {
+ wbStream = new FileOutputStream(writeBackFile);
+ serialize(wbStream);
+ } catch (FileNotFoundException e) {
+ __log.info("Error when write back upgraded process. file not found");
+ } finally {
+ if (wbStream != null) {
+ try {
+ wbStream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ } else {
+ __log.debug("backup file failed. skip writing back upgraded file");
+ }
+ }
+ }
+
+ public OProcessWrapper getWrapper() {
+ return wrapper;
+ }
+
+ public void setWrapper(OProcessWrapper wrapper) {
+ this.wrapper = wrapper;
+ }
+
+ public void setWriteBackFile(File writeBack) {
+ this.writeBackFile = writeBack;
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmDeserializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmDeserializer.java
new file mode 100644
index 0000000..a210a7d
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmDeserializer.java
@@ -0,0 +1,34 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+
+import org.apache.ode.bpel.obj.OProcess;
+
+/**
+ * OModel deserializer that use java serializtion mechanism.
+ * Corresponding to format {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_JAVA}
+ * @see JavaSerOmSerializer
+ */
+public class JavaSerOmDeserializer implements OmDeserializer {
+ private InputStream is;
+ public JavaSerOmDeserializer(InputStream is) {
+ this.is = is;
+ }
+
+ @Override
+ public OProcess deserialize() throws SerializaionRtException {
+ ObjectInputStream ois;
+ try {
+ ois = new ObjectInputStream(is);
+ OProcess process;
+ process = (OProcess)ois.readObject();
+ return process;
+ } catch (Exception e) {
+ SerializaionRtException se = new SerializaionRtException("error when deserializing process");
+ se.initCause(e);
+ throw se;
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmSerializer.java
new file mode 100644
index 0000000..0a413f2
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JavaSerOmSerializer.java
@@ -0,0 +1,34 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+
+import org.apache.ode.bpel.obj.OProcess;
+
+/**
+ * OModel Serializer that use java serializtion mechanism.
+ * Corresponding to format {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_JAVA}
+ * @see JavaSerOmDeserializer
+ */
+public class JavaSerOmSerializer implements OmSerializer {
+ private OutputStream out;
+ OProcess process;
+ public JavaSerOmSerializer(OutputStream out, OProcess process) {
+ this.process = process;
+ this.out = out;
+ }
+
+ @Override
+ public void serialize() throws SerializaionRtException {
+ ObjectOutputStream oos;
+ try {
+ oos = new ObjectOutputStream(out);
+ oos.writeObject(process);
+ } catch (Exception e) {
+ SerializaionRtException se = new SerializaionRtException("error when serialize process");
+ se.initCause(e);
+ throw se;
+ }
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmDeserializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmDeserializer.java
new file mode 100644
index 0000000..d8918d7
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmDeserializer.java
@@ -0,0 +1,296 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.wsdl.OperationType;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.jacksonhack.TypeBeanSerializerFactory;
+import org.apache.ode.utils.NSContext;
+import org.w3c.dom.Element;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.JsonToken;
+import com.fasterxml.jackson.core.io.SerializedString;
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.DeserializationConfig;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonDeserializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.PropertyName;
+import com.fasterxml.jackson.databind.deser.BeanDeserializerModifier;
+import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
+import com.fasterxml.jackson.databind.introspect.AnnotatedField;
+import com.fasterxml.jackson.databind.introspect.BeanPropertyDefinition;
+import com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder;
+import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
+import com.fasterxml.jackson.module.jaxb.deser.DomElementJsonDeserializer;
+import com.ibm.wsdl.AbstractWSDLElement;
+import com.ibm.wsdl.MessageImpl;
+/**
+ * OModel Serializer that deserialize process from json using jackson.
+ * Corresponding to format {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_JSON}
+ * @see JsonOmSerializer
+ */
+public class JsonOmDeserializer implements OmDeserializer {
+ protected static final Log __log = LogFactory
+ .getLog(JsonOmDeserializer.class);
+
+ private OProcess process;
+ private InputStream is;
+
+ protected JsonFactory factory;
+ private ObjectMapper mapper;
+ private Map<Class<?>, JsonDeserializer<?>> deserializers;
+
+ public JsonOmDeserializer() {
+ deserializers = new HashMap<Class<?>, JsonDeserializer<?>>();
+ addCustomDeserializer(OperationType.class,
+ new OperationTypeDeserializer());
+ addCustomDeserializer(Element.class, new DomElementDeserializerHack());
+ addCustomDeserializer(NSContext.class, new NSContextDeserializer(NSContext.class));
+ addCustomDeserializer(MessageImpl.class, new MessageDeserializer(MessageImpl.class));
+ }
+
+ public JsonOmDeserializer(InputStream is) {
+ this(is, new JsonFactory());
+ }
+
+ protected JsonOmDeserializer(InputStream is, JsonFactory factory) {
+ this();
+ this.is = is;
+ this.factory = factory;
+ process = new OProcess();
+ }
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public OProcess deserialize() throws SerializaionRtException {
+ mapper = new ObjectMapper(factory);
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ mapper.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ SimpleModule simpleModule = new SimpleModule("SimpleModule");
+ for (Class<?> d : deserializers.keySet()) {
+ simpleModule.addDeserializer((Class) d,
+ (JsonDeserializer) deserializers.get(d));
+ }
+ simpleModule.setDeserializerModifier(new WsdlElementDeserModifier());
+ simpleModule.addKeyDeserializer(Object.class, new KeyAsJsonDeserializer());
+ simpleModule.addKeyDeserializer(String.class, new KeyAsJsonDeserializer());
+ mapper.registerModule(simpleModule);
+
+ try {
+ process = mapper.readValue(is, OProcess.class);
+ } catch (Exception e1) {
+ SerializaionRtException e = new SerializaionRtException("Error when deseriaze process during deseriazation");
+ e.initCause(e1);
+ throw e;
+ }
+ return process;
+ }
+
+ public void addCustomDeserializer(Class<?> c, JsonDeserializer<?> sd) {
+ if (deserializers.containsKey(c)) {
+ __log.warn("Deserizer for type " + c
+ + " has been added. Removed previous one");
+ }
+ deserializers.put(c, sd);
+ }
+
+ public JsonDeserializer<?> removeCustomDeserializer(Class<?> c) {
+ return deserializers.remove(c);
+ }
+
+ public InputStream getIs() {
+ return is;
+ }
+
+ public void setIs(InputStream is) {
+ this.is = is;
+ }
+
+ /**
+ * @see JsonOmSerializer.OperationTypeSerializer
+ */
+ public static class OperationTypeDeserializer extends
+ StdScalarDeserializer<OperationType> {
+ private static final long serialVersionUID = 2015036061829834379L;
+
+ protected OperationTypeDeserializer() {
+ super(OperationType.class);
+ }
+
+ @Override
+ public OperationType deserialize(JsonParser jp,
+ DeserializationContext ctxt) throws IOException,
+ JsonProcessingException {
+
+ JsonToken t = jp.getCurrentToken();
+ if (t == JsonToken.VALUE_STRING) {
+ String text = jp.getText().trim();
+ if ("ONE_WAY".equals(text)) {
+ return OperationType.ONE_WAY;
+ } else if ("REQUEST_RESPONSE".equals(text)) {
+ return OperationType.REQUEST_RESPONSE;
+ } else if ("SOLICIT_RESPONSE".equals(text)) {
+ return OperationType.SOLICIT_RESPONSE;
+ } else if ("NOTIFICATION".equals(text)) {
+ return OperationType.NOTIFICATION;
+ }
+ }
+
+ throw ctxt.mappingException("Could not deserialize OperationType");
+ }
+
+ @Override
+ public boolean isCachable() {
+ return true;
+ }
+ }
+
+ /**
+ * Add type info to {@link org.w3c.dom.Element}.
+ *
+ * @see DomElementJsonDeserializer
+ */
+ public static class DomElementDeserializerHack extends DomElementJsonDeserializer{
+ private static final long serialVersionUID = 2447322357224915181L;
+
+ @Override
+ public Object deserializeWithType(JsonParser jp, DeserializationContext ctxt, TypeDeserializer typeDeserializer) throws IOException {
+ boolean hadStartArray = jp.isExpectedStartArrayToken();
+ JsonToken t = jp.nextToken();
+ assert t == JsonToken.VALUE_STRING;
+ String type = jp.getText();
+ assert type.equals("org.w3c.dom.Element");
+ jp.nextToken();
+ Object value;
+ value = deserialize(jp, ctxt);
+ if (hadStartArray && jp.nextToken() != JsonToken.END_ARRAY) {
+ throw ctxt.wrongTokenException(jp, JsonToken.END_ARRAY,
+ "expected closing END_ARRAY after type information and deserialized value");
+ }
+ return value;
+ }
+ }
+ /**
+ * @see JsonOmSerializer.NSContextSerializer
+ */
+ public static class NSContextDeserializer extends StdScalarDeserializer<NSContext>{
+ private static final long serialVersionUID = -4581782525089784968L;
+
+ protected NSContextDeserializer(Class<?> vc) {
+ super(vc);
+ }
+
+ @Override
+ public NSContext deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ @SuppressWarnings("unchecked")
+ Map<String, String> map = jp.readValueAs(Map.class);
+ NSContext ctx = new NSContext();
+ ctx.register(map);
+ return ctx;
+ }
+
+ }
+
+ /**
+ * @see JsonOmSerializer.MessageSerializer
+ */
+ public static class MessageDeserializer extends StdScalarDeserializer<MessageImpl>{
+
+ protected MessageDeserializer(Class<?> vc) {
+ super(vc);
+ }
+
+ @Override
+ public MessageImpl deserialize(JsonParser jp, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ MessageImpl value = new MessageImpl();
+ value.setDocumentationElement(jp.readValueAs(Element.class));
+ value.getExtensibilityElements().addAll(jp.readValueAs(Vector.class));
+ value.getExtensionAttributes().putAll(jp.readValueAs(HashMap.class));
+
+ value.getParts().putAll(jp.readValueAs(HashMap.class));
+ Field f1;
+ try {
+ f1 = MessageImpl.class.getDeclaredField("nativeAttributeNames");
+ f1.setAccessible(true);
+ f1.set(value, jp.readValueAs(List.class));
+ } catch (Exception e) {
+ __log.debug("Exception when serialize MessageImpl:" + e);
+ }
+ value.setUndefined(jp.readValueAs(Boolean.class));
+ value.setQName(jp.readValueAs(QName.class));
+
+ Vector<String> parts = jp.readValueAs(Vector.class);
+ try{
+ Field f = MessageImpl.class.getDeclaredField("additionOrderOfParts");
+ f.setAccessible(true);
+ f.set(value, parts);
+ }catch(Exception e){
+ __log.debug("Exception when serialize MessageImpl:" + e);
+ }
+ return value;
+ }
+
+ }
+
+ /**
+ * BeanDeserializerModifier to deserialize {@link AbstractWSDLElement} extensibilityElements
+ * property as field to avoid settlessProperities bug [FastXML/jackson-databind#501].
+ */
+ public static class WsdlElementDeserModifier extends BeanDeserializerModifier{
+ public static class MyBeanPropertyWriter extends BeanPropertyWriter{
+ public MyBeanPropertyWriter(BeanPropertyWriter origi, String newName){
+ super(origi, new SerializedString(newName));
+ }
+ }
+ @Override
+ public List<BeanPropertyDefinition> updateProperties(DeserializationConfig config,
+ BeanDescription beanDesc,
+ List<BeanPropertyDefinition> propDefs){
+ if (!AbstractWSDLElement.class.isAssignableFrom(beanDesc.getBeanClass())) {
+ return propDefs;
+ }
+ Iterator<BeanPropertyDefinition> itor = propDefs.iterator();
+ while(itor.hasNext()){
+ BeanPropertyDefinition prop = itor.next();
+ if (prop.getName().equalsIgnoreCase("extensibilityElements")){
+ try {
+ AnnotatedField f = new AnnotatedField(AbstractWSDLElement.class.getDeclaredField("extElements"), null);
+ ((POJOPropertyBuilder)prop).addField(f, new PropertyName("extElements"), false, true, false);
+ } catch (NoSuchFieldException e) {
+ SerializaionRtException e1 = new SerializaionRtException(
+ "cann't find field, probably implementation of AbstractWSDLElement has changed");
+ e1.initCause(e);
+ throw e1;
+ } catch (ClassCastException e){
+ SerializaionRtException e1 = new SerializaionRtException(
+ "Cast to POJOPropertyBuilder failde, probably underlying impl of "
+ + "BeanPropertyDefinition has changed");
+ e1.initCause(e);
+ throw e1;
+ }
+ break;
+ }
+ }
+ return propDefs;
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmSerializer.java
new file mode 100644
index 0000000..9f0c762
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/JsonOmSerializer.java
@@ -0,0 +1,223 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.lang.reflect.Field;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+
+import javax.wsdl.OperationType;
+import javax.wsdl.Part;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.jacksonhack.TypeBeanSerializerFactory;
+import org.apache.ode.utils.NSContext;
+import org.w3c.dom.Element;
+
+import com.fasterxml.jackson.core.JsonFactory;
+import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;
+import com.fasterxml.jackson.module.jaxb.ser.DomElementJsonSerializer;
+import com.ibm.wsdl.MessageImpl;
+
+/**
+ * OModel Serializer that serialize process to json using jackson.
+ * Corresponding to format {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_JSON}
+ * @see JsonOmDeserializer
+ */
+public class JsonOmSerializer implements OmSerializer {
+ protected static final Log __log = LogFactory
+ .getLog(JsonOmSerializer.class);
+
+ private OutputStream os;
+ private OProcess process;
+
+ private ObjectMapper mapper;
+ protected JsonFactory factory;
+ private Map<Class<?>, JsonSerializer<?>> serializers;
+
+ public JsonOmSerializer() {
+ serializers = new HashMap<Class<?>, JsonSerializer<?>>();
+ addCustomSerializer(OperationType.class, new OperationTypeSerializer());
+ addCustomSerializer(Element.class, new DomElementSerializerHack());
+ addCustomSerializer(NSContext.class, new NSContextSerializer(NSContext.class));
+ addCustomSerializer(MessageImpl.class, new MessageSerializer(MessageImpl.class));
+ }
+
+ public JsonOmSerializer(OutputStream os, OProcess process){
+ this(os, process, new JsonFactory());
+ }
+
+ protected JsonOmSerializer(OutputStream os, OProcess process,
+ JsonFactory factory) {
+ this();
+ this.os = os;
+ this.process = process;
+ this.factory = factory;
+ }
+
+ @Override
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public void serialize(){
+ mapper = new ObjectMapper(factory);
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ mapper.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ SimpleModule simpleModule = new SimpleModule("SimpleModule");
+ for (Class<?> ss : serializers.keySet()) {
+ simpleModule.addSerializer((Class) ss,
+ (JsonSerializer) serializers.get(ss));
+ }
+
+ simpleModule.addKeySerializer(Object.class, new KeyAsJsonSerializer());
+ mapper.registerModule(simpleModule);
+
+ mapper.enable(SerializationFeature.INDENT_OUTPUT);
+ try {
+ mapper.writeValue(os, process);
+ os.flush();
+ } catch (Exception e) {
+ SerializaionRtException se = new SerializaionRtException("error when serialize process");
+ se.initCause(e);
+ throw se;
+ }
+ }
+
+ public void addCustomSerializer(Class<?> c, JsonSerializer<?> ss) {
+ if (serializers.containsKey(c)) {
+ __log.warn("Serializer for type " + c
+ + " has been added. Removed previous one");
+ }
+ serializers.put(c, ss);
+ }
+
+ public JsonSerializer<?> removeCustomSerializer(Class<?> c) {
+ return serializers.remove(c);
+ }
+
+ public OutputStream getOs() {
+ return os;
+ }
+
+ public void setOs(OutputStream os) {
+ this.os = os;
+ }
+
+ /**
+ * Custom jackson serializer for {@link OperationType}
+ * @see JsonOmDeserializer.OperationTypeDeserializer
+ */
+ public static class OperationTypeSerializer extends
+ StdScalarSerializer<OperationType> {
+
+ protected OperationTypeSerializer() {
+ super(OperationType.class, false);
+ }
+
+ @Override
+ public void serialize(OperationType value, JsonGenerator jgen,
+ SerializerProvider provider) throws IOException,
+ JsonGenerationException {
+ if (OperationType.ONE_WAY.equals(value)) {
+ jgen.writeString("ONE_WAY");
+ } else if (OperationType.REQUEST_RESPONSE.equals(value)) {
+ jgen.writeString("REQUEST_RESPONSE");
+ } else if (OperationType.SOLICIT_RESPONSE.equals(value)) {
+ jgen.writeString("SOLICIT_RESPONSE");
+ } else if (OperationType.NOTIFICATION.equals(value)) {
+ jgen.writeString("NOTIFICATION");
+ } else {
+ // unknown type
+ jgen.writeString(value.toString());
+ }
+ }
+
+ @Override
+ public JsonNode getSchema(SerializerProvider provider, Type typeHint) {
+ return createSchemaNode("string", true);
+ }
+
+ }
+
+ public static class DomElementSerializerHack extends DomElementJsonSerializer{
+ @Override
+ public void serializeWithType(Element value, JsonGenerator jgen, SerializerProvider provider,
+ TypeSerializer typeSer)
+ throws IOException, JsonGenerationException {
+ String typeId = "org.w3c.dom.Element";
+ jgen.writeStartArray();
+ jgen.writeString(typeId);
+ serialize(value, jgen, provider);
+ jgen.writeEndArray();
+ }
+ }
+ /**
+ * Custom {@link NSContext} serializer. Serialize it's map representation.
+ * @see NSContext JsonOmDeserializer.NSContextDeserializer
+ */
+ public static class NSContextSerializer extends StdScalarSerializer<NSContext>{
+
+
+ protected NSContextSerializer(Class<NSContext> t) {
+ super(t);
+ }
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Override
+ public void serialize(NSContext value, JsonGenerator jgen,
+ SerializerProvider provider) throws IOException,
+ JsonGenerationException {
+ jgen.writeObject(new HashMap(value.toMap()));
+ }
+
+ }
+
+ /**
+ * custom serializer for {@link MessageImpl}. Additional private field
+ * (@link MessageImpl#additionOrderOfParts} are serialized.
+ *
+ * @see JsonOmDeserializer.MessageDeserializer
+ */
+ public static class MessageSerializer extends StdScalarSerializer<MessageImpl>{
+
+ protected MessageSerializer(Class<MessageImpl> class1) {
+ super(class1);
+ }
+
+ @Override
+ public void serialize(MessageImpl value, JsonGenerator jgen,
+ SerializerProvider provider) throws IOException,
+ JsonGenerationException {
+ jgen.writeObject(value.getDocumentationElement());
+ jgen.writeObject(value.getExtensibilityElements());
+ jgen.writeObject(value.getExtensionAttributes());
+
+ jgen.writeObject(value.getParts());
+ jgen.writeObject(value.getNativeAttributeNames());
+ jgen.writeObject(value.isUndefined());
+ jgen.writeObject(value.getQName());
+ try {
+ Field f = value.getClass().getDeclaredField("additionOrderOfParts");
+ f.setAccessible(true);
+ Vector<Part> parts = (Vector)f.get(value);
+ jgen.writeObject(parts);
+ } catch (Exception e) {
+ //nothing to do.
+ __log.debug("Exception when serialize MessageImpl:" + e);
+ }
+ }
+
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonDeserializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonDeserializer.java
new file mode 100644
index 0000000..7d93819
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonDeserializer.java
@@ -0,0 +1,34 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.KeyDeserializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+public class KeyAsJsonDeserializer extends KeyDeserializer{
+ static ObjectMapper mapper = new ObjectMapper();
+ static {
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ }
+ @Override
+ public Object deserializeKey(String key, DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+ if (key.startsWith(KeyAsJsonSerializer.URIPrefix)){
+ key = key.substring(KeyAsJsonSerializer.URIPrefix.length());
+ try {
+ return new URI(key);
+ } catch (URISyntaxException e) {
+ // should never get here.
+ e.printStackTrace();
+ return null;
+ }
+ }
+ return mapper.readValue(key, Object.class);
+ }
+
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonSerializer.java
new file mode 100644
index 0000000..ecc2161
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/KeyAsJsonSerializer.java
@@ -0,0 +1,32 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.IOException;
+import java.net.URI;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializerProvider;
+
+public class KeyAsJsonSerializer extends JsonSerializer<Object> {
+ static ObjectMapper mapper = new ObjectMapper();
+ static {
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ }
+
+ public static String URIPrefix = "_-_-java.net.URI_TYPE_HACKER";
+ @Override
+ public void serialize(Object value, JsonGenerator jgen,
+ SerializerProvider provider) throws IOException,
+ JsonProcessingException {
+ String json;
+ if (value instanceof URI){
+ json = URIPrefix + value;
+ }else{
+ json = mapper.writeValueAsString(value);
+ }
+ jgen.writeFieldName(json);
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmDeserializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmDeserializer.java
new file mode 100644
index 0000000..26ef989
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmDeserializer.java
@@ -0,0 +1,13 @@
+package org.apache.ode.bpel.obj.serde;
+
+import org.apache.ode.bpel.obj.OProcess;
+
+public interface OmDeserializer {
+ /**
+ * Deserialize to process instance. Instances should be
+ * created and built by {@link OmSerdeFactory}
+ * @return Deserialized {@link OProcess}.
+ * @throws SerializaionRtException
+ */
+ public OProcess deserialize() throws SerializaionRtException;
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerdeFactory.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerdeFactory.java
new file mode 100644
index 0000000..b6d0412
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerdeFactory.java
@@ -0,0 +1,92 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.migrate.LegacySerializerAdapter;
+
+public class OmSerdeFactory {
+ /**default serialization format */
+ public static final SerializeFormat FORMAT_SERIALIZED_DEFAULT = SerializeFormat.FORMAT_SERIALIZED_JAVA;
+
+ private SerializeFormat format = FORMAT_SERIALIZED_DEFAULT;
+
+
+ public OmSerializer createOmSerializer(OutputStream out, OProcess process){
+ OmSerializer serializer;
+ switch (format) {
+ case FORMAT_SERIALIZED_JSON:
+ serializer = new JsonOmSerializer(out, process);
+ break;
+ case FORMAT_SERIALIZED_SMILE:
+ serializer = new SmileOmSerializer(out, process);
+ break;
+ case FORMAT_SERIALIZED_JAVA:
+ serializer = new JavaSerOmSerializer(out, process);
+ break;
+ default:
+ throw new SerializaionRtException("Unsupported format");
+ }
+ return serializer;
+ }
+
+ public OmDeserializer createOmDeserializer(InputStream is){
+ OmDeserializer deser = null;
+ switch (format) {
+ case FORMAT_SERIALIZED_JSON:
+ deser = new JsonOmDeserializer(is);
+ break;
+ case FORMAT_SERIALIZED_SMILE:
+ deser = new SmileOmDeserializer(is);
+ break;
+ case FORMAT_SERIALIZED_JAVA:
+ deser = new JavaSerOmDeserializer(is);
+ break;
+ case FORMAT_SERIALIZED_LEGACY:
+ deser = new LegacySerializerAdapter(is);
+ break;
+ default:
+ throw new SerializaionRtException("Unsupported format");
+ }
+ return deser;
+ }
+
+ public SerializeFormat getFormat() {
+ return format;
+ }
+ public void setFormat(SerializeFormat format) {
+ this.format = format;
+ }
+
+ public static enum SerializeFormat{
+ FORMAT_UNINITIALIZED(0x00),
+ FORMAT_SERIALIZED_JSON(0x10),
+ FORMAT_SERIALIZED_SMILE(0x11),
+ FORMAT_SERIALIZED_JAVA(0x20),
+
+ /**convenient for legacy format */
+ FORMAT_SERIALIZED_LEGACY(0x90);
+
+ private int code;
+ private SerializeFormat(int code){
+ this.code = code;
+ }
+
+ public int encode(){
+ return code;
+ }
+ public SerializeFormat decode(int c){
+ switch (c) {
+ case 0x10:
+ return FORMAT_SERIALIZED_JSON;
+ case 0x11:
+ return FORMAT_SERIALIZED_SMILE;
+ case 0x20:
+ return FORMAT_SERIALIZED_JAVA;
+ default:
+ return FORMAT_UNINITIALIZED;
+ }
+ }
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerializer.java
new file mode 100644
index 0000000..419da10
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/OmSerializer.java
@@ -0,0 +1,13 @@
+package org.apache.ode.bpel.obj.serde;
+
+import org.apache.ode.bpel.obj.OProcess;
+
+
+public interface OmSerializer {
+ /**
+ * Serialize the {@link OProcess} instance
+ * @throws SerializaionRtException
+ * @see OmSerdeFactory
+ */
+ public void serialize() throws SerializaionRtException;
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SerializaionRtException.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SerializaionRtException.java
new file mode 100644
index 0000000..9945ef0
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SerializaionRtException.java
@@ -0,0 +1,10 @@
+package org.apache.ode.bpel.obj.serde;
+
+public class SerializaionRtException extends RuntimeException {
+ public SerializaionRtException(String string) {
+ super(string);
+ }
+
+ private static final long serialVersionUID = -690983865033774484L;
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmDeserializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmDeserializer.java
new file mode 100644
index 0000000..d032cd7
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmDeserializer.java
@@ -0,0 +1,19 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.InputStream;
+
+import com.fasterxml.jackson.dataformat.smile.SmileFactory;
+
+/** OModel Serializer that corresponding to {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_SMILE}
+ * @see JsonOmSerializer
+*/
+public class SmileOmDeserializer extends JsonOmDeserializer {
+ public SmileOmDeserializer() {
+ super();
+ factory = new SmileFactory();
+ }
+
+ public SmileOmDeserializer(InputStream is) {
+ super(is, new SmileFactory());
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmSerializer.java
new file mode 100644
index 0000000..9232630
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/SmileOmSerializer.java
@@ -0,0 +1,21 @@
+package org.apache.ode.bpel.obj.serde;
+
+import java.io.OutputStream;
+
+import org.apache.ode.bpel.obj.OProcess;
+
+import com.fasterxml.jackson.dataformat.smile.SmileFactory;
+
+/**
+ * OModel Serializer that corresponding to {@link OmSerdeFactory.SerializeFormat#FORMAT_SERIALIZED_SMILE}
+ * @see JsonOmDeserializer
+ */
+public class SmileOmSerializer extends JsonOmSerializer{
+ public SmileOmSerializer(){
+ super();
+ factory = new SmileFactory();
+ }
+ public SmileOmSerializer(OutputStream out, OProcess process) {
+ super(out, process, new SmileFactory());
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializer.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializer.java
new file mode 100644
index 0000000..96a4833
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializer.java
@@ -0,0 +1,161 @@
+package org.apache.ode.bpel.obj.serde.jacksonhack;
+
+import java.io.IOException;
+
+import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.jsontype.TypeSerializer;
+import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
+import com.fasterxml.jackson.databind.ser.BeanSerializer;
+import com.fasterxml.jackson.databind.ser.BeanSerializerBuilder;
+import com.fasterxml.jackson.databind.ser.impl.ObjectIdWriter;
+import com.fasterxml.jackson.databind.ser.impl.WritableObjectId;
+import com.fasterxml.jackson.databind.ser.std.BeanSerializerBase;
+
+/**
+ * This BeanSerializer differs the standard {@link BeanSerializer} when serialize
+ * shared bean reference with object id. This class adds type info along with Object id.
+ * The BeanSerializer seems not designed for extension, we have some redundant code here
+ * copied from {@link BeanSerializer}.
+ * @author fangzhen
+ *
+ */
+public class TypeBeanSerializer extends BeanSerializer {
+
+ public TypeBeanSerializer(JavaType type, BeanSerializerBuilder builder,
+ BeanPropertyWriter[] properties,
+ BeanPropertyWriter[] filteredProperties) {
+ super(type, builder, properties, filteredProperties);
+ }
+
+ /**
+ * Alternate copy constructor that can be used to construct
+ * standard {@link BeanSerializer} passing an instance of
+ * "compatible enough" source serializer. Simply copied from BeanSerializer.
+ */
+ protected TypeBeanSerializer(BeanSerializerBase src) {
+ super(src);
+ }
+
+ protected TypeBeanSerializer(BeanSerializerBase src,
+ ObjectIdWriter objectIdWriter) {
+ super(src, objectIdWriter);
+ }
+
+ protected TypeBeanSerializer(BeanSerializerBase src,
+ ObjectIdWriter objectIdWriter, Object filterId) {
+ super(src, objectIdWriter, filterId);
+ }
+
+ protected TypeBeanSerializer(BeanSerializerBase src, String[] toIgnore) {
+ super(src, toIgnore);
+ }
+
+ /**
+ * Convenient methods for new Serializer.
+ */
+ @Override
+ public BeanSerializerBase withObjectIdWriter(ObjectIdWriter objectIdWriter) {
+ return new TypeBeanSerializer(this, objectIdWriter, _propertyFilterId);
+ }
+
+ @Override
+ protected BeanSerializerBase withFilterId(Object filterId) {
+ return new TypeBeanSerializer(this, _objectIdWriter, filterId);
+ }
+
+ @Override
+ protected BeanSerializerBase withIgnorals(String[] toIgnore) {
+ return new TypeBeanSerializer(this, toIgnore);
+ }
+
+ public static TypeBeanSerializer createDummy(JavaType forType) {
+ return new TypeBeanSerializer(forType, null, NO_PROPS, null);
+ }
+
+ /**
+ * The method {@link BeanSerializer#_serializeWithObjectId(Object, JsonGenerator,
+ * SerializerProvider, TypeSerializer)} is final in BeanSerializer. As a
+ * result, we cannot override it. But it actually overrides the method functionally. The differences
+ * is that this method write additional type info along with object id for shared reference. Then the
+ * deserializer can tell if it's a reference or ordinary object.
+ * @param bean
+ * @param jgen
+ * @param provider
+ * @param typeSer
+ * @throws IOException
+ * @throws JsonGenerationException
+ */
+ protected void _serializeWithObjectId2(Object bean,
+ JsonGenerator jgen, SerializerProvider provider,
+ TypeSerializer typeSer) throws IOException, JsonGenerationException {
+ final ObjectIdWriter w = _objectIdWriter;
+ WritableObjectId objectId = provider.findObjectId(bean, w.generator);
+
+ if (objectId.id == null && w.alwaysAsId) {
+ objectId.generateId(bean);
+ }
+ //don't know why the field WrotableObjectId.isWritten is necessary. i didn't test it.
+ if (objectId.id != null) {
+ //write type info; assume that object id is scalar
+ String typeStr = (_typeId == null) ? null : _customTypeId(bean);
+ if (typeStr == null) {
+ typeSer.writeTypePrefixForScalar(bean, jgen);
+ } else {
+ typeSer.writeCustomTypePrefixForScalar(bean, jgen, typeStr);
+ }
+
+ objectId.writeAsId(jgen, provider, w);
+ if (typeStr == null) {
+ typeSer.writeTypeSuffixForScalar(bean, jgen);
+ } else {
+ typeSer.writeCustomTypeSuffixForScalar(bean, jgen, typeStr);
+ }
+ return;
+ }
+
+ objectId.generateId(bean);
+ _serializeObjectId(bean, jgen, provider, typeSer, objectId);
+ }
+
+ /**
+ * override this method to call our {@link #_serializeWithObjectId2(Object, JsonGenerator, SerializerProvider, TypeSerializer)}
+ * instead of {@link BeanSerializer#_serializeWithObjectId(Object, JsonGenerator, SerializerProvider, TypeSerializer)}.
+ */
+ @Override
+ public void serializeWithType(Object bean, JsonGenerator jgen,
+ SerializerProvider provider, TypeSerializer typeSer)
+ throws IOException, JsonGenerationException {
+ if (_objectIdWriter != null) {
+ _serializeWithObjectId2(bean, jgen, provider, typeSer);
+ return;
+ }
+
+ String typeStr = (_typeId == null) ? null : _customTypeId(bean);
+ if (typeStr == null) {
+ typeSer.writeTypePrefixForObject(bean, jgen);
+ } else {
+ typeSer.writeCustomTypePrefixForObject(bean, jgen, typeStr);
+ }
+ if (_propertyFilterId != null) {
+ serializeFieldsFiltered(bean, jgen, provider);
+ } else {
+ serializeFields(bean, jgen, provider);
+ }
+ if (typeStr == null) {
+ typeSer.writeTypeSuffixForObject(bean, jgen);
+ } else {
+ typeSer.writeCustomTypeSuffixForObject(bean, jgen, typeStr);
+ }
+ }
+ private final String _customTypeId(Object bean) {
+ final Object typeId = _typeId.getValue(bean);
+ if (typeId == null) {
+ return "";
+ }
+ return (typeId instanceof String) ? (String) typeId : typeId.toString();
+ }
+
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerBuilder.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerBuilder.java
new file mode 100644
index 0000000..55069df
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerBuilder.java
@@ -0,0 +1,46 @@
+package org.apache.ode.bpel.obj.serde.jacksonhack;
+
+
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
+import com.fasterxml.jackson.databind.ser.BeanSerializer;
+import com.fasterxml.jackson.databind.ser.BeanSerializerBuilder;
+
+public class TypeBeanSerializerBuilder extends BeanSerializerBuilder{
+ private final static BeanPropertyWriter[] NO_PROPERTIES = new BeanPropertyWriter[0];
+ protected TypeBeanSerializerBuilder(BeanSerializerBuilder src) {
+ super(src);
+ }
+
+ public TypeBeanSerializerBuilder(BeanDescription beanDesc) {
+ super(beanDesc);
+ }
+ @Override
+ public TypeBeanSerializer createDummy() {
+ return TypeBeanSerializer.createDummy(_beanDesc.getType());
+ }
+
+ /**
+ * Method called to create {@link BeanSerializer} instance with
+ * all accumulated information. Will construct a serializer if we
+ * have enough information, or return null if not.
+ */
+ @Override
+ public JsonSerializer<?> build()
+ {
+ BeanPropertyWriter[] properties;
+ // No properties, any getter or object id writer?
+ // No real serializer; caller gets to handle
+ if (_properties == null || _properties.isEmpty()) {
+ if (_anyGetter == null && _objectIdWriter == null) {
+ return null;
+ }
+ properties = NO_PROPERTIES;
+ } else {
+ properties = _properties.toArray(new BeanPropertyWriter[_properties.size()]);
+ }
+ return new TypeBeanSerializer(_beanDesc.getType(), this,
+ properties, _filteredProperties);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerFactory.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerFactory.java
new file mode 100644
index 0000000..ff49a94
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/TypeBeanSerializerFactory.java
@@ -0,0 +1,34 @@
+package org.apache.ode.bpel.obj.serde.jacksonhack;
+
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig;
+import com.fasterxml.jackson.databind.ser.BeanSerializerFactory;
+import com.fasterxml.jackson.databind.ser.SerializerFactory;
+
+public class TypeBeanSerializerFactory extends BeanSerializerFactory {
+
+ private static final long serialVersionUID = 8155473476177879404L;
+ public final static TypeBeanSerializerFactory instance = new TypeBeanSerializerFactory(
+ null);
+
+ protected TypeBeanSerializerFactory(SerializerFactoryConfig config) {
+ super(config);
+ }
+
+ @Override
+ protected TypeBeanSerializerBuilder constructBeanSerializerBuilder(
+ BeanDescription beanDesc) {
+ return new TypeBeanSerializerBuilder(beanDesc);
+ }
+
+ /**
+ * steal from BeanSerializer to avoid Exception...
+ */
+ @Override
+ public SerializerFactory withConfig(SerializerFactoryConfig config) {
+ if (_factoryConfig == config) {
+ return this;
+ }
+ return new TypeBeanSerializerFactory(config);
+ }
+}
diff --git a/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/UniqueStringIdGenerator.java b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/UniqueStringIdGenerator.java
new file mode 100644
index 0000000..cef3e30
--- /dev/null
+++ b/bpel-nobj/src/main/java/org/apache/ode/bpel/obj/serde/jacksonhack/UniqueStringIdGenerator.java
@@ -0,0 +1,56 @@
+package org.apache.ode.bpel.obj.serde.jacksonhack;
+
+import java.util.UUID;
+
+import com.fasterxml.jackson.annotation.ObjectIdGenerator;
+
+/**
+ * Copied from jackson {@link com.fasterxml.jackson.annotation.ObjectIdGenerators.UUIDGenerator}
+ * and changed id type from UUID to String
+ */
+public class UniqueStringIdGenerator extends ObjectIdGenerator<String>{
+ private static final long serialVersionUID = 1L;
+ protected final Class<?> _scope;
+ public UniqueStringIdGenerator() { this(Object.class); }
+ private UniqueStringIdGenerator(Class<?> scope) {
+ _scope = scope;
+ }
+
+ /**
+ * Can just return base instance since this is essentially scopeless
+ */
+ @Override
+ public ObjectIdGenerator<String> forScope(Class<?> scope) {
+ return this;
+ }
+
+ /**
+ * Can just return base instance since this is essentially scopeless
+ */
+ @Override
+ public ObjectIdGenerator<String> newForSerialization(Object context) {
+ return this;
+ }
+
+ @Override
+ public String generateId(Object forPojo) {
+ return UUID.randomUUID().toString();
+ }
+
+ @Override
+ public IdKey key(Object key) {
+ return new IdKey(getClass(), null, key);
+ }
+
+ /**
+ * Since UUIDs are always unique, let's fully ignore scope definition
+ */
+ @Override
+ public boolean canUseFor(ObjectIdGenerator<?> gen) {
+ return (gen.getClass() == getClass());
+ }
+ @Override
+ public Class<?> getScope() {
+ return _scope;
+ }
+}
diff --git a/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/migrate/DeepEqualityTest.java b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/migrate/DeepEqualityTest.java
new file mode 100644
index 0000000..4d40ad8
--- /dev/null
+++ b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/migrate/DeepEqualityTest.java
@@ -0,0 +1,83 @@
+package org.apache.ode.bpel.obj.migrate;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.DebugInfo;
+import org.junit.Test;
+
+public class DeepEqualityTest {
+ @Test
+ public void simpleListTest(){
+ List<String> ls1 = new ArrayList<String>();
+ ls1.add("Hello");
+ ls1.add("world");
+ List<String> ls2 = new ArrayList<String>();
+ ls2.add("Hello");
+ ls2.add("world");
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ assertEquals(Boolean.TRUE, de.deepEquals(ls1, ls2));
+ ls1.add(0, "!");
+ ls2.add("!");
+ assertEquals(Boolean.TRUE, de.deepEquals(ls1, ls2));
+ }
+
+ @Test
+ public void simpleSetTest(){
+ Set<String> s1 = new LinkedHashSet();
+ s1.add("hello");
+ s1.add("world");
+ Set<String> s2 = new LinkedHashSet();
+ s2.add("world");
+ s2.add("hello");
+
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ assertEquals(Boolean.TRUE, de.deepEquals(s1, s2));
+
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Test
+ public void simpleMapTest(){
+ Map<String, Object> m1 = new HashMap();
+ m1.put("item1", "string1");
+ m1.put("item2", new ArrayList());
+ Map<String, Object> m2 = new HashMap();
+ m2.put("item1", "string1");
+ m2.put("item2", new ArrayList());
+
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ assertEquals(Boolean.TRUE, de.deepEquals(m1, m2));
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ @Test
+ public void simpleTest() throws Exception{
+ Map m1 = new HashMap();
+ QName n1 = new QName("localpart");
+ URI u1 = new URI("urn://a/uri");
+ m1.put(u1, n1);
+ DebugInfo d1 = new DebugInfo("/a/path", 0, 1, m1);
+ m1.put("cyclic", d1);
+
+ Map m2 = new HashMap();
+ QName n2 = new QName("localpart");
+ URI u2 = new URI("urn://a/uri");
+ m2.put(u2, n2);
+ DebugInfo d2 = new DebugInfo("/a/path", 0, 1, m2);
+ m2.put("cyclic", d2);
+
+ DeepEqualityHelper de = new DeepEqualityHelper();
+ de.addCustomComparator(new ExtensibeImplEqualityComp());
+ assertEquals(Boolean.TRUE, de.deepEquals(m1, m2));
+ }
+}
diff --git a/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/SerializerTest.java b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/SerializerTest.java
new file mode 100644
index 0000000..f0d7627
--- /dev/null
+++ b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/SerializerTest.java
@@ -0,0 +1,31 @@
+package org.apache.ode.bpel.obj.serde;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.ode.bpel.obj.OProcess;
+import org.junit.Test;
+
+public class SerializerTest {
+
+ @Test
+ public void testBasicSerialize() throws IOException {
+ OmSerdeFactory serdeFactory = new OmSerdeFactory();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ OProcess original = new OProcess("0");
+ original.setProcessName("process1");
+ DeSerializer serializer = new DeSerializer();
+ serializer.serialize(baos, original);
+
+ InputStream is = new BufferedInputStream(new ByteArrayInputStream(baos
+ .toByteArray()));
+ DeSerializer deSerializer = new DeSerializer(is);
+ OProcess desered = deSerializer.deserialize();
+ assertEquals(original.getFieldContainer(), desered.getFieldContainer());
+ }
+}
diff --git a/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/jacksonhack/JacksonTest.java b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/jacksonhack/JacksonTest.java
new file mode 100644
index 0000000..afa4b78
--- /dev/null
+++ b/bpel-nobj/src/test/java/org/apache/ode/bpel/obj/serde/jacksonhack/JacksonTest.java
@@ -0,0 +1,161 @@
+package org.apache.ode.bpel.obj.serde.jacksonhack;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.ode.bpel.obj.serde.KeyAsJsonDeserializer;
+import org.apache.ode.bpel.obj.serde.KeyAsJsonSerializer;
+import org.junit.Test;
+
+import com.fasterxml.jackson.annotation.JsonIdentityInfo;
+import com.fasterxml.jackson.annotation.ObjectIdGenerators;
+import com.fasterxml.jackson.core.JsonGenerationException;
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.smile.SmileFactory;
+
+public class JacksonTest {
+ /**
+ * Test the TypeBeanSerializer
+ * @throws JsonGenerationException
+ * @throws JsonMappingException
+ * @throws IOException
+ */
+ @Test
+ public void testReference() throws JsonGenerationException,
+ JsonMappingException, IOException {
+ Map<Object, Object> map = new LinkedHashMap<Object, Object>();
+ A a = new A();
+ a.next = a;
+ a.val = 100;
+ map.put("i1", 100);
+ map.put("i2", a);
+ map.put("i4", a);
+ Map<Object, Object> map2 = new LinkedHashMap<Object, Object>();
+ String s = "a string";
+ map2.put("i31", s);
+ map2.put("i33", s);
+ map2.put("i32", a);
+ map.put("i3", map2);
+ B b = new B();
+ b.parent = a;
+ A a2 = b;
+ map.put("i5", b);
+ map.put("i6", a2);
+ ObjectMapper mapper = new ObjectMapper(new SmileFactory());
+ mapper.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ mapper.enable(SerializationFeature.INDENT_OUTPUT);
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ mapper.writeValue(os, map);
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ ObjectMapper m2 = new ObjectMapper(new SmileFactory());
+ m2.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ m2.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ @SuppressWarnings("rawtypes")
+ Map dem = m2.readValue(is, Map.class);
+ assertEquals(100, ((Integer)dem.get("i1")).intValue());
+ assertEquals(dem.get("i2"), dem.get("i4"));
+ assertEquals(B.class, dem.get("i5").getClass());
+ @SuppressWarnings("rawtypes")
+ Map dem2 = (Map)dem.get("i3");
+ assertEquals(dem2.get("i31"), dem2.get("i33"));
+ assertEquals(dem2.get("i32"), dem.get("i2"));
+ }
+
+ @JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@id")
+ static class A {
+ private int val;
+ private A next;
+
+ public int getVal() {
+ return val;
+ }
+
+ public String toString() {
+ String nextstr;
+ if (next == null) nextstr = "null";
+ else nextstr = "" + next.hashCode();
+ return "|type = " + this.getClass() + "@" + hashCode() + ", val = " + val
+ + ", next = " + nextstr + "|";
+ }
+
+ public A getNext() {
+ return next;
+ }
+
+ }
+ @JsonIdentityInfo(generator = ObjectIdGenerators.IntSequenceGenerator.class, property = "@id")
+ static class B extends A{
+ private A parent;
+ public A getParent(){
+ return parent;
+ }
+ }
+ static class C{
+ @JsonSerialize(keyUsing=KeyAsJsonSerializer.class)
+ @JsonDeserialize(keyUsing=KeyAsJsonDeserializer.class)
+ Map<Object, Object> map = new LinkedHashMap<Object, Object>();
+
+ }
+ @Test
+ public void testMapTypeInfo() throws JsonParseException, JsonMappingException, IOException{
+ ObjectMapper mapper = new ObjectMapper(new SmileFactory());
+ mapper.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ mapper.enable(SerializationFeature.INDENT_OUTPUT);
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ C c = new C();
+ QName qname = new QName("uri","localtest");
+ c.map.put(qname, qname);
+ mapper.writeValue(os, c);
+
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ ObjectMapper m2 = new ObjectMapper(new SmileFactory());
+ m2.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ m2.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+
+ C de = m2.readValue(is, C.class);
+ assertEquals(c.map, de.map);
+ }
+
+ @JsonIdentityInfo(generator = UniqueStringIdGenerator.class, property = "@id")
+ public static class D{
+ public D next;
+ }
+ @Test
+ public void testSmileFormat() throws JsonGenerationException, JsonMappingException, IOException{
+ ObjectMapper mapper = new ObjectMapper(new SmileFactory());
+ D d = new D();
+ d.next = d;
+
+ mapper.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+ mapper.enable(SerializationFeature.INDENT_OUTPUT);
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+ mapper.writeValue(os, d);
+
+ ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
+ ObjectMapper m2 = new ObjectMapper(new SmileFactory());
+ m2.setSerializerFactory(TypeBeanSerializerFactory.instance);
+ m2.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
+
+ D de = m2.readValue(is, D.class);
+ assertEquals(D.class, de.next.getClass());
+
+ }
+}
diff --git a/bpel-nobj/src/test/resources/log4j.properties b/bpel-nobj/src/test/resources/log4j.properties
new file mode 100644
index 0000000..f50576a
--- /dev/null
+++ b/bpel-nobj/src/test/resources/log4j.properties
@@ -0,0 +1,13 @@
+log4j.rootLogger=DEBUG, file
+
+# Console appender
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=target/test/test.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p (%13F:%L) %3x - %m%n
+
+
diff --git a/bpel-obj/src/main/java/org/apache/ode/bpel/o/OProcess.java b/bpel-obj/src/main/java/org/apache/ode/bpel/o/OProcess.java
index 20c7b0d..717b9e2 100644
--- a/bpel-obj/src/main/java/org/apache/ode/bpel/o/OProcess.java
+++ b/bpel-obj/src/main/java/org/apache/ode/bpel/o/OProcess.java
@@ -20,9 +20,6 @@
import javax.wsdl.Operation;
import javax.xml.namespace.QName;
-
-import org.apache.ode.utils.NSContext;
-
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.URI;
@@ -79,8 +76,6 @@
public final HashMap<URI, OXslSheet> xslSheets = new HashMap<URI, OXslSheet>();
- public NSContext namespaceContext = null;
-
public OProcess(String bpelVersion) {
super(null);
this.version = bpelVersion;
@@ -169,7 +164,6 @@
/** For BPEL 1.1 */
public OMessageVarType.Part part;
- public String header;
public OExpression location;
@@ -183,7 +177,6 @@
StringBuffer buf = new StringBuffer(varType.toString());
buf.append('[');
buf.append(part != null ? part.name : "");
- buf.append(header != null ? "header: " + header : "");
if (location != null) {
buf.append("][");
buf.append(location.toString());
diff --git a/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java b/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
index 8683650..bc76905 100644
--- a/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
+++ b/bpel-obj/src/main/java/org/apache/ode/bpel/o/OScope.java
@@ -68,9 +68,6 @@
/** Is this scope <em>atomic</em> i.e. meant to execute in a single transaction. */
public boolean atomicScope;
- /** Is this scope <em>isolated</em> i.e. protected against concurrent access to its variables. */
- public boolean isolatedScope;
-
public OScope(OProcess owner, OActivity parent) {
super(owner, parent);
}
diff --git a/bpel-obj/src/main/java/org/apache/ode/bpel/o/Serializer.java b/bpel-obj/src/main/java/org/apache/ode/bpel/o/Serializer.java
index 5c3e653..9ac0ae3 100644
--- a/bpel-obj/src/main/java/org/apache/ode/bpel/o/Serializer.java
+++ b/bpel-obj/src/main/java/org/apache/ode/bpel/o/Serializer.java
@@ -135,13 +135,6 @@
oprocess = (OProcess) ois.readObject();
} catch (ClassNotFoundException e) {
throw new IOException("DataStream Error", e);
- } finally {
- try {
- if (ois != null)
- ois.close();
- } catch (IOException e) {
-
- }
}
return oprocess;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/XslRuntimeUriResolver.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/XslRuntimeUriResolver.java
index 136a787..38395f6 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/XslRuntimeUriResolver.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/XslRuntimeUriResolver.java
@@ -32,8 +32,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.StreamUtils;
import org.apache.ode.utils.fs.FileUtils;
@@ -64,7 +64,7 @@
OXslSheet sheet = _expr.getXslSheet(uri);
if( sheet != null) {
- String result = sheet.sheetBody;
+ String result = sheet.getSheetBody();
if (result != null) {
return new StreamSource(new StringReader(result));
} else {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/JaxenContexts.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/JaxenContexts.java
index 7cc32c8..0abee3c 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/JaxenContexts.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/JaxenContexts.java
@@ -33,17 +33,17 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.elang.XslRuntimeUriResolver;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.xsl.XslTransformHandler;
import org.jaxen.Context;
@@ -117,15 +117,15 @@
if ((namespaceURI != null)) {
QName fnQName = new QName(namespaceURI, localName);
- if (fnQName.equals(_oxpath.qname_getVariableProperty))
+ if (fnQName.equals(_oxpath.getQname_getVariableProperty()))
return _getVariableProperty;
- if (fnQName.equals(_oxpath.qname_getVariableData))
+ if (fnQName.equals(_oxpath.getQname_getVariableData()))
return _getVariableData;
- if (fnQName.equals(_oxpath.qname_getLinkStatus))
+ if (fnQName.equals(_oxpath.getQname_getLinkStatus()))
return _getLinkStatus;
if (_oxpath instanceof OXPath10ExpressionBPEL20) {
OXPath10ExpressionBPEL20 oxpath20 = (OXPath10ExpressionBPEL20) _oxpath;
- if (fnQName.equals(oxpath20.qname_doXslTransform)) {
+ if (fnQName.equals(oxpath20.getQname_doXslTransform())) {
return _doXslTransform;
}
}
@@ -159,8 +159,8 @@
}
OXPath10ExpressionBPEL20 expr = (OXPath10ExpressionBPEL20)_oxpath;
- if(expr.isJoinExpression){
- OLink olink = _oxpath.links.get(localName);
+ if(expr.isIsJoinExpression()){
+ OLink olink = _oxpath.getLinks().get(localName);
try {
return _xpathEvalCtx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
@@ -178,44 +178,44 @@
varName = localName.substring(0, dotloc);
partName = localName.substring(dotloc + 1);
}
- OScope.Variable variable = _oxpath.vars.get(varName);
- OMessageVarType.Part part = partName == null ? null : ((OMessageVarType)variable.type).parts.get(partName);
+ OScope.Variable variable = _oxpath.getVars().get(varName);
+ OMessageVarType.Part part = partName == null ? null : ((OMessageVarType)variable.getType()).getParts().get(partName);
try{
Node variableNode = _xpathEvalCtx.readVariable(variable, part);
if (variableNode == null)
throw new WrappedFaultException.JaxenUnresolvableException(
- new FaultException(variable.getOwner().constants.qnSelectionFailure,
+ new FaultException(variable.getOwner().getConstants().getQnSelectionFailure(),
"Unknown variable " + localName));
- OVarType type = variable.type;
+ OVarType type = variable.getType();
if (type instanceof OMessageVarType) {
- OMessageVarType.Part typePart = ((OMessageVarType)type).parts.get(partName);
+ OMessageVarType.Part typePart = ((OMessageVarType)type).getParts().get(partName);
if (typePart == null) {
throw new WrappedFaultException.JaxenUnresolvableException(
- new FaultException(variable.getOwner().constants.qnSelectionFailure,
+ new FaultException(variable.getOwner().getConstants().getQnSelectionFailure(),
"Unknown part " + partName + " for variable " + localName));
}
- type = typePart.type;
+ type = typePart.getType();
}
- if (_xpathEvalCtx.narrowTypes() && type instanceof OXsdTypeVarType && ((OXsdTypeVarType)type).simple) {
+ if (_xpathEvalCtx.narrowTypes() && type instanceof OXsdTypeVarType && ((OXsdTypeVarType)type).isSimple()) {
String value = variableNode.getTextContent();
OXsdTypeVarType theType = (OXsdTypeVarType)type;
- // cast booleans to boolean
- if (BOOLEAN.equals(theType.xsdType)) {
+ // cast booleans to boolean
+ if (BOOLEAN.equals(theType.getXsdType())) {
return new Boolean(value) ;
}
// and numbers to numbers (XPath only understands Double, so Double it shall be.
- if (INT.equals(theType.xsdType) || UNSIGNED_SHORT.equals(theType.xsdType) ||
- INTEGER.equals(theType.xsdType) ||
- LONG.equals(theType.xsdType) || UNSIGNED_INT.equals(theType.xsdType) ||
- SHORT.equals(theType.xsdType) || UNSIGNED_BYTE.equals(theType.xsdType) ||
- BYTE.equals(theType.xsdType) ||
- DECIMAL.equals(theType.xsdType) ||
- FLOAT.equals(theType.xsdType) ||
- DOUBLE.equals(theType.xsdType)
+ if (INT.equals(theType.getXsdType()) || UNSIGNED_SHORT.equals(theType.getXsdType()) ||
+ INTEGER.equals(theType.getXsdType()) ||
+ LONG.equals(theType.getXsdType()) || UNSIGNED_INT.equals(theType.getXsdType()) ||
+ SHORT.equals(theType.getXsdType()) || UNSIGNED_BYTE.equals(theType.getXsdType()) ||
+ BYTE.equals(theType.getXsdType()) ||
+ DECIMAL.equals(theType.getXsdType()) ||
+ FLOAT.equals(theType.getXsdType()) ||
+ DOUBLE.equals(theType.getXsdType())
) {
return new Double(value);
}
@@ -254,9 +254,9 @@
}
try {
- Node ret = _xpathEvalCtx.readVariable(sig.variable, sig.part);
- if (sig.location != null)
- ret = _xpathEvalCtx.evaluateQuery(ret, sig.location);
+ Node ret = _xpathEvalCtx.readVariable(sig.getVariable(), sig.getPart());
+ if (sig.getLocation() != null)
+ ret = _xpathEvalCtx.evaluateQuery(ret, sig.getLocation());
if (__log.isDebugEnabled()) {
__log.debug("bpws:getVariableData(" + args + ")' = " + ret);
@@ -287,8 +287,8 @@
throw new FunctionCallException("missing required arguments");
}
- OScope.Variable var = _oxpath.vars.get(args.get(0));
- OProcess.OProperty property = _oxpath.properties.get(args.get(1));
+ OScope.Variable var = _oxpath.getVars().get(args.get(0));
+ OProcess.OProperty property = _oxpath.getProperties().get(args.get(1));
if (__log.isDebugEnabled()) {
__log.debug("function call:'bpws:getVariableProperty(" + var + ","
@@ -309,7 +309,7 @@
throws FunctionCallException {
assert args.size() == 1;
- OLink olink = _oxpath.links.get(args.get(0));
+ OLink olink = _oxpath.getLinks().get(args.get(0));
try {
return _xpathEvalCtx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
@@ -337,7 +337,7 @@
if (args.get(1) instanceof List) {
List elmts = (List)args.get(1);
if (elmts.size() != 1) throw new WrappedFaultException.JaxenFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
varElmt = (Element) elmts.get(0);
@@ -350,7 +350,7 @@
}
} catch (ClassCastException e) {
throw new WrappedFaultException.JaxenFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
}
@@ -369,7 +369,7 @@
if (!(varElmt instanceof Element)) {
throw new WrappedFaultException.JaxenFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
}
@@ -378,7 +378,7 @@
if (args.size() > 2) {
parametersMap = new HashMap<QName, Object>();
for (int idx = 2; idx < args.size(); idx+=2) {
- QName keyQName = _oxpath.namespaceCtx.derefQName((String) args.get(idx));
+ QName keyQName = _oxpath.getNamespaceCtx().derefQName((String) args.get(idx));
parametersMap.put(keyQName, args.get(idx + 1));
}
}
@@ -389,12 +389,12 @@
DOMSource source = new DOMSource(varDoc);
Object result;
XslRuntimeUriResolver resolver = new XslRuntimeUriResolver(_oxpath, _xpathEvalCtx.getBaseResourceURI());
- XslTransformHandler.getInstance().cacheXSLSheet(_xpathEvalCtx.getProcessQName(), xslUri, xslSheet.sheetBody, resolver);
+ XslTransformHandler.getInstance().cacheXSLSheet(_xpathEvalCtx.getProcessQName(), xslUri, xslSheet.getSheetBody(), resolver);
try {
result = XslTransformHandler.getInstance().transform(_xpathEvalCtx.getProcessQName(), xslUri, source, parametersMap, resolver);
} catch (Exception e) {
throw new WrappedFaultException.JaxenFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSubLanguageExecutionFault,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSubLanguageExecutionFault(),
e.toString()));
}
return result;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
index 2b255af..f2a5476 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
@@ -21,12 +21,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
import org.apache.ode.bpel.explang.ConfigurationException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
-import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.obj.OExpression;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.ISO8601DateParser;
import org.apache.ode.utils.xsd.Duration;
@@ -136,7 +136,7 @@
if (retVal.size() == 0 || retVal.size() > 1) {
StringBuffer msg = new StringBuffer((retVal.size() == 0) ? "No results for expression: '" : "Multiple results for expression: '");
if (cexp instanceof OXPath10Expression) {
- msg.append(((OXPath10Expression)cexp).xpath);
+ msg.append(((OXPath10Expression)cexp).getXpath());
} else {
msg.append(cexp.toString());
}
@@ -146,7 +146,7 @@
msg.append(DOMUtils.domToString(ctx.getRootNode()));
msg.append("'");
}
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, msg.toString());
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(), msg.toString());
}
return (Node) retVal.get(0);
@@ -161,7 +161,7 @@
} catch (Exception ex) {
String errmsg = "Invalid date: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue, errmsg);
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(), errmsg);
}
}
@@ -174,13 +174,13 @@
} catch (Exception ex) {
String errmsg = "Invalid duration: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue, errmsg);
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(), errmsg);
}
}
private Context createContext(OXPath10Expression oxpath, EvaluationContext ctx) {
JaxenContexts bpelSupport = new JaxenContexts(oxpath, _extensionFunctions, ctx);
- ContextSupport support = new ContextSupport(new JaxenNamespaceContextAdapter(oxpath.namespaceCtx), bpelSupport,
+ ContextSupport support = new ContextSupport(new JaxenNamespaceContextAdapter(oxpath.getNamespaceCtx()), bpelSupport,
bpelSupport, new BpelDocumentNavigator(ctx.getRootNode()));
Context jctx = new Context(support);
@@ -191,11 +191,11 @@
}
private XPath compile(OXPath10Expression exp) throws JaxenException {
- XPath xpath = _compiledExpressions.get(exp.xpath);
+ XPath xpath = _compiledExpressions.get(exp.getXpath());
if (xpath == null) {
- xpath = new DOMXPath(exp.xpath);
+ xpath = new DOMXPath(exp.getXpath());
synchronized (_compiledExpressions) {
- _compiledExpressions.put(exp.xpath, xpath);
+ _compiledExpressions.put(exp.getXpath(), xpath);
}
}
return xpath;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java
index aa29367..5dd082d 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpFunctionResolver.java
@@ -35,11 +35,13 @@
import javax.xml.xpath.XPathFunctionException;
import javax.xml.xpath.XPathFunctionResolver;
+import net.sf.saxon.dom.DOMNodeList;
import net.sf.saxon.dom.NodeWrapper;
import net.sf.saxon.trans.XPathException;
import net.sf.saxon.value.DayTimeDurationValue;
import net.sf.saxon.value.IntegerValue;
import net.sf.saxon.value.QNameValue;
+import net.sf.saxon.value.SequenceExtent;
import net.sf.saxon.value.YearMonthDurationValue;
import org.apache.commons.httpclient.URIException;
@@ -47,16 +49,16 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.elang.XslRuntimeUriResolver;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
import org.apache.ode.bpel.elang.xpath20.compiler.Constants;
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OXslSheet;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OXslSheet;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
import org.apache.ode.utils.URITemplate;
@@ -151,7 +153,7 @@
if (args.size() != 1)
throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getLinkStatusInvalidSource"), "Illegal Arguments"));
- OLink olink = _oxpath.links.get(args.get(0));
+ OLink olink = _oxpath.getLinks().get(args.get(0));
try {
return _ectx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
} catch (FaultException e) {
@@ -179,9 +181,9 @@
}
try {
- Node ret = _ectx.readVariable(sig.variable, sig.part);
- if (sig.location != null)
- ret = _ectx.evaluateQuery(ret, sig.location);
+ Node ret = _ectx.readVariable(sig.getVariable(), sig.getPart());
+ if (sig.getLocation() != null)
+ ret = _ectx.evaluateQuery(ret, sig.getLocation());
if (__log.isDebugEnabled()) {
__log.debug("bpws:getVariableData(" + args + ")' = " + ret);
@@ -204,8 +206,8 @@
throw new XPathFunctionException(new FaultException(new QName(Namespaces.ODE_EXTENSION_NS, "getVariablePropertyInvalidSource"), "Missing required arguments"));
}
- OScope.Variable var = _oxpath.vars.get(args.get(0));
- OProcess.OProperty property = _oxpath.properties.get(args.get(1));
+ OScope.Variable var = _oxpath.getVars().get(args.get(0));
+ OProcess.OProperty property = _oxpath.getProperties().get(args.get(1));
if (__log.isDebugEnabled()) {
__log.debug("function call:'bpws:getVariableProperty(" + var + ","
@@ -238,7 +240,7 @@
if (args.get(1) instanceof List) {
List elmts = (List) args.get(1);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
varElmt = (Element) elmts.get(0);
@@ -249,7 +251,7 @@
}
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
}
@@ -268,7 +270,7 @@
if (!(varElmt instanceof Element)) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"Second parameter of the bpws:doXslTransform function MUST point to a single " +
"element node."));
}
@@ -277,7 +279,7 @@
if (args.size() > 2) {
parametersMap = new HashMap<QName, Object>();
for (int idx = 2; idx < args.size(); idx += 2) {
- QName keyQName = _oxpath.namespaceCtx.derefQName((String) args.get(idx));
+ QName keyQName = _oxpath.getNamespaceCtx().derefQName((String) args.get(idx));
Object paramElmt;
if (args.get(idx + 1) instanceof NodeWrapper) {
Element tmpElmt = (Element) ((NodeWrapper) args.get(idx + 1)).getUnderlyingNode();
@@ -303,13 +305,13 @@
DOMSource source = new DOMSource(varDoc);
Object result;
XslRuntimeUriResolver resolver = new XslRuntimeUriResolver(_oxpath, _ectx.getBaseResourceURI());
- XslTransformHandler.getInstance().cacheXSLSheet(_ectx.getProcessQName(), xslUri, xslSheet.sheetBody, resolver);
+ XslTransformHandler.getInstance().cacheXSLSheet(_ectx.getProcessQName(), xslUri, xslSheet.getSheetBody(), resolver);
try {
result = XslTransformHandler.getInstance().transform(_ectx.getProcessQName(), xslUri, source, parametersMap, resolver);
} catch (Exception e) {
__log.warn("Could not transform XSL sheet " + args.get(0) + " on element " + DOMUtils.domToString(varElmt), e);
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSubLanguageExecutionFault,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSubLanguageExecutionFault(),
e.toString()));
}
if(result instanceof Node)
@@ -332,7 +334,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"The bpws:domToString function MUST be passed a single " +
"element node."));
varElmt = (Element) elmts.get(0);
@@ -345,7 +347,7 @@
}
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnXsltInvalidSource,
+ new FaultException(_oxpath.getOwner().getConstants().getQnXsltInvalidSource(),
"The bpws:domToString function MUST be passed a single " +
"element node."));
}
@@ -534,7 +536,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertInto function MUST be passed a single " +
"element node."));
parentElmt = (Element) elmts.get(0);
@@ -561,11 +563,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertInto function MUST be passed a single " +
"element node."));
}
@@ -639,11 +641,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + siblingsArg, e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertAfter function MUST be passed a single " +
"element node."));
}
@@ -716,11 +718,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + childArg, e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertBefore function MUST be passed a single " +
"element node."));
}
@@ -758,7 +760,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertAsFirstInto function MUST be passed a single " +
"element node."));
targetElmt = (Element) elmts.get(0);
@@ -784,11 +786,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertAsFirstInto function MUST be passed a single " +
"element node."));
}
@@ -817,7 +819,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertAsLastInto function MUST be passed a single " +
"element node."));
targetElmt = (Element) elmts.get(0);
@@ -843,11 +845,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:insertAsLastInto function MUST be passed a single " +
"element node."));
}
@@ -885,16 +887,25 @@
targetNodes.add((Element) ((NodeWrapper) delete).getUnderlyingNode());
} else if (delete instanceof Element) {
targetNodes.add((Element) delete);
+ } else if (delete instanceof SequenceExtent) {
+ try {
+ DOMNodeList nodeList= DOMNodeList.checkAndMake((SequenceExtent)delete);
+ for (int i=0;i<nodeList.getLength();i++){
+ targetNodes.add(nodeList.item(i));
+ }
+ } catch (XPathException e) {
+ throw new XPathFunctionException(e);
+ }
} else {
throw new XPathFunctionException("Unexpected argument type: " + delete.getClass());
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + delete, e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:delete function MUST be passed a valid " +
"element node."));
}
@@ -904,7 +915,7 @@
parentElmt = (Element) targetNode.getParentNode();
} else if (!parentElmt.isSameNode((Element) targetNode.getParentNode())) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:delete function MUST be passed nodes that have " +
"the same parent."));
}
@@ -918,12 +929,21 @@
}
}
}
+ // 2xLoops as previously the contents of the 'children' list appeared to
+ // be being changed by the clonedElmt.removeChild call, meaning the position
+ // offset was incorrect, a possibly better approach would be to sort the position
+ // indices and iterate *backwards* but for my needs this approach suffices.
+ List<Node> clonedChildrenToRemove = new ArrayList<Node>();
final Element clonedElmt = (Element) parentElmt.cloneNode(true);
children = clonedElmt.getChildNodes();
for (int target = 0; target < positions.length; target++) {
- Element deleteElmt = (Element) children.item(positions[target]);
+ Element deleteElmt = (Element) children.item(positions[target]);
+ clonedChildrenToRemove.add(deleteElmt);
+ }
+ for (Node deleteElmt : clonedChildrenToRemove) {
clonedElmt.removeChild(deleteElmt);
}
+
// Saxon doesn't like clones with no children, so I'll oblige
if (clonedElmt.getChildNodes().getLength() == 0) {
try {
@@ -951,7 +971,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:rename function MUST be passed a single " +
"element node."));
targetElmt = (Element) elmts.get(0);
@@ -971,7 +991,7 @@
} else if (args.get(1) instanceof List) {
List elmts = (List) args.get(1);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:rename function MUST be passed a single " +
"element node."));
Element nameElmt = (Element) elmts.get(0);
@@ -1044,11 +1064,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:rename function MUST be passed a single " +
"element node."));
}
@@ -1097,7 +1117,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:process-property function MUST be passed a single " +
"element node."));
if (elmts.get(0) instanceof Element) {
@@ -1117,7 +1137,7 @@
if (stringValue.indexOf(":") > 0) {
String prefix = stringValue.substring(0, stringValue.indexOf(":"));
String localPart = stringValue.substring(stringValue.indexOf(":") + 1);
- String namespaceUri = _oxpath.namespaceCtx.getNamespaceURI(prefix);
+ String namespaceUri = _oxpath.getNamespaceCtx().getNamespaceURI(prefix);
propertyName = new QName(namespaceUri, localPart, prefix);
} else {
propertyName = new QName(stringValue);
@@ -1134,11 +1154,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:process-property function MUST be passed a single " +
"element node."));
}
@@ -1161,7 +1181,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:dayTimeDuration function MUST be passed a single " +
"element node."));
if (elmts.get(0) instanceof Element) {
@@ -1185,11 +1205,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:dayTimeDuration function MUST be passed a single " +
"element node."));
}
@@ -1212,7 +1232,7 @@
if (args.get(0) instanceof List) {
List elmts = (List) args.get(0);
if (elmts.size() != 1) throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:yearMonthDuration function MUST be passed a single " +
"element node."));
if (elmts.get(0) instanceof Element) {
@@ -1236,11 +1256,11 @@
}
} catch (IllegalArgumentException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnInvalidExpressionValue,
+ new FaultException(_oxpath.getOwner().getConstants().getQnInvalidExpressionValue(),
"Invalid argument: URI Template expected. " + args.get(0), e));
} catch (ClassCastException e) {
throw new XPathFunctionException(
- new FaultException(_oxpath.getOwner().constants.qnSelectionFailure,
+ new FaultException(_oxpath.getOwner().getConstants().getQnSelectionFailure(),
"The bpws:yearMonthDuration function MUST be passed a single " +
"element node."));
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpVariableResolver.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpVariableResolver.java
index 2fc1097..2f6a405 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpVariableResolver.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/JaxpVariableResolver.java
@@ -34,13 +34,13 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10ExpressionBPEL20;
import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
import org.w3c.dom.Node;
@@ -84,8 +84,8 @@
}
OXPath10ExpressionBPEL20 expr = _oxpath;
- if (expr.isJoinExpression) {
- OLink olink = _oxpath.links.get(variableName.getLocalPart());
+ if (expr.isIsJoinExpression()) {
+ OLink olink = _oxpath.getLinks().get(variableName.getLocalPart());
try {
return _ectx.isLinkActive(olink) ? Boolean.TRUE : Boolean.FALSE;
@@ -103,18 +103,18 @@
varName = variableName.getLocalPart().substring(0, dotloc);
partName = variableName.getLocalPart().substring(dotloc + 1);
}
- OScope.Variable variable = _oxpath.vars.get(varName);
- OMessageVarType.Part part = partName == null ? null : ((OMessageVarType) variable.type).parts.get(partName);
+ OScope.Variable variable = _oxpath.getVars().get(varName);
+ OMessageVarType.Part part = partName == null ? null : ((OMessageVarType) variable.getType()).getParts().get(partName);
try {
final Node variableNode = _ectx.readVariable(variable, part);
if (variableNode == null)
- throw new FaultException(variable.getOwner().constants.qnSelectionFailure, "Unknown variable " + variableName.getLocalPart());
+ throw new FaultException(variable.getOwner().getConstants().getQnSelectionFailure(), "Unknown variable " + variableName.getLocalPart());
if (_ectx.narrowTypes()) {
- if (variable.type instanceof OXsdTypeVarType && ((OXsdTypeVarType) variable.type).simple)
- return getSimpleContent(variableNode, ((OXsdTypeVarType) variable.type).xsdType);
- if (part != null && part.type instanceof OXsdTypeVarType && ((OXsdTypeVarType) part.type).simple)
- return getSimpleContent(variableNode, ((OXsdTypeVarType) part.type).xsdType);
+ if (variable.getType() instanceof OXsdTypeVarType && ((OXsdTypeVarType) variable.getType()).isSimple())
+ return getSimpleContent(variableNode, ((OXsdTypeVarType) variable.getType()).getXsdType());
+ if (part != null && part.getType() instanceof OXsdTypeVarType && ((OXsdTypeVarType) part.getType()).isSimple())
+ return getSimpleContent(variableNode, ((OXsdTypeVarType) part.getType()).getXsdType());
}
// Saxon used to expect a node list, but now a regular node will suffice.
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java
index 0a3c636..74ac7e0 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java
@@ -41,14 +41,14 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
import org.apache.ode.bpel.elang.xpath20.compiler.WrappedResolverException;
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
import org.apache.ode.bpel.explang.ConfigurationException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
-import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.obj.OExpression;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.ISO8601DateParser;
import org.apache.ode.utils.xsd.Duration;
@@ -85,14 +85,14 @@
}
/**
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.obj.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
*/
public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
return (String)evaluate(cexp, ctx, XPathConstants.STRING);
}
/**
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.obj.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
*/
public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
return (Boolean) evaluate(cexp, ctx, XPathConstants.BOOLEAN);
@@ -103,7 +103,7 @@
}
/**
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.obj.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
*/
@SuppressWarnings("unchecked")
public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
@@ -174,7 +174,7 @@
if (retVal.size() == 0 || retVal.size() > 1) {
StringBuffer msg = new StringBuffer((retVal.size() == 0) ? "No results for expression: '" : "Multiple results for expression: '");
if (cexp instanceof OXPath10Expression) {
- msg.append(((OXPath10Expression)cexp).xpath);
+ msg.append(((OXPath10Expression)cexp).getXpath());
} else {
msg.append(cexp.toString());
}
@@ -186,9 +186,9 @@
}
if (retVal.size() == 0)
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, msg.toString(), new Throwable("ignoreMissingFromData"));
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(), msg.toString(), new Throwable("ignoreMissingFromData"));
if (retVal.size() > 1)
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, msg.toString());
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(), msg.toString());
}
return (Node) retVal.get(0);
}
@@ -196,9 +196,9 @@
public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException {
List literal = DOMUtils.toList(evaluate(cexp, context));
if (literal.size() == 0)
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "No results for expression: " + cexp);
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(), "No results for expression: " + cexp);
if (literal.size() > 1)
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "Multiple results for expression: " + cexp);
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(), "Multiple results for expression: " + cexp);
Object date =literal.get(0);
if (date instanceof Calendar) return (Calendar) date;
@@ -216,7 +216,7 @@
} catch (Exception ex) {
String errmsg = "Invalid date: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,errmsg);
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(),errmsg);
}
}
@@ -227,7 +227,7 @@
} catch (Exception ex) {
String errmsg = "Invalid duration: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,errmsg);
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(),errmsg);
}
}
@@ -240,16 +240,16 @@
XPath xpe = _xpf.newXPath();
xpe.setXPathFunctionResolver(funcResolver);
xpe.setXPathVariableResolver(varResolver);
- xpe.setNamespaceContext(oxpath20.namespaceCtx);
- String xpath = ((OXPath10Expression)cexp).xpath;
+ xpe.setNamespaceContext(oxpath20.getNamespaceCtx());
+ String xpath = ((OXPath10Expression)cexp).getXpath();
XPathExpression expr = xpe.compile(xpath);
Node contextNode = ctx.getRootNode();
if (contextNode == null) {
contextNode = DOMUtils.newDocument();
}
// Create step nodes in XPath in case it is incompletely instantiated
- if (oxpath20.insertMissingData) {
- XPath20ExpressionModifier modifier = new XPath20ExpressionModifier(oxpath20.namespaceCtx, ((XPathFactoryImpl) _xpf).getConfiguration().getNamePool());
+ if (oxpath20.isInsertMissingData()) {
+ XPath20ExpressionModifier modifier = new XPath20ExpressionModifier(oxpath20.getNamespaceCtx(), ((XPathFactoryImpl) _xpf).getConfiguration().getNamePool());
Node temp = ctx.getRootNode();
if (temp.getLocalName().equals("message") && temp.getNamespaceURI() == null) {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
index d0bdd3b..5678b51 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xquery10/runtime/XQuery10ExpressionRuntime.java
@@ -64,12 +64,12 @@
import org.apache.ode.bpel.elang.xpath20.runtime.JaxpFunctionResolver;
import org.apache.ode.bpel.elang.xpath20.runtime.JaxpVariableResolver;
import org.apache.ode.bpel.elang.xquery10.compiler.XQuery10BpelFunctions;
-import org.apache.ode.bpel.elang.xquery10.o.OXQuery10ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xquery10.obj.OXQuery10ExpressionBPEL20;
import org.apache.ode.bpel.explang.ConfigurationException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
-import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.obj.OExpression;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.ISO8601DateParser;
import org.apache.ode.utils.NSContext;
@@ -116,7 +116,7 @@
/**
*
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression,
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.obj.OExpression,
* org.apache.ode.bpel.explang.EvaluationContext)
*/
public String evaluateAsString(OExpression cexp, EvaluationContext ctx)
@@ -126,7 +126,7 @@
/**
*
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression,
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.obj.OExpression,
* org.apache.ode.bpel.explang.EvaluationContext)
*/
public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx)
@@ -152,7 +152,7 @@
/**
*
- * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression,
+ * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.obj.OExpression,
* org.apache.ode.bpel.explang.EvaluationContext)
*/
public List evaluate(OExpression cexp, EvaluationContext ctx)
@@ -230,12 +230,12 @@
List retVal = evaluate(cexp, ctx);
if (retVal.size() == 0) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(),
"No results for expression: " + cexp);
}
if (retVal.size() > 1) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(),
"Multiple results for expression: " + cexp);
}
@@ -259,12 +259,12 @@
XPathConstants.NODESET));
if (literal.size() == 0) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(),
"No results for expression: " + cexp);
}
if (literal.size() > 1) {
- throw new FaultException(cexp.getOwner().constants.qnSelectionFailure,
+ throw new FaultException(cexp.getOwner().getConstants().getQnSelectionFailure(),
"Multiple results for expression: " + cexp);
}
@@ -290,7 +290,7 @@
} catch (Exception ex) {
String errmsg = "Invalid date: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(),
errmsg);
}
}
@@ -315,7 +315,7 @@
} catch (Exception ex) {
String errmsg = "Invalid duration: " + literal;
__log.error(errmsg, ex);
- throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue,
+ throw new FaultException(cexp.getOwner().getConstants().getQnInvalidExpressionValue(),
errmsg);
}
}
@@ -346,7 +346,7 @@
XQStaticContext staticEnv = xqconn.getStaticContext();
- NSContext nsContext = oxquery10.namespaceCtx;
+ NSContext nsContext = oxquery10.getNamespaceCtx();
Set<String> prefixes = nsContext.getPrefixes();
for (String prefix : prefixes) {
String uri = nsContext.getNamespaceURI(prefix);
@@ -357,7 +357,7 @@
xqconn.setStaticContext(staticEnv);
// Prepare expression, for starters
- String xquery = oxquery10.xquery.replaceFirst(
+ String xquery = oxquery10.getXquery().replaceFirst(
Constants.XQUERY_FUNCTION_HANDLER_COMPILER,
Constants.XQUERY_FUNCTION_HANDLER_RUNTIME);
XQPreparedExpression exp = xqconn.prepareExpression(xquery);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
index db2febb..b0473bc 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
@@ -47,9 +47,9 @@
import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
import org.apache.ode.bpel.intercept.ProcessCountThrottler;
import org.apache.ode.bpel.intercept.ProcessSizeThrottler;
-import org.apache.ode.bpel.o.OConstants;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OConstants;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.bpel.runtime.InvalidProcessException;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
@@ -242,7 +242,7 @@
}
{
OPartnerLink plink = (OPartnerLink) process.getOProcess().getChild(mexdao.getPartnerLinkModelId());
- PortType ptype = plink.partnerRolePortType;
+ PortType ptype = plink.getPartnerRolePortType();
Operation op = plink.getPartnerRoleOperation(mexdao.getOperation());
// TODO: recover Partner's EPR
mex = createPartnerRoleMessageExchangeImpl(mexdao, ptype, op, plink, process);
@@ -256,7 +256,7 @@
OPartnerLink plink = (OPartnerLink) child;
// the partner link might not be hydrated
if (plink != null) {
- PortType ptype = plink.myRolePortType;
+ PortType ptype = plink.getMyRolePortType();
Operation op = plink.getMyRoleOperation(mexdao.getOperation());
mex.setPortOp(ptype, op);
}
@@ -770,7 +770,7 @@
return;
}
QName faultQName = null;
- OConstants constants = process.getOProcess().constants;
+ OConstants constants = process.getOProcess().getConstants();
if (constants != null) {
Document document = DOMUtils.newDocument();
Element faultElement = document.createElementNS(Namespaces.SOAP_ENV_NS, "Fault");
@@ -778,15 +778,15 @@
faultElement.appendChild(faultDetail);
switch (causeCode) {
case InvalidProcessException.TOO_MANY_PROCESSES_CAUSE_CODE:
- faultQName = constants.qnTooManyProcesses;
+ faultQName = constants.getQnTooManyProcesses();
faultDetail.setTextContent("The total number of processes in use is over the limit.");
break;
case InvalidProcessException.TOO_HUGE_PROCESSES_CAUSE_CODE:
- faultQName = constants.qnTooHugeProcesses;
+ faultQName = constants.getQnTooHugeProcesses();
faultDetail.setTextContent("The total size of processes in use is over the limit");
break;
case InvalidProcessException.TOO_MANY_INSTANCES_CAUSE_CODE:
- faultQName = constants.qnTooManyInstances;
+ faultQName = constants.getQnTooManyInstances();
faultDetail.setTextContent("No more instances of the process allowed at start at this time.");
break;
case InvalidProcessException.RETIRED_CAUSE_CODE:
@@ -801,12 +801,12 @@
return;
}
}
- faultQName = constants.qnRetiredProcess;
+ faultQName = constants.getQnRetiredProcess();
faultDetail.setTextContent("The process you're trying to instantiate has been retired.");
break;
case InvalidProcessException.DEFAULT_CAUSE_CODE:
default:
- faultQName = constants.qnUnknownFault;
+ faultQName = constants.getQnUnknownFault();
break;
}
MexDaoUtil.setFaulted((MessageExchangeImpl) mex, faultQName, faultElement);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelManagementFacadeImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelManagementFacadeImpl.java
index 51ffcab..2dfa953 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelManagementFacadeImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelManagementFacadeImpl.java
@@ -25,7 +25,7 @@
import org.apache.ode.bpel.dao.*;
import org.apache.ode.bpel.iapi.BpelServer;
import org.apache.ode.bpel.iapi.ProcessStore;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.bpel.pmapi.*;
import org.apache.ode.bpel.pmapi.TInstanceInfo.EventInfo;
import org.apache.ode.bpel.runtime.breaks.ActivityBreakpointImpl;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
index 55da99d..e8d0580 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
@@ -18,18 +18,16 @@
*/
package org.apache.ode.bpel.engine;
+import java.io.File;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
-import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
import javax.wsdl.Fault;
import javax.xml.namespace.QName;
@@ -40,12 +38,9 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.common.ProcessState;
import org.apache.ode.bpel.dao.BpelDAOConnection;
-import org.apache.ode.bpel.dao.DeferredProcessInstanceCleanable;
import org.apache.ode.bpel.dao.MessageExchangeDAO;
import org.apache.ode.bpel.dao.ProcessDAO;
import org.apache.ode.bpel.dao.ProcessInstanceDAO;
-import org.apache.ode.bpel.engine.BpelProcess;
-import org.apache.ode.bpel.engine.MyRoleMessageExchangeImpl;
import org.apache.ode.bpel.engine.extvar.ExternalVariableConf;
import org.apache.ode.bpel.engine.extvar.ExternalVariableManager;
import org.apache.ode.bpel.evt.ProcessInstanceEvent;
@@ -56,23 +51,22 @@
import org.apache.ode.bpel.iapi.EndpointReference;
import org.apache.ode.bpel.iapi.Message;
import org.apache.ode.bpel.iapi.MessageExchange;
+import org.apache.ode.bpel.iapi.MessageExchange.Status;
import org.apache.ode.bpel.iapi.PartnerRoleChannel;
import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.iapi.Scheduler;
-import org.apache.ode.bpel.iapi.MessageExchange.Status;
import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
import org.apache.ode.bpel.iapi.Scheduler.JobType;
import org.apache.ode.bpel.intercept.InstanceCountThrottler;
import org.apache.ode.bpel.intercept.InterceptorInvoker;
import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpressionLanguage;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpressionLanguage;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
import org.apache.ode.bpel.runtime.BpelRuntimeContext;
import org.apache.ode.bpel.runtime.ExpressionLanguageRuntimeRegistry;
import org.apache.ode.bpel.runtime.InvalidProcessException;
@@ -332,7 +326,7 @@
}
}
if (target != null) {
- mex.setPortOp(target._plinkDef.myRolePortType, target._plinkDef.getMyRoleOperation(mex.getOperationName()));
+ mex.setPortOp(target._plinkDef.getMyRolePortType(), target._plinkDef.getMyRoleOperation(mex.getOperationName()));
} else {
__log.warn("Couldn't find endpoint from service " + mex.getServiceName() + " when initializing a myRole mex.");
}
@@ -355,11 +349,11 @@
PropertyAliasEvaluationContext ectx = new PropertyAliasEvaluationContext(msgData, headerParts, alias);
Node lValue = ectx.getRootNode();
- if (alias.location != null) {
+ if (alias.getLocation() != null) {
try {
- lValue = _expLangRuntimeRegistry.evaluateNode(alias.location, ectx);
+ lValue = _expLangRuntimeRegistry.evaluateNode(alias.getLocation(), ectx);
} catch (EvaluationException ec) {
- throw new FaultException(getOProcess().constants.qnSelectionFailure, alias.getDescription());
+ throw new FaultException(getOProcess().getConstants().getQnSelectionFailure(), alias.getDescription());
}
}
@@ -368,7 +362,7 @@
if (__log.isErrorEnabled()) {
__log.error(errmsg);
}
- throw new FaultException(getOProcess().constants.qnSelectionFailure, errmsg);
+ throw new FaultException(getOProcess().getConstants().getQnSelectionFailure(), errmsg);
}
if (lValue.getNodeType() == Node.ELEMENT_NODE) {
@@ -397,7 +391,7 @@
* @return name of element containing said part
*/
static QName getElementNameForPart(OMessageVarType.Part part) {
- return (part.type instanceof OElementVarType) ? ((OElementVarType) part.type).elementType : new QName(null, part.name);
+ return (part.getType() instanceof OElementVarType) ? ((OElementVarType) part.getType()).getElementType() : new QName(null, part.getName());
}
/**
@@ -543,7 +537,7 @@
if (pl.hasPartnerRole()) {
Endpoint endpoint = _pconf.getInvokeEndpoints().get(pl.getName());
- if (endpoint == null && pl.initializePartnerRole)
+ if (endpoint == null && pl.isInitializePartnerRole())
throw new IllegalArgumentException(pl.getName() + " must be bound to an endpoint in deploy.xml");
PartnerLinkPartnerRoleImpl partnerRole = new PartnerLinkPartnerRoleImpl(this, pl, endpoint);
_partnerRoles.put(pl, partnerRole);
@@ -567,10 +561,10 @@
* input stream
* @return process information from configuration database
*/
- private OProcess deserializeCompiledProcess(InputStream is) throws Exception {
+ private OProcess deserializeCompiledProcess(File file) throws Exception {
OProcess compiledProcess;
- Serializer ofh = new Serializer(is);
- compiledProcess = ofh.readOProcess();
+ DeSerializer deserializer = new DeSerializer(file);
+ compiledProcess = deserializer.deserialize();
return compiledProcess;
}
@@ -877,12 +871,8 @@
__log.debug("Rehydrating process " + _pconf.getProcessId());
}
try {
- InputStream inputStream = _pconf.getCBPInputStream();
- try {
- _oprocess = deserializeCompiledProcess(inputStream);
- } finally {
- inputStream.close();
- }
+ File file = _pconf.getCBPFile();
+ _oprocess = deserializeCompiledProcess(file);
} catch (Exception e) {
String errmsg = "The process " + _pid + " is no longer available.";
__log.error(errmsg, e);
@@ -922,7 +912,7 @@
// Null for initializePartnerRole = false
if (prole._initialPartner != null) {
PartnerRoleChannel channel = _engine._contexts.bindingContext.createPartnerRoleChannel(_pid,
- prole._plinkDef.partnerRolePortType, prole._initialPartner);
+ prole._plinkDef.getPartnerRolePortType(), prole._initialPartner);
prole._channel = channel;
_partnerChannels.put(prole._initialPartner, prole._channel);
EndpointReference epr = channel.getInitialEndpointReference();
@@ -960,9 +950,9 @@
createProcessDAO(_engine._contexts.inMemDao.getConnection(), _pid, _pconf.getVersion(), _oprocess);
} else if (_engine._contexts.scheduler.isTransacted()) {
// If we have a transaction, we do this in the current transaction
- if(__log.isDebugEnabled()) __log.debug("Creating new process DAO for " + _pid + " (guid=" + _oprocess.guid + ")...");
+ if(__log.isDebugEnabled()) __log.debug("Creating new process DAO for " + _pid + " (guid=" + _oprocess.getGuid() + ")...");
createProcessDAO(_engine._contexts.dao.getConnection(), _pid, _pconf.getVersion(), _oprocess);
- if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + _pid + " (guid=" + _oprocess.guid + ").");
+ if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + _pid + " (guid=" + _oprocess.getGuid() + ").");
} else {
try {
_engine._contexts.scheduler.execTransaction(new Callable<Object>() {
@@ -981,14 +971,14 @@
}
private void bounceProcessDAOInMemory(BpelDAOConnection conn, final QName pid, final long version, final OProcess oprocess) {
- if(__log.isInfoEnabled()) __log.info("Creating new process DAO[mem] for " + pid + " (guid=" + oprocess.guid + ").");
+ if(__log.isInfoEnabled()) __log.info("Creating new process DAO[mem] for " + pid + " (guid=" + oprocess.getGuid() + ").");
createProcessDAO(conn, pid, version, oprocess);
}
private void bounceProcessDAOInDB(final BpelDAOConnection conn, final QName pid, final long version, final OProcess oprocess) {
- if(__log.isDebugEnabled()) __log.debug("Creating new process DAO for " + pid + " (guid=" + oprocess.guid + ")...");
+ if(__log.isDebugEnabled()) __log.debug("Creating new process DAO for " + pid + " (guid=" + oprocess.getGuid() + ")...");
createProcessDAO(conn, pid, version, oprocess);
- if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + pid + " (guid=" + oprocess.guid + ").");
+ if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + pid + " (guid=" + oprocess.getGuid() + ").");
}
public int getInstanceInUseCount() {
@@ -1003,11 +993,11 @@
if (__log.isDebugEnabled()) {
__log.debug("Found ProcessDAO for " + pid + " with GUID " + old.getGuid());
}
- if (oprocess.guid == null) {
+ if (oprocess.getGuid() == null) {
// No guid, old version assume its good
create = false;
} else {
- if (old.getGuid().equals(oprocess.guid)) {
+ if (old.getGuid().equals(oprocess.getGuid())) {
// Guids match, no need to create
create = false;
}
@@ -1015,13 +1005,13 @@
}
if (create) {
- if(__log.isDebugEnabled()) __log.debug("Creating process DAO for " + pid + " (guid=" + oprocess.guid + ")");
+ if(__log.isDebugEnabled()) __log.debug("Creating process DAO for " + pid + " (guid=" + oprocess.getGuid() + ")");
- ProcessDAO newDao = conn.createProcess(pid, oprocess.getQName(), oprocess.guid, (int) version);
+ ProcessDAO newDao = conn.createProcess(pid, oprocess.getQName(), oprocess.getGuid(), (int) version);
for (String correlator : oprocess.getCorrelators()) {
newDao.addCorrelator(correlator);
}
- if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + pid + " (guid=" + oprocess.guid + ")");
+ if(__log.isDebugEnabled()) __log.debug("Created new process DAO for " + pid + " (guid=" + oprocess.getGuid() + ")");
}
} catch (BpelEngineException ex) {
throw ex;
@@ -1032,11 +1022,11 @@
}
private void registerExprLang(OProcess oprocess) {
- for (OExpressionLanguage elang : oprocess.expressionLanguages) {
+ for (OExpressionLanguage elang : oprocess.getExpressionLanguages()) {
try {
_expLangRuntimeRegistry.registerRuntime(elang);
} catch (ConfigurationException e) {
- String msg = __msgs.msgExpLangRegistrationError(elang.expressionLanguageUri, elang.properties);
+ String msg = __msgs.msgExpLangRegistrationError(elang.getExpressionLanguageUri(), elang.getProperties());
__log.error(msg, e);
throw new BpelEngineException(msg, e);
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
index e73cacd..7ceac7c 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
@@ -75,11 +75,11 @@
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
import org.apache.ode.bpel.iapi.Scheduler.JobType;
import org.apache.ode.bpel.memdao.ProcessInstanceDaoImpl;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.runtime.BpelJacobRunnable;
import org.apache.ode.bpel.runtime.BpelRuntimeContext;
import org.apache.ode.bpel.runtime.CorrelationSetInstance;
@@ -194,7 +194,7 @@
*/
public boolean isCorrelationInitialized(CorrelationSetInstance correlationSet) {
ScopeDAO scopeDAO = _dao.getScope(correlationSet.scopeInstance);
- CorrelationSetDAO cs = scopeDAO.getCorrelationSet(correlationSet.declaration.name);
+ CorrelationSetDAO cs = scopeDAO.getCorrelationSet(correlationSet.declaration.getName());
return cs.getValue() != null;
}
@@ -207,7 +207,7 @@
return false;
}
ScopeDAO scopeDAO = _dao.getScope(var.scopeInstance);
- XmlDataDAO dataDAO = scopeDAO.getVariable(var.declaration.name);
+ XmlDataDAO dataDAO = scopeDAO.getVariable(var.declaration.getName());
return !dataDAO.isNull();
}
@@ -278,7 +278,7 @@
/**
* @see BpelRuntimeContext#createScopeInstance(Long,
- * org.apache.ode.bpel.o.OScope)
+ * org.apache.ode.bpel.obj.OScope)
*/
public Long createScopeInstance(Long parentScopeId, OScope scope) {
if (BpelProcess.__log.isTraceEnabled()) {
@@ -292,7 +292,7 @@
parent = _dao.getScope(parentScopeId);
}
- ScopeDAO scopeDao = _dao.createScope(parent, scope.name, scope.getId());
+ ScopeDAO scopeDao = _dao.createScope(parent, scope.getName(), scope.getId());
return scopeDao.getScopeInstanceId();
}
@@ -305,8 +305,8 @@
ScopeDAO parent = _dao.getScope(parentScopeId);
for (OPartnerLink partnerLink : partnerLinks) {
- PartnerLinkDAO pdao = parent.createPartnerLink(partnerLink.getId(), partnerLink.name,
- partnerLink.myRoleName, partnerLink.partnerRoleName);
+ PartnerLinkDAO pdao = parent.createPartnerLink(partnerLink.getId(), partnerLink.getName(),
+ partnerLink.getMyRoleName(), partnerLink.getPartnerRoleName());
// If there is a myrole on the link, initialize the session id so it
// is always
// available for opaque correlations. The myrole session id should
@@ -350,7 +350,7 @@
// Checking conflicts
int conflict = _imaManager.findConflict(selectors);
if (conflict != -1)
- throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingReceive, selectors[conflict]
+ throw new FaultException(_bpelProcess.getOProcess().getConstants().getQnConflictingReceive(), selectors[conflict]
.toString());
// Check for ambiguous receive
@@ -359,7 +359,7 @@
Selector selector = selectors[i];
if (!correlator.checkRoute(selector.correlationKeySet)) {
- throw new FaultException(_bpelProcess.getOProcess().constants.qnAmbiguousReceive(), selector.toString());
+ throw new FaultException(_bpelProcess.getOProcess().getConstants().qnAmbiguousReceive(), selector.toString());
}
}
@@ -410,7 +410,7 @@
*/
public CorrelationKey readCorrelation(CorrelationSetInstance cset) {
ScopeDAO scopeDAO = _dao.getScope(cset.scopeInstance);
- CorrelationSetDAO cs = scopeDAO.getCorrelationSet(cset.declaration.name);
+ CorrelationSetDAO cs = scopeDAO.getCorrelationSet(cset.declaration.getName());
return cs.getValue();
}
@@ -426,7 +426,7 @@
}
if (epr == null) {
- throw new FaultException(_bpelProcess.getOProcess().constants.qnUninitializedPartnerRole);
+ throw new FaultException(_bpelProcess.getOProcess().getConstants().getQnUninitializedPartnerRole());
}
return epr;
@@ -454,9 +454,9 @@
* in case of selection or other fault
*/
public String readProperty(VariableInstance variable, OProcess.OProperty property) throws FaultException {
- Node varData = readVariable(variable.scopeInstance, variable.declaration.name, false);
+ Node varData = readVariable(variable.scopeInstance, variable.declaration.getName(), false);
- OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.type);
+ OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.getType());
String val = _bpelProcess.extractProperty((Element) varData, Collections.EMPTY_MAP, alias, variable.declaration.getDescription());
if (BpelProcess.__log.isTraceEnabled()) {
@@ -502,7 +502,7 @@
public Node writeVariable(VariableInstance variable, Node changes) {
ScopeDAO scopeDAO = _dao.getScope(variable.scopeInstance);
- XmlDataDAO dataDAO = scopeDAO.getVariable(variable.declaration.name);
+ XmlDataDAO dataDAO = scopeDAO.getVariable(variable.declaration.getName());
dataDAO.set(changes);
writeProperties(variable, changes, dataDAO);
@@ -516,8 +516,8 @@
public void processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String bpelMexId, String odeMexId) throws FaultException {
String mexRef = _imaManager.processOutstandingRequest(partnerLink, opName, bpelMexId, odeMexId);
if (mexRef != null) {
- reply2(partnerLink, opName, bpelMexId, null, _bpelProcess.getOProcess().constants.qnConflictingRequest, false, mexRef);
- throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingRequest);
+ reply2(partnerLink, opName, bpelMexId, null, _bpelProcess.getOProcess().getConstants().getQnConflictingRequest(), false, mexRef);
+ throw new FaultException(_bpelProcess.getOProcess().getConstants().getQnConflictingRequest());
}
}
@@ -534,7 +534,7 @@
ProcessMessageExchangeEvent evt = new ProcessMessageExchangeEvent();
evt.setMexId(mexId);
evt.setOperation(opName);
- evt.setPortType(plinkInstnace.partnerLink.myRolePortType.getQName());
+ evt.setPortType(plinkInstnace.partnerLink.getMyRolePortType().getQName());
MessageExchangeDAO mex = _dao.getConnection().getMessageExchange(mexRef);
@@ -569,15 +569,15 @@
*/
public void writeCorrelation(CorrelationSetInstance cset, CorrelationKey correlation) {
ScopeDAO scopeDAO = _dao.getScope(cset.scopeInstance);
- CorrelationSetDAO cs = scopeDAO.getCorrelationSet(cset.declaration.name);
- QName[] propNames = new QName[cset.declaration.properties.size()];
- for (int m = 0; m < cset.declaration.properties.size(); m++) {
- OProcess.OProperty oProperty = cset.declaration.properties.get(m);
- propNames[m] = oProperty.name;
+ CorrelationSetDAO cs = scopeDAO.getCorrelationSet(cset.declaration.getName());
+ QName[] propNames = new QName[cset.declaration.getProperties().size()];
+ for (int m = 0; m < cset.declaration.getProperties().size(); m++) {
+ OProcess.OProperty oProperty = cset.declaration.getProperties().get(m);
+ propNames[m] = oProperty.getName();
}
cs.setValue(propNames, correlation);
- CorrelationSetWriteEvent cswe = new CorrelationSetWriteEvent(cset.declaration.name, correlation);
+ CorrelationSetWriteEvent cswe = new CorrelationSetWriteEvent(cset.declaration.getName(), correlation);
cswe.setScopeId(cset.scopeInstance);
sendEvent(cswe);
@@ -597,7 +597,7 @@
*/
public void initializeCorrelation(CorrelationSetInstance cset, VariableInstance variable) throws FaultException {
if (BpelProcess.__log.isDebugEnabled()) {
- BpelProcess.__log.debug("Initializing correlation set " + cset.declaration.name);
+ BpelProcess.__log.debug("Initializing correlation set " + cset.declaration.getName());
}
// if correlation set is already initialized, then skip
if (isCorrelationInitialized(cset)) {
@@ -608,16 +608,16 @@
return;
}
- String[] propNames = new String[cset.declaration.properties.size()];
- String[] propValues = new String[cset.declaration.properties.size()];
+ String[] propNames = new String[cset.declaration.getProperties().size()];
+ String[] propValues = new String[cset.declaration.getProperties().size()];
- for (int i = 0; i < cset.declaration.properties.size(); ++i) {
- OProcess.OProperty property = cset.declaration.properties.get(i);
+ for (int i = 0; i < cset.declaration.getProperties().size(); ++i) {
+ OProcess.OProperty property = cset.declaration.getProperties().get(i);
propValues[i] = readProperty(variable, property);
- propNames[i] = property.name.toString();
+ propNames[i] = property.getName().toString();
}
- CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.name, propValues);
+ CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getName(), propValues);
writeCorrelation(cset, ckeyVal);
}
@@ -704,7 +704,7 @@
partnerEpr = _bpelProcess.getInitialPartnerRoleEPR(partnerLink.partnerLink);
// In this case, the partner link has not been initialized.
if (partnerEpr == null)
- throw new FaultException(partnerLink.partnerLink.getOwner().constants.qnUninitializedPartnerRole);
+ throw new FaultException(partnerLink.partnerLink.getOwner().getConstants().getQnUninitializedPartnerRole());
} else {
partnerEpr = _bpelProcess._engine._contexts.eprContext.resolveEndpointReference(partnerEPR);
}
@@ -717,7 +717,7 @@
// prepare event
ProcessMessageExchangeEvent evt = new ProcessMessageExchangeEvent();
evt.setOperation(operation.getName());
- evt.setPortType(partnerLink.partnerLink.partnerRolePortType.getQName());
+ evt.setPortType(partnerLink.partnerLink.getPartnerRolePortType().getQName());
evt.setAspect(ProcessMessageExchangeEvent.PARTNER_INPUT);
MessageExchangeDAO mexDao = _dao.getConnection().createMessageExchange(
@@ -725,7 +725,7 @@
mexDao.setCreateTime(getCurrentEventDateTime());
mexDao.setStatus(MessageExchange.Status.NEW.toString());
mexDao.setOperation(operation.getName());
- mexDao.setPortType(partnerLink.partnerLink.partnerRolePortType.getQName());
+ mexDao.setPortType(partnerLink.partnerLink.getPartnerRolePortType().getQName());
mexDao.setPartnerLinkModelId(partnerLink.partnerLink.getId());
mexDao.setPartnerLink(plinkDAO);
mexDao.setProcess(_dao.getProcess());
@@ -861,7 +861,7 @@
PartnerLinkInstance partnerLink, Operation operation, EndpointReference partnerEpr,
EndpointReference myRoleEndpoint) {
return new PartnerRoleMessageExchangeImpl(getBpelProcess().getEngine(), mexDao,
- partnerLink.partnerLink.partnerRolePortType, operation, partnerEpr, myRoleEndpoint,
+ partnerLink.partnerLink.getPartnerRolePortType(), operation, partnerEpr, myRoleEndpoint,
getBpelProcess().getPartnerRoleChannel(partnerLink.partnerLink));
}
@@ -1116,9 +1116,9 @@
_bpelProcess.saveEvent(event, _dao, scopeNames);
}
- public static String debugInfoToString(org.apache.ode.bpel.o.DebugInfo debugInfo) {
+ public static String debugInfoToString(org.apache.ode.bpel.obj.DebugInfo debugInfo) {
if (debugInfo == null) return "";
- else return " at " + debugInfo.sourceURI + ":" + debugInfo.startLine;
+ else return " at " + debugInfo.getSourceURI() + ":" + debugInfo.getStartLine();
}
/**
@@ -1126,22 +1126,22 @@
* efficient lookup.
*/
private void writeProperties(VariableInstance variable, Node value, XmlDataDAO dao) {
- if (variable.declaration.type instanceof OMessageVarType) {
- for (OProcess.OProperty property : variable.declaration.getOwner().properties) {
- OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.type);
+ if (variable.declaration.getType() instanceof OMessageVarType) {
+ for (OProcess.OProperty property : variable.declaration.getOwner().getProperties()) {
+ OProcess.OPropertyAlias alias = property.getAlias(variable.declaration.getType());
if (alias != null) {
try {
String val = _bpelProcess.extractProperty((Element) value, Collections.EMPTY_MAP, alias, variable.declaration
.getDescription());
if (val != null) {
- dao.setProperty(property.name.toString(), val);
+ dao.setProperty(property.getName().toString(), val);
}
} catch (FaultException e) {
// This will fail as we're basically trying to extract properties on all
// received messages for optimization purposes.
if (__log.isWarnEnabled())
__log.warn("Couldn't extract property '" + property.toString()
- + "' and variable " + variable.declaration + debugInfoToString(variable.declaration.debugInfo) + " in property pre-extraction: " + e.toString());
+ + "' and variable " + variable.declaration + debugInfoToString(variable.declaration.getDebugInfo()) + " in property pre-extraction: " + e.toString());
}
}
}
@@ -1515,7 +1515,7 @@
}
public PartnerRoleConfig getConfigForPartnerLink(OPartnerLink pLink) {
- PartnerRoleConfig c = _bpelProcess.getConf().getPartnerRoleConfig().get(pLink.name);
+ PartnerRoleConfig c = _bpelProcess.getConf().getPartnerRoleConfig().get(pLink.getName());
if (c == null) {
return new PartnerRoleConfig(null, true);
} else {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
index 01ef6eb..2334262 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelServerImpl.java
@@ -59,7 +59,7 @@
import org.apache.ode.bpel.iapi.Scheduler.MapSerializableRunnable;
import org.apache.ode.bpel.iapi.Scheduler.Synchronizer;
import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.utils.msg.MessageBundle;
import org.apache.ode.utils.stl.CollectionsX;
import org.apache.ode.utils.stl.MemberOfFunction;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
index 70e8b64..34031ca 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/DebuggerSupport.java
@@ -35,7 +35,7 @@
import org.apache.ode.bpel.evt.ProcessInstanceStateChangeEvent;
import org.apache.ode.bpel.evt.ProcessTerminationEvent;
import org.apache.ode.bpel.evt.ScopeCompletionEvent;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.bpel.pmapi.BpelManagementFacade;
import org.apache.ode.bpel.pmapi.InstanceNotFoundException;
import org.apache.ode.bpel.pmapi.ManagementException;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
index 8aefca7..ab05ce4 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
@@ -50,10 +50,10 @@
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
import org.apache.ode.bpel.iapi.Scheduler.JobType;
import org.apache.ode.bpel.intercept.InterceptorInvoker;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.InvalidProcessException;
import org.apache.ode.bpel.runtime.PROCESS;
import org.apache.ode.utils.ObjectPrinter;
@@ -78,9 +78,9 @@
public String toString() {
StringBuffer buf = new StringBuffer("{PartnerLinkRole-");
- buf.append(_plinkDef.name);
+ buf.append(_plinkDef.getName());
buf.append('.');
- buf.append(_plinkDef.myRoleName);
+ buf.append(_plinkDef.getMyRoleName());
buf.append(" on ");
buf.append(_endpoint);
buf.append('}');
@@ -203,7 +203,7 @@
.createRuntimeContext(newInstance, new PROCESS(_process.getOProcess()), mex);
// send process instance event
- NewProcessInstanceEvent evt = new NewProcessInstanceEvent(new QName(_process.getOProcess().targetNamespace,
+ NewProcessInstanceEvent evt = new NewProcessInstanceEvent(new QName(_process.getOProcess().getTargetNamespace(),
_process.getOProcess().getName()), _process.getProcessDAO().getProcessId(), newInstance.getInstanceId());
evt.setPortType(mex.getPortType().getQName());
evt.setOperation(operation.getName());
@@ -238,7 +238,7 @@
routing.correlator.removeRoutes(routing.messageRoute.getGroupId(), instanceDao);
// send process instance event
- CorrelationMatchEvent evt = new CorrelationMatchEvent(new QName(process2.getOProcess().targetNamespace,
+ CorrelationMatchEvent evt = new CorrelationMatchEvent(new QName(process2.getOProcess().getTargetNamespace(),
process2.getOProcess().getName()), process2.getProcessDAO().getProcessId(),
instanceDao.getInstanceId(), routing.matchedKeySet);
evt.setPortType(mex.getPortType().getQName());
@@ -278,7 +278,7 @@
.getOperation().getName(), mex.getMessageExchangeId(), routing.wholeKeySet);
evt.setProcessId(_process.getProcessDAO().getProcessId());
- evt.setProcessName(new QName(_process.getOProcess().targetNamespace, _process.getOProcess().getName()));
+ evt.setProcessName(new QName(_process.getOProcess().getTargetNamespace(), _process.getOProcess().getName()));
_process._debugger.onEvent(evt);
mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.QUEUED);
@@ -304,7 +304,7 @@
private void setMexRole(MyRoleMessageExchangeImpl mex) {
Operation operation = getMyRoleOperation(mex.getOperationName());
mex.getDAO().setPartnerLinkModelId(_plinkDef.getId());
- mex.setPortOp(_plinkDef.myRolePortType, operation);
+ mex.setPortOp(_plinkDef.getMyRolePortType(), operation);
mex.setPattern(operation.getOutput() == null ? MessageExchange.MessageExchangePattern.REQUEST_ONLY
: MessageExchange.MessageExchangePattern.REQUEST_RESPONSE);
}
@@ -324,14 +324,14 @@
Set<OScope.CorrelationSet> csets = _plinkDef.getNonInitiatingCorrelationSetsForOperation(operation);
for (OScope.CorrelationSet cset : csets) {
CorrelationKey key = computeCorrelationKey(cset,
- _process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
+ _process.getOProcess().getMessageTypes().get(msgDescription.getQName()), msg, headerParts);
keySet.add(key);
}
csets = _plinkDef.getJoinningCorrelationSetsForOperation(operation);
for (OScope.CorrelationSet cset : csets) {
CorrelationKey key = computeCorrelationKey(cset,
- _process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
+ _process.getOProcess().getMessageTypes().get(msgDescription.getQName()), msg, headerParts);
keySet.add(key);
}
@@ -348,17 +348,17 @@
Element msg, Map<String, Node> headerParts) {
CorrelationKey key = null;
- String[] values = new String[cset.properties.size()];
+ String[] values = new String[cset.getProperties().size()];
int jIdx = 0;
- for (Iterator j = cset.properties.iterator(); j.hasNext(); ++jIdx) {
+ for (Iterator j = cset.getProperties().iterator(); j.hasNext(); ++jIdx) {
OProcess.OProperty property = (OProcess.OProperty) j.next();
OProcess.OPropertyAlias alias = property.getAlias(messagetype);
if (alias == null) {
// TODO: Throw a real exception! And catch this at compile
// time.
- throw new IllegalArgumentException("No alias matching property '" + property.name
+ throw new IllegalArgumentException("No alias matching property '" + property.getName()
+ "' with message type '" + messagetype + "'");
}
@@ -373,10 +373,10 @@
values[jIdx] = value;
}
- if( cset.hasJoinUseCases ) {
- key = new OptionalCorrelationKey(cset.name, values);
+ if( cset.isHasJoinUseCases() ) {
+ key = new OptionalCorrelationKey(cset.getName(), values);
} else {
- key = new CorrelationKey(cset.name, values);
+ key = new CorrelationKey(cset.getName(), values);
}
return key;
@@ -384,7 +384,7 @@
@SuppressWarnings("unchecked")
public boolean isOneWayOnly() {
- PortType portType = _plinkDef.myRolePortType;
+ PortType portType = _plinkDef.getMyRolePortType();
if (portType == null) {
return false;
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
index e1ee584..0508457 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkPartnerRoleImpl.java
@@ -22,7 +22,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.iapi.Endpoint;
import org.apache.ode.bpel.iapi.PartnerRoleChannel;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.obj.OPartnerLink;
/**
* @author Matthieu Riou <mriou at apache dot org>
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java
index 12f865c..99c3f81 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkRoleImpl.java
@@ -19,7 +19,7 @@
package org.apache.ode.bpel.engine;
import org.apache.ode.bpel.iapi.EndpointReference;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.obj.OPartnerLink;
/**
* @author Matthieu Riou <mriou at apache dot org>
@@ -34,7 +34,7 @@
_process = process;
}
String getPartnerLinkName() {
- return _plinkDef.name;
+ return _plinkDef.getName();
}
/**
* Get the initial value of this role's EPR. This value is obtained from
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
index ece7773..dad6a64 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ProcessAndInstanceManagementImpl.java
@@ -87,9 +87,9 @@
import org.apache.ode.bpel.iapi.ProcessState;
import org.apache.ode.bpel.iapi.ProcessStore;
import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.bpel.pmapi.ActivityExtInfoListDocument;
import org.apache.ode.bpel.pmapi.ActivityInfoDocument;
import org.apache.ode.bpel.pmapi.EventInfoListDocument;
@@ -657,8 +657,8 @@
for (int aid : aids) {
OBase obase = oprocess.getChild(aid);
- if (obase != null && obase.debugInfo != null && obase.debugInfo.extensibilityElements != null) {
- for (Map.Entry<QName, Object> entry : obase.debugInfo.extensibilityElements.entrySet()) {
+ if (obase != null && obase.getDebugInfo() != null && obase.getDebugInfo().getExtensibilityElements() != null) {
+ for (Map.Entry<QName, Object> entry : obase.getDebugInfo().getExtensibilityElements().entrySet()) {
TActivityExtInfo taei = taeil.addNewActivityExtInfo();
taei.setAiid("" + aid);
Object extValue = entry.getValue();
@@ -945,7 +945,7 @@
OProcess oprocess = _server._engine.getOProcess(pconf.getProcessId());
if (custom.includeEndpoints() && oprocess != null) {
for (OPartnerLink oplink : oprocess.getAllPartnerLinks()) {
- if (oplink.hasPartnerRole() && oplink.initializePartnerRole) {
+ if (oplink.hasPartnerRole() && oplink.isInitializePartnerRole()) {
// TODO: this is very uncool.
EndpointReference pepr = _server._engine._activeProcesses.get(pconf.getProcessId())
.getInitialPartnerRoleEPR(oplink);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReplacementMapImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReplacementMapImpl.java
index 4453d0f..b50b3fd 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReplacementMapImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/ReplacementMapImpl.java
@@ -18,8 +18,8 @@
*/
package org.apache.ode.bpel.engine;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.jacob.soup.ReplacementMap;
import java.io.Externalizable;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/extvar/ExternalVariableManager.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/extvar/ExternalVariableManager.java
index ea33b41..25cb69c 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/extvar/ExternalVariableManager.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/extvar/ExternalVariableManager.java
@@ -27,11 +27,11 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.engine.BpelProcess;
import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.evar.ExternalVariableModule;
import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evar.ExternalVariableModule.Locator;
@@ -100,14 +100,14 @@
if (!(child instanceof OScope))
continue;
OScope oscope = (OScope) child;
- for (OScope.Variable var : oscope.variables.values()) {
- if (var.extVar == null)
+ for (OScope.Variable var : oscope.getVariables().values()) {
+ if (var.getExtVar() == null)
continue;
- EVar evar = _externalVariables.get(var.extVar.externalVariableId);
+ EVar evar = _externalVariables.get(var.getExtVar().getExternalVariableId());
if (evar == null) {
- __log.error("The \"" + oscope.name + "\" scope declared an unknown external variable \""
- + var.extVar.externalVariableId + "\"; check the deployment descriptor.");
+ __log.error("The \"" + oscope.getName() + "\" scope declared an unknown external variable \""
+ + var.getExtVar().getExternalVariableId() + "\"; check the deployment descriptor.");
fatal = true;
continue;
}
@@ -128,15 +128,15 @@
* Read an external variable.
*/
public Value read(Variable variable, Node reference, Long iid) throws ExternalVariableModuleException{
- EVar evar = _externalVariables.get(variable.extVar.externalVariableId);
+ EVar evar = _externalVariables.get(variable.getExtVar().getExternalVariableId());
if (evar == null) {
// Should not happen if constructor is working.
- throw new BpelEngineException("InternalError: reference to unknown external variable " + variable.extVar.externalVariableId);
+ throw new BpelEngineException("InternalError: reference to unknown external variable " + variable.getExtVar().getExternalVariableId());
}
- Locator locator = new Locator(variable.extVar.externalVariableId, _pid,iid, reference);
+ Locator locator = new Locator(variable.getExtVar().getExternalVariableId(), _pid,iid, reference);
Value newval;
- newval = evar._engine.readValue(((OElementVarType) variable.type).elementType, locator );
+ newval = evar._engine.readValue(((OElementVarType) variable.getType()).getElementType(), locator );
if (newval == null)
return null;
return newval;
@@ -144,15 +144,15 @@
public Value write(Variable variable, Node reference, Node val, Long iid) throws ExternalVariableModuleException {
- EVar evar = _externalVariables.get(variable.extVar.externalVariableId);
+ EVar evar = _externalVariables.get(variable.getExtVar().getExternalVariableId());
if (evar == null) {
// Should not happen if constructor is working.
- throw new BpelEngineException("InternalError: reference to unknown external variable " + variable.extVar.externalVariableId);
+ throw new BpelEngineException("InternalError: reference to unknown external variable " + variable.getExtVar().getExternalVariableId());
}
- Locator locator = new Locator(variable.extVar.externalVariableId,_pid,iid,reference);
+ Locator locator = new Locator(variable.getExtVar().getExternalVariableId(),_pid,iid,reference);
Value newval = new Value(locator,val,null);
- newval = evar._engine.writeValue(((OElementVarType) variable.type).elementType, newval);
+ newval = evar._engine.writeValue(((OElementVarType) variable.getType()).getElementType(), newval);
return newval;
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeyMigration.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeyMigration.java
index e54ca10..d3ca07f 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeyMigration.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeyMigration.java
@@ -24,7 +24,7 @@
import org.apache.ode.bpel.engine.OutstandingRequestManager;
import org.apache.ode.bpel.dao.*;
import org.apache.ode.bpel.common.CorrelationKey;
-import org.apache.ode.bpel.o.*;
+import org.apache.ode.bpel.obj.*;
import org.apache.ode.bpel.runtime.Selector;
import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
import org.apache.commons.logging.Log;
@@ -61,7 +61,7 @@
OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, cset.getProcess().getProcessId());
if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade set " + ckey.toCanonicalString());
else {
- cset.setValue(null, new CorrelationKey(ocset.name, ckey.getValues()));
+ cset.setValue(null, new CorrelationKey(ocset.getName(), ckey.getValues()));
}
}
}
@@ -74,7 +74,7 @@
for (OPartnerLink plink : process.getOProcess().getAllPartnerLinks()) {
if (plink.hasMyRole()) {
- for (Iterator opI = plink.myRolePortType.getOperations().iterator(); opI.hasNext();) {
+ for (Iterator opI = plink.getMyRolePortType().getOperations().iterator(); opI.hasNext();) {
Operation op = (Operation)opI.next();
try {
CorrelatorDAO corr = processDao.getCorrelator(plink.getName() + "." + op.getName());
@@ -88,7 +88,7 @@
OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, process.getConf().getProcessId());
if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade route " + oldKey.toCanonicalString());
else {
- routeDAO.setCorrelationKey(new CorrelationKey(ocset.name, oldKey.getValues()));
+ routeDAO.setCorrelationKey(new CorrelationKey(ocset.getName(), oldKey.getValues()));
}
}
}
@@ -103,7 +103,7 @@
OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, process.getConf().getProcessId());
if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade route " + oldKey.toCanonicalString());
else {
- corrMsgDAO.setCorrelationKey(new CorrelationKey(ocset.name, oldKey.getValues()));
+ corrMsgDAO.setCorrelationKey(new CorrelationKey(ocset.getName(), oldKey.getValues()));
}
}
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
index 8f9174c..33200e3 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetDataMigration.java
@@ -24,7 +24,7 @@
import org.apache.ode.bpel.dao.ProcessDAO;
import org.apache.ode.bpel.dao.CorrelatorDAO;
import org.apache.ode.bpel.dao.MessageRouteDAO;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.obj.OPartnerLink;
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.CorrelationKeySet;
import org.apache.commons.logging.Log;
@@ -47,7 +47,7 @@
for (OPartnerLink plink : process.getOProcess().getAllPartnerLinks()) {
if (plink.hasMyRole()) {
- for (Iterator opI = plink.myRolePortType.getOperations().iterator(); opI.hasNext();) {
+ for (Iterator opI = plink.getMyRolePortType().getOperations().iterator(); opI.hasNext();) {
Operation op = (Operation)opI.next();
CorrelatorDAO corr = processDao.getCorrelator(plink.getName() + "." + op.getName());
// Changing all routes
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetMigration.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetMigration.java
index 2d720bc..7374261 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetMigration.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelationKeySetMigration.java
@@ -28,7 +28,7 @@
import org.apache.ode.bpel.runtime.Selector;
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.CorrelationKeySet;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelatorsMigration.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelatorsMigration.java
index 189c669..6a97632 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelatorsMigration.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/CorrelatorsMigration.java
@@ -23,7 +23,7 @@
import org.apache.ode.bpel.dao.BpelDAOConnection;
import org.apache.ode.bpel.dao.ProcessDAO;
import org.apache.ode.bpel.dao.CorrelatorDAO;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.obj.OPartnerLink;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -45,7 +45,7 @@
for (OPartnerLink plink : process.getOProcess().getAllPartnerLinks()) {
if (plink.hasMyRole()) {
- for (Iterator opI = plink.myRolePortType.getOperations().iterator(); opI.hasNext();) {
+ for (Iterator opI = plink.getMyRolePortType().getOperations().iterator(); opI.hasNext();) {
Operation op = (Operation)opI.next();
try {
CorrelatorDAO corr = processDao.getCorrelator(plink.getId() + "." + op.getName());
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
index 4a335e5..206695d 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
@@ -97,7 +97,7 @@
@Override
public String invoke(int aid, PartnerLinkInstance partnerLink, Operation operation, Element outgoingMessage, InvokeResponse channel) throws FaultException {
__log.debug("invoke");
- AnswerResult answerResult = replayerContext.answers.fetchAnswer(partnerLink.partnerLink.partnerRolePortType.getQName(), operation.getName(), outgoingMessage, getCurrentEventDateTime());
+ AnswerResult answerResult = replayerContext.answers.fetchAnswer(partnerLink.partnerLink.getPartnerRolePortType().getQName(), operation.getName(), outgoingMessage, getCurrentEventDateTime());
if (answerResult.isLive) {
return super.invoke(aid, partnerLink, operation, outgoingMessage, channel);
@@ -108,7 +108,7 @@
mexDao.setCreateTime(new Date(getCurrentEventDateTime().getTime() + 1));
mexDao.setOperation(operation.getName());
- mexDao.setPortType(partnerLink.partnerLink.partnerRolePortType.getQName());
+ mexDao.setPortType(partnerLink.partnerLink.getPartnerRolePortType().getQName());
mexDao.setPartnerLinkModelId(partnerLink.partnerLink.getId());
mexDao.setPartnerLink(plinkDAO);
mexDao.setPattern((operation.getOutput() != null ? MessageExchangePattern.REQUEST_RESPONSE : MessageExchangePattern.REQUEST_ONLY).toString());
@@ -229,7 +229,7 @@
String mexRef = _imaManager.release(plinkInstnace, opName, mexId);
if (mexRef == null) {
- throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest);
+ throw new FaultException(_bpelProcess.getOProcess().getConstants().getQnMissingRequest());
}
MessageExchangeDAO mex = _dao.getConnection().getMessageExchange(mexRef);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
index b770562..0982bef 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
@@ -30,11 +30,11 @@
import org.apache.ode.bpel.evt.ScopeEvent;
import org.apache.ode.bpel.evt.VariableReadEvent;
import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OConstants;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OConstants;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
import org.apache.ode.jacob.IndexedObject;
import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.w3c.dom.Element;
@@ -73,12 +73,12 @@
protected void sendVariableReadEvent(VariableInstance var) {
VariableReadEvent vre = new VariableReadEvent();
- vre.setVarName(var.declaration.name);
+ vre.setVarName(var.declaration.getName());
sendEvent(vre);
}
protected void sendEvent(ActivityEvent event) {
- event.setActivityName(_self.o.name);
+ event.setActivityName(_self.o.getName());
event.setActivityType(_self.o.getType());
event.setActivityDeclarationId(_self.o.getId());
event.setActivityId(_self.aId);
@@ -89,8 +89,8 @@
}
protected void sendEvent(ScopeEvent event) {
- if (event.getLineNo() == -1 && _self.o.debugInfo != null) {
- event.setLineNo(_self.o.debugInfo.startLine);
+ if (event.getLineNo() == -1 && _self.o.getDebugInfo() != null) {
+ event.setLineNo(_self.o.getDebugInfo().getStartLine());
}
_scopeFrame.fillEventInfo(event);
fillEventContext(event);
@@ -112,13 +112,13 @@
protected void dpe(Collection<OLink> links) {
// Dead path all of the outgoing links (nothing has been activated yet!)
for (OLink link : links) {
- if (__log.isDebugEnabled()) __log.debug("DPE on link " + link.name);
+ if (__log.isDebugEnabled()) __log.debug("DPE on link " + link.getName());
_linkFrame.resolve(link).pub.linkStatus(false);
}
}
protected OConstants getConstants() {
- return _self.o.getOwner().constants;
+ return _self.o.getOwner().getConstants();
}
/**
@@ -128,8 +128,8 @@
* @param activity
*/
protected void dpe(OActivity activity) {
- dpe(activity.sourceLinks);
- dpe(activity.outgoingLinks);
+ dpe(activity.getSourceLinks());
+ dpe(activity.getOutgoingLinks());
// TODO: register listeners for target / incoming links
}
@@ -138,8 +138,8 @@
}
private int getLineNo() {
- if (_self.o.debugInfo != null && _self.o.debugInfo.startLine != -1) {
- return _self.o.debugInfo.startLine;
+ if (_self.o.getDebugInfo() != null && _self.o.getDebugInfo().getStartLine() != -1) {
+ return _self.o.getDebugInfo().getStartLine();
}
return -1;
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
index ebe2561..dd2ee74 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
@@ -34,12 +34,12 @@
import org.apache.ode.bpel.evt.ActivityFailureEvent;
import org.apache.ode.bpel.evt.ActivityRecoveryEvent;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OFailureHandling;
-import org.apache.ode.bpel.o.OInvoke;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OFailureHandling;
+import org.apache.ode.bpel.obj.OInvoke;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.ActivityRecovery;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.LinkStatus;
@@ -82,7 +82,7 @@
_firstTime = false;
}
- if (_linkVals.keySet().containsAll(_oactivity.targetLinks)) {
+ if (_linkVals.keySet().containsAll(_oactivity.getTargetLinks())) {
if (evaluateJoinCondition()) {
ActivityExecStartEvent aese = new ActivityExecStartEvent();
sendEvent(aese);
@@ -91,13 +91,13 @@
instance(createActivity(activity));
instance(new TCONDINTERCEPT(activity.parent));
} else {
- if (_oactivity.suppressJoinFailure) {
+ if (_oactivity.isSuppressJoinFailure()) {
_self.parent.completed(null, CompensationHandler.emptySet());
if (__log.isDebugEnabled())
__log.debug("Join condition false, suppress join failure on activity " + _self.aId);
} else {
FaultData fault = null;
- fault = createFault(_oactivity.getOwner().constants.qnJoinFailure,_oactivity);
+ fault = createFault(_oactivity.getOwner().getConstants().getQnJoinFailure(),_oactivity);
_self.parent.completed(fault, CompensationHandler.emptySet());
}
@@ -115,7 +115,7 @@
dpe(_oactivity);
}
}));
- for (final OLink link : _oactivity.targetLinks) {
+ for (final OLink link : _oactivity.getTargetLinks()) {
mlset.or(new ReceiveProcess() {
private static final long serialVersionUID = 1024137371118887935L;
}.setChannel(_linkFrame.resolve(link).sub).setReceiver(new LinkStatus() {
@@ -152,18 +152,18 @@
*/
private boolean evaluateJoinCondition() {
// For activities with no link targets, the join condition is always satisfied.
- if (_oactivity.targetLinks.size() == 0)
+ if (_oactivity.getTargetLinks().size() == 0)
return true;
// For activities with no join condition, an OR condition is assumed.
- if (_oactivity.joinCondition == null)
+ if (_oactivity.getJoinCondition() == null)
return _linkVals.values().contains(Boolean.TRUE);
try {
- return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(_oactivity.joinCondition,
+ return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(_oactivity.getJoinCondition(),
new ExprEvaluationContextImpl(null, null,_linkVals));
} catch (Exception e) {
- String msg = "Unexpected error evaluating a join condition: " + _oactivity.joinCondition;
+ String msg = "Unexpected error evaluating a join condition: " + _oactivity.getJoinCondition();
__log.error(msg,e);
throw new InvalidProcessException(msg,e);
}
@@ -209,21 +209,21 @@
public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
sendEvent(new ActivityExecEndEvent());
if (faultData != null) {
- dpe(_oactivity.sourceLinks);
+ dpe(_oactivity.getSourceLinks());
_self.parent.completed(faultData, compensations);
} else {
FaultData fault = null;
- for (Iterator<OLink> i = _oactivity.sourceLinks.iterator();i.hasNext();) {
+ for (Iterator<OLink> i = _oactivity.getSourceLinks().iterator();i.hasNext();) {
OLink olink = i.next();
LinkInfo linfo = _linkFrame.resolve(olink);
try {
- boolean val = evaluateTransitionCondition(olink.transitionCondition);
+ boolean val = evaluateTransitionCondition(olink.getTransitionCondition());
linfo.pub.linkStatus(val);
} catch (FaultException e) {
linfo.pub.linkStatus(false);
__log.error(e);
if (fault == null)
- fault = createFault(e.getQName(),olink.transitionCondition);
+ fault = createFault(e.getQName(),olink.getTransitionCondition());
}
}
_self.parent.completed(fault, compensations);
@@ -232,8 +232,8 @@
public void cancelled() {
sendEvent(new ActivityExecEndEvent());
- dpe(_oactivity.outgoingLinks);
- dpe(_oactivity.sourceLinks);
+ dpe(_oactivity.getOutgoingLinks());
+ dpe(_oactivity.getSourceLinks());
// Implicit scope can tell the difference between cancelled and completed.
_self.parent.cancelled();
}
@@ -241,7 +241,7 @@
private OFailureHandling getFailureHandling() {
if (_oactivity instanceof OInvoke) {
OInvoke _oinvoke = (OInvoke) _oactivity;
- OFailureHandling f = getBpelRuntimeContext().getConfigForPartnerLink(_oinvoke.partnerLink).failureHandling;
+ OFailureHandling f = getBpelRuntimeContext().getConfigForPartnerLink(_oinvoke.getPartnerLink()).failureHandling;
if (f != null) return f;
}
return _oactivity.getFailureHandling();
@@ -255,7 +255,7 @@
_failure.data = data;
OFailureHandling failureHandling = getFailureHandling();
- if (failureHandling != null && failureHandling.faultOnFailure && _failure.retryCount >= failureHandling.retryFor) {
+ if (failureHandling != null && failureHandling.isFaultOnFailure() && _failure.retryCount >= failureHandling.getRetryFor()) {
//Fault after retries (may be 0)
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Activity " + _self.aId + " faulting on failure");
@@ -263,7 +263,7 @@
completed(faultData, CompensationHandler.emptySet());
return;
}
- if (failureHandling == null || _failure.retryCount >= failureHandling.retryFor) {
+ if (failureHandling == null || _failure.retryCount >= failureHandling.getRetryFor()) {
requireRecovery();
return;
}
@@ -271,7 +271,7 @@
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Retrying activity " + _self.aId);
Date future = new Date(new Date().getTime() +
- (failureHandling == null ? 0L : failureHandling.retryDelay * 1000));
+ (failureHandling == null ? 0L : failureHandling.getRetryDelay() * 1000));
final TimerResponse timerChannel = newChannel(TimerResponse.class);
getBpelRuntimeContext().registerTimer(timerChannel, future);
object(false, new ReceiveProcess() {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
index df923bd..9ed3e4c 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
@@ -26,19 +26,19 @@
import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OAssign;
-import org.apache.ode.bpel.o.OAssign.DirectRef;
-import org.apache.ode.bpel.o.OAssign.LValueExpression;
-import org.apache.ode.bpel.o.OAssign.PropertyRef;
-import org.apache.ode.bpel.o.OAssign.VariableRef;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OAssign;
+import org.apache.ode.bpel.obj.OAssign.DirectRef;
+import org.apache.ode.bpel.obj.OAssign.LValueExpression;
+import org.apache.ode.bpel.obj.OAssign.PropertyRef;
+import org.apache.ode.bpel.obj.OAssign.VariableRef;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.Namespaces;
@@ -82,18 +82,18 @@
FaultData faultData = null;
- for (OAssign.Copy aCopy : oassign.copy) {
+ for (OAssign.Copy aCopy : oassign.getCopy()) {
try {
copy(aCopy);
} catch (FaultException fault) {
- if (aCopy.ignoreMissingFromData) {
- if (fault.getQName().equals(getOAsssign().getOwner().constants.qnSelectionFailure) &&
+ if (aCopy.isIgnoreMissingFromData()) {
+ if (fault.getQName().equals(getOAsssign().getOwner().getConstants().getQnSelectionFailure()) &&
(fault.getCause() != null && "ignoreMissingFromData".equals(fault.getCause().getMessage()))) {
continue;
}
}
- if (aCopy.ignoreUninitializedFromVariable) {
- if (fault.getQName().equals(getOAsssign().getOwner().constants.qnUninitializedVariable) &&
+ if (aCopy.isIgnoreUninitializedFromVariable()) {
+ if (fault.getQName().equals(getOAsssign().getOwner().getConstants().getQnUninitializedVariable()) &&
(fault.getCause() == null || !"throwUninitializedToVariable".equals(fault.getCause().getMessage()))) {
continue;
}
@@ -135,16 +135,16 @@
lvar = _scopeFrame.resolve(to.getVariable());
} catch (RuntimeException e) {
__log.error("iid: " + getBpelRuntimeContext().getPid() + " error evaluating lvalue");
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, e.getMessage());
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSelectionFailure(), e.getMessage());
}
if (lvar == null) {
String msg = __msgs.msgEvalException(to.toString(), "Could not resolve variable in current scope");
if (__log.isDebugEnabled()) __log.debug(to + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
if (!napi.isVariableInitialized(lvar)) {
Document doc = DOMUtils.newDocument();
- Node val = to.getVariable().type.newInstance(doc);
+ Node val = to.getVariable().getType().newInstance(doc);
if (val.getNodeType() == Node.TEXT_NODE) {
Element tempwrapper = doc.createElementNS(null, "temporary-simple-type-wrapper");
doc.appendChild(tempwrapper);
@@ -152,7 +152,7 @@
val = tempwrapper;
} else doc.appendChild(val);
// Only external variables need to be initialized, others are new and going to be overwtitten
- if (lvar.declaration.extVar != null) lval = initializeVariable(lvar, val);
+ if (lvar.declaration.getExtVar() != null) lval = initializeVariable(lvar, val);
else lval = val;
} else
lval = fetchVariableData(lvar, true);
@@ -193,25 +193,25 @@
Node retVal;
if (from instanceof DirectRef) {
OAssign.DirectRef dref = (OAssign.DirectRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(dref.variable));
+ sendVariableReadEvent(_scopeFrame.resolve(dref.getVariable()));
Node data = fetchVariableData(
- _scopeFrame.resolve(dref.variable), false);
- retVal = DOMUtils.findChildByName((Element)data, dref.elName);
+ _scopeFrame.resolve(dref.getVariable()), false);
+ retVal = DOMUtils.findChildByName((Element)data, dref.getElName());
} else if (from instanceof OAssign.VariableRef) {
OAssign.VariableRef varRef = (OAssign.VariableRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(varRef.variable));
- Node data = fetchVariableData(_scopeFrame.resolve(varRef.variable), false);
- retVal = evalQuery(data, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location, getEvaluationContext());
+ sendVariableReadEvent(_scopeFrame.resolve(varRef.getVariable()));
+ Node data = fetchVariableData(_scopeFrame.resolve(varRef.getVariable()), false);
+ retVal = evalQuery(data, varRef.getPart() != null ? varRef.getPart() : varRef.getHeaderPart(), varRef.getLocation(), getEvaluationContext());
} else if (from instanceof OAssign.PropertyRef) {
OAssign.PropertyRef propRef = (OAssign.PropertyRef) from;
- sendVariableReadEvent(_scopeFrame.resolve(propRef.variable));
- Node data = fetchVariableData(_scopeFrame.resolve(propRef.variable), false);
- retVal = evalQuery(data, propRef.propertyAlias.part,
- propRef.propertyAlias.location, getEvaluationContext());
+ sendVariableReadEvent(_scopeFrame.resolve(propRef.getVariable()));
+ Node data = fetchVariableData(_scopeFrame.resolve(propRef.getVariable()), false);
+ retVal = evalQuery(data, propRef.getPropertyAlias().getPart(),
+ propRef.getPropertyAlias().getLocation(), getEvaluationContext());
} else if (from instanceof OAssign.PartnerLinkRef) {
OAssign.PartnerLinkRef pLinkRef = (OAssign.PartnerLinkRef) from;
- PartnerLinkInstance pLink = _scopeFrame.resolve(pLinkRef.partnerLink);
- Node tempVal =pLinkRef.isMyEndpointReference ?
+ PartnerLinkInstance pLink = _scopeFrame.resolve(pLinkRef.getPartnerLink());
+ Node tempVal =pLinkRef.isIsMyEndpointReference() ?
getBpelRuntimeContext().fetchMyRoleEndpointReferenceData(pLink)
: getBpelRuntimeContext().fetchPartnerRoleEndpointReferenceData(pLink);
if (__log.isDebugEnabled())
@@ -220,7 +220,7 @@
retVal = tempVal;
} else if (from instanceof OAssign.Expression) {
List<Node> l;
- OExpression expr = ((OAssign.Expression) from).expression;
+ OExpression expr = ((OAssign.Expression) from).getExpression();
try {
l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr, getEvaluationContext());
if (l.size() == 0 || l.get(0) == null || !(l.get(0) instanceof Element)) {
@@ -243,16 +243,16 @@
String msg = __msgs.msgEvalException(from.toString(), e.getMessage());
if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
if (l.size() == 0) {
String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg, new Throwable("ignoreMissingFromData"));
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg, new Throwable("ignoreMissingFromData"));
} else if (l.size() > 1) {
String msg = __msgs.msgRValueMultipleNodesSelected(expr.toString());
if (__log.isDebugEnabled()) __log.debug(from + ": " + msg);
- throw new FaultException(getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
retVal = (Node) l.get(0);
} else if (from instanceof OAssign.Literal) {
@@ -288,7 +288,7 @@
if (__log.isDebugEnabled())
__log.debug(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(),
msg);
}
@@ -303,7 +303,7 @@
if (__log.isDebugEnabled())
__log.debug(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(),
msg);
}
@@ -317,7 +317,7 @@
if (__log.isDebugEnabled())
__log.debug(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure,
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(),
msg);
}
} else {
@@ -326,7 +326,7 @@
if (__log.isErrorEnabled())
__log.error(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
// Now verify we got something.
@@ -335,7 +335,7 @@
if (__log.isDebugEnabled())
__log.debug(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
// Now check that we got the right thing.
@@ -351,7 +351,7 @@
__log.debug(from + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
@@ -367,23 +367,23 @@
// Check for message to message - copy, we can do this efficiently in
// the database.
- if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+ if ((ocopy.getTo() instanceof VariableRef && ((VariableRef) ocopy.getTo())
.isMessageRef())
- || (ocopy.from instanceof VariableRef && ((VariableRef) ocopy.from)
+ || (ocopy.getFrom() instanceof VariableRef && ((VariableRef) ocopy.getFrom())
.isMessageRef())) {
- if ((ocopy.to instanceof VariableRef && ((VariableRef) ocopy.to)
+ if ((ocopy.getTo() instanceof VariableRef && ((VariableRef) ocopy.getTo())
.isMessageRef())
- && ocopy.from instanceof VariableRef
- && ((VariableRef) ocopy.from).isMessageRef()) {
+ && ocopy.getFrom() instanceof VariableRef
+ && ((VariableRef) ocopy.getFrom()).isMessageRef()) {
- final VariableInstance lval = _scopeFrame.resolve(ocopy.to
+ final VariableInstance lval = _scopeFrame.resolve(ocopy.getTo()
.getVariable());
final VariableInstance rval = _scopeFrame
- .resolve(((VariableRef) ocopy.from).getVariable());
+ .resolve(((VariableRef) ocopy.getFrom()).getVariable());
Element lvalue = (Element) fetchVariableData(rval, false);
initializeVariable(lval, lvalue);
- se = new VariableModificationEvent(lval.declaration.name);
+ se = new VariableModificationEvent(lval.declaration.getName());
((VariableModificationEvent)se).setNewValue(lvalue);
} else {
// This really should have been caught by the compiler.
@@ -391,13 +391,13 @@
.fatal("Message/Non-Message Assignment, should be caught by compiler:"
+ ocopy);
throw new FaultException(
- ocopy.getOwner().constants.qnSelectionFailure,
+ ocopy.getOwner().getConstants().getQnSelectionFailure(),
"Message/Non-Message Assignment: " + ocopy);
}
} else {
// Conventional Assignment logic.
- Node rvalue = evalRValue(ocopy.from);
- Node lvalue = evalLValue(ocopy.to);
+ Node rvalue = evalRValue(ocopy.getFrom());
+ Node lvalue = evalLValue(ocopy.getTo());
if (__log.isDebugEnabled()) {
__log.debug("lvalue after eval " + lvalue);
if (lvalue != null) __log.debug("content " + DOMUtils.domToString(lvalue));
@@ -406,44 +406,44 @@
// Get a pointer within the lvalue.
Node lvaluePtr = lvalue;
boolean headerAssign = false;
- if (ocopy.to instanceof OAssign.DirectRef) {
- DirectRef dref = ((DirectRef) ocopy.to);
- Element el = DOMUtils.findChildByName((Element)lvalue, dref.elName);
+ if (ocopy.getTo() instanceof OAssign.DirectRef) {
+ DirectRef dref = ((DirectRef) ocopy.getTo());
+ Element el = DOMUtils.findChildByName((Element)lvalue, dref.getElName());
if (el == null) {
el = (Element) ((Element)lvalue).appendChild(lvalue.getOwnerDocument()
- .createElementNS(dref.elName.getNamespaceURI(), dref.elName.getLocalPart()));
+ .createElementNS(dref.getElName().getNamespaceURI(), dref.getElName().getLocalPart()));
}
lvaluePtr = el;
- } else if (ocopy.to instanceof OAssign.VariableRef) {
- VariableRef varRef = ((VariableRef) ocopy.to);
- if (varRef.headerPart != null) headerAssign = true;
- lvaluePtr = evalQuery(lvalue, varRef.part != null ? varRef.part : varRef.headerPart, varRef.location,
+ } else if (ocopy.getTo() instanceof OAssign.VariableRef) {
+ VariableRef varRef = ((VariableRef) ocopy.getTo());
+ if (varRef.getHeaderPart() != null) headerAssign = true;
+ lvaluePtr = evalQuery(lvalue, varRef.getPart() != null ? varRef.getPart() : varRef.getHeaderPart(), varRef.getLocation(),
new EvaluationContextProxy(varRef.getVariable(), lvalue));
- } else if (ocopy.to instanceof OAssign.PropertyRef) {
- PropertyRef propRef = ((PropertyRef) ocopy.to);
- lvaluePtr = evalQuery(lvalue, propRef.propertyAlias.part,
- propRef.propertyAlias.location,
+ } else if (ocopy.getTo() instanceof OAssign.PropertyRef) {
+ PropertyRef propRef = ((PropertyRef) ocopy.getTo());
+ lvaluePtr = evalQuery(lvalue, propRef.getPropertyAlias().getPart(),
+ propRef.getPropertyAlias().getLocation(),
new EvaluationContextProxy(propRef.getVariable(),
lvalue));
- } else if (ocopy.to instanceof OAssign.LValueExpression) {
- LValueExpression lexpr = (LValueExpression) ocopy.to;
- lexpr.setInsertMissingToData(ocopy.insertMissingToData);
- lvaluePtr = evalQuery(lvalue, null, lexpr.expression,
+ } else if (ocopy.getTo() instanceof OAssign.LValueExpression) {
+ LValueExpression lexpr = (LValueExpression) ocopy.getTo();
+ lexpr.setInsertMissingToData(ocopy.isInsertMissingToData());
+ lvaluePtr = evalQuery(lvalue, null, lexpr.getExpression(),
new EvaluationContextProxy(lexpr.getVariable(), lvalue));
if (__log.isDebugEnabled())
__log.debug("lvaluePtr expr res " + lvaluePtr);
}
// For partner link assignmenent, the whole content is assigned.
- if (ocopy.to instanceof OAssign.PartnerLinkRef) {
- OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.to);
+ if (ocopy.getTo() instanceof OAssign.PartnerLinkRef) {
+ OAssign.PartnerLinkRef pLinkRef = ((OAssign.PartnerLinkRef) ocopy.getTo());
PartnerLinkInstance plval = _scopeFrame
- .resolve(pLinkRef.partnerLink);
+ .resolve(pLinkRef.getPartnerLink());
replaceEndpointRefence(plval, rvalue);
- se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.to).partnerLink.getName());
+ se = new PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) ocopy.getTo()).getPartnerLink().getName());
} else {
// Sneakily converting the EPR if it's not the format expected by the lvalue
- if (ocopy.from instanceof OAssign.PartnerLinkRef) {
+ if (ocopy.getFrom() instanceof OAssign.PartnerLinkRef) {
rvalue = getBpelRuntimeContext().convertEndpointReference((Element)rvalue, lvaluePtr);
if (rvalue.getNodeType() == Node.DOCUMENT_NODE)
rvalue = ((Document)rvalue).getDocumentElement();
@@ -454,22 +454,22 @@
lvalue = copyInto((Element)lvalue, (Element) lvaluePtr, (Element) rvalue);
} else if (rvalue.getNodeType() == Node.ELEMENT_NODE && lvaluePtr.getNodeType() == Node.ELEMENT_NODE) {
lvalue = replaceElement((Element)lvalue, (Element) lvaluePtr, (Element) rvalue,
- ocopy.keepSrcElementName);
+ ocopy.isKeepSrcElementName());
} else {
lvalue = replaceContent(lvalue, lvaluePtr, rvalue.getTextContent());
}
- final VariableInstance lval = _scopeFrame.resolve(ocopy.to.getVariable());
+ final VariableInstance lval = _scopeFrame.resolve(ocopy.getTo().getVariable());
if (__log.isDebugEnabled())
- __log.debug("ASSIGN Writing variable '" + lval.declaration.name +
+ __log.debug("ASSIGN Writing variable '" + lval.declaration.getName() +
"' value '" + DOMUtils.domToString(lvalue) +"'");
commitChanges(lval, lvalue);
- se = new VariableModificationEvent(lval.declaration.name);
+ se = new VariableModificationEvent(lval.declaration.getName());
((VariableModificationEvent)se).setNewValue(lvalue);
}
}
- if (ocopy.debugInfo != null)
- se.setLineNo(ocopy.debugInfo.startLine);
+ if (ocopy.getDebugInfo() != null)
+ se.setLineNo(ocopy.getDebugInfo().getStartLine());
sendEvent(se);
}
@@ -609,7 +609,7 @@
if (__log.isDebugEnabled())
__log.debug(lvaluePtr + ": " + msg);
throw new FaultException(
- getOAsssign().getOwner().constants.qnSelectionFailure, msg);
+ getOAsssign().getOwner().getConstants().getQnSelectionFailure(), msg);
}
return lvalue;
@@ -620,12 +620,12 @@
assert data != null;
if (part != null) {
- QName partName = new QName(null, part.name);
+ QName partName = new QName(null, part.getName());
Node qualLVal = DOMUtils.findChildByName((Element) data, partName);
- if (part.type instanceof OElementVarType) {
- QName elName = ((OElementVarType) part.type).elementType;
+ if (part.getType() instanceof OElementVarType) {
+ QName elName = ((OElementVarType) part.getType()).getElementType();
qualLVal = DOMUtils.findChildByName((Element) qualLVal, elName);
- } else if (part.type == null) {
+ } else if (part.getType() == null) {
// Special case of header parts never referenced in the WSDL def
if (qualLVal != null && qualLVal.getNodeType() == Node.ELEMENT_NODE
&& ((Element)qualLVal).getAttribute("headerPart") != null
@@ -633,7 +633,7 @@
qualLVal = DOMUtils.getFirstChildElement((Element) qualLVal);
// The needed part isn't there, dynamically creating it
if (qualLVal == null) {
- qualLVal = data.getOwnerDocument().createElementNS(null, part.name);
+ qualLVal = data.getOwnerDocument().createElementNS(null, part.getName());
((Element)qualLVal).setAttribute("headerPart", "true");
data.appendChild(qualLVal);
}
@@ -649,7 +649,7 @@
String msg = __msgs.msgEvalException(expression.toString(), e.getMessage());
if (__log.isDebugEnabled()) __log.debug(expression + ": " + msg);
if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
- throw new FaultException(getOAsssign().getOwner().constants.qnSubLanguageExecutionFault, msg);
+ throw new FaultException(getOAsssign().getOwner().getConstants().getQnSubLanguageExecutionFault(), msg);
}
}
@@ -674,7 +674,7 @@
}
public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException {
- if (variable.name.equals(_var.name)) {
+ if (variable.getName().equals(_var.getName())) {
if (part == null) return _varNode;
return _ctx.getPartData((Element)_varNode, part);
@@ -682,8 +682,8 @@
return _ctx.readVariable(variable, part);
} /**
- * @see org.apache.ode.bpel.explang.EvaluationContext#readMessageProperty(org.apache.ode.bpel.o.OScope.Variable,
- * org.apache.ode.bpel.o.OProcess.OProperty)
+ * @see org.apache.ode.bpel.explang.EvaluationContext#readMessageProperty(org.apache.ode.bpel.obj.OScope.Variable,
+ * org.apache.ode.bpel.obj.OProcess.OProperty)
*/
public String readMessageProperty(Variable variable, OProperty property)
throws FaultException {
@@ -691,7 +691,7 @@
}
/**
- * @see org.apache.ode.bpel.explang.EvaluationContext#isLinkActive(org.apache.ode.bpel.o.OLink)
+ * @see org.apache.ode.bpel.explang.EvaluationContext#isLinkActive(org.apache.ode.bpel.obj.OLink)
*/
public boolean isLinkActive(OLink olink) throws FaultException {
return _ctx.isLinkActive(olink);
@@ -706,7 +706,7 @@
/**
* @see org.apache.ode.bpel.explang.EvaluationContext#evaluateQuery(org.w3c.dom.Node,
- * org.apache.ode.bpel.o.OExpression)
+ * org.apache.ode.bpel.obj.OExpression)
*/
public Node evaluateQuery(Node root, OExpression expr)
throws FaultException {
@@ -715,7 +715,7 @@
return getBpelRuntimeContext().getExpLangRuntime()
.evaluateNode(expr, this);
} catch (org.apache.ode.bpel.explang.EvaluationException e) {
- throw new FaultException(expr.getOwner().constants.qnSubLanguageExecutionFault, e);
+ throw new FaultException(expr.getOwner().getConstants().getQnSubLanguageExecutionFault(), e);
}
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityInfo.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityInfo.java
index a2f0270..d65d7f3 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityInfo.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityInfo.java
@@ -20,7 +20,7 @@
import java.io.Serializable;
-import org.apache.ode.bpel.o.OActivity;
+import org.apache.ode.bpel.obj.OActivity;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityTemplateFactory.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityTemplateFactory.java
index f218a47..1942328 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityTemplateFactory.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ActivityTemplateFactory.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.*;
+import org.apache.ode.bpel.obj.*;
/**
* Factory for creating activity template objects.
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
index c92146a..bf58d75 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
@@ -22,9 +22,9 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OVarType;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.jacob.JacobRunnable;
import org.apache.ode.jacob.vpu.JacobVPU;
@@ -73,7 +73,7 @@
protected void initializeCorrelation(CorrelationSetInstance cset, VariableInstance variable)
throws FaultException {
if (__log.isDebugEnabled()) {
- __log.debug("Initializing correlation set " + cset.declaration.name);
+ __log.debug("Initializing correlation set " + cset.declaration.getName());
}
// if correlation set is already initialized,
// then skip
@@ -86,18 +86,18 @@
return;
}
- String[] propNames = new String[cset.declaration.properties.size()];
- String[] propValues = new String[cset.declaration.properties.size()];
+ String[] propNames = new String[cset.declaration.getProperties().size()];
+ String[] propValues = new String[cset.declaration.getProperties().size()];
- for (int i = 0; i < cset.declaration.properties.size(); ++i) {
- OProcess.OProperty property = cset.declaration.properties.get(i);
+ for (int i = 0; i < cset.declaration.getProperties().size(); ++i) {
+ OProcess.OProperty property = cset.declaration.getProperties().get(i);
propValues[i] = getBpelRuntimeContext().readProperty(variable, property);
- propNames[i] = property.name.toString();
+ propNames[i] = property.getName().toString();
if (__log.isDebugEnabled())
__log.debug("Setting correlation property " + propNames[i] + "=" + propValues[i]);
}
- CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.name, propValues);
+ CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getName(), propValues);
getBpelRuntimeContext().writeCorrelation(cset,ckeyVal);
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
index 188bf20..448af9a 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
@@ -28,10 +28,10 @@
import org.apache.ode.bpel.common.CorrelationKey;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.evt.ProcessInstanceEvent;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.runtime.channels.ActivityRecovery;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.InvokeResponse;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java
index cd85529..8d3f642 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATE.java
@@ -18,8 +18,8 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OCompensate;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OCompensate;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.jacob.ReceiveProcess;
import org.apache.ode.jacob.Synch;
@@ -37,7 +37,7 @@
}
public final void run() {
- OScope scopeToCompensate = _ocompact.compensatedScope;
+ OScope scopeToCompensate = _ocompact.getCompensatedScope();
Synch sc = newChannel(Synch.class);
_self.parent.compensate(scopeToCompensate,sc);
object(new ReceiveProcess() {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java
index 67d6ef3..524f626 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/COMPENSATIONHANDLER_.java
@@ -23,7 +23,7 @@
import org.apache.ode.bpel.evt.CompensationHandlerRegistered;
import org.apache.ode.bpel.evt.ScopeEvent;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.Compensation;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
@@ -58,16 +58,16 @@
public void compensate(final Synch ret) {
// Only scopes with compensation handlers can be compensated.
- assert _self.compensated.oscope.compensationHandler != null;
+ assert _self.compensated.oscope.getCompensationHandler() != null;
ActivityInfo ai = new ActivityInfo(genMonotonic(),
- _self.compensated.oscope.compensationHandler,
+ _self.compensated.oscope.getCompensationHandler(),
newChannel(Termination.class), newChannel(ParentScope.class));
ScopeFrame compHandlerScopeFrame = new ScopeFrame(
- _self.compensated.oscope.compensationHandler,
- getBpelRuntimeContext().createScopeInstance(_self.compensated.scopeInstanceId, _self.compensated.oscope.compensationHandler),
+ _self.compensated.oscope.getCompensationHandler(),
+ getBpelRuntimeContext().createScopeInstance(_self.compensated.scopeInstanceId, _self.compensated.oscope.getCompensationHandler()),
_self.compensated,
_completedChildren);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/CorrelationSetInstance.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/CorrelationSetInstance.java
index 68c0155..946a140 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/CorrelationSetInstance.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/CorrelationSetInstance.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope;
public class CorrelationSetInstance {
public OScope.CorrelationSet declaration;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
index 1f67132..3c5ba32 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
@@ -27,8 +27,8 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OEventHandler;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OEventHandler;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.EventHandlerControl;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
@@ -81,34 +81,34 @@
Calendar alarm = Calendar.getInstance();
- if (_oalarm.forExpr != null)
+ if (_oalarm.getForExpr() != null)
try {
- getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.forExpr, getEvaluationContext()).addTo(alarm);
+ getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.getForExpr(), getEvaluationContext()).addTo(alarm);
} catch (EvaluationException e) {
throw new InvalidProcessException(e);
} catch (FaultException e) {
__log.error(e);
- _psc.completed(createFault(e.getQName(),_oalarm.forExpr), _comps);
+ _psc.completed(createFault(e.getQName(),_oalarm.getForExpr()), _comps);
return;
}
- else if (_oalarm.untilExpr != null)
+ else if (_oalarm.getUntilExpr() != null)
try {
- alarm.setTime(getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(_oalarm.untilExpr, getEvaluationContext()).getTime());
+ alarm.setTime(getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(_oalarm.getUntilExpr(), getEvaluationContext()).getTime());
} catch (EvaluationException e) {
throw new InvalidProcessException(e);
} catch (FaultException e) {
__log.error(e);
- _psc.completed(createFault(e.getQName(),_oalarm.untilExpr), _comps);
+ _psc.completed(createFault(e.getQName(),_oalarm.getUntilExpr()), _comps);
return;
}
- else if (_oalarm.repeatExpr != null)
+ else if (_oalarm.getRepeatExpr() != null)
try {
- getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.repeatExpr, getEvaluationContext()).addTo(alarm);
+ getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.getRepeatExpr(), getEvaluationContext()).addTo(alarm);
} catch (EvaluationException e) {
throw new InvalidProcessException(e);
} catch (FaultException e) {
__log.error(e);
- _psc.completed(createFault(e.getQName(),_oalarm.repeatExpr), _comps);
+ _psc.completed(createFault(e.getQName(),_oalarm.getRepeatExpr()), _comps);
return;
}
@@ -176,7 +176,7 @@
} else /* now is later then alarm time */ {
// If the alarm has passed we fire the nested activity
ActivityInfo child = new ActivityInfo(genMonotonic(),
- _oalarm.activity,
+ _oalarm.getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
instance(createChild(child, _scopeFrame, new LinkFrame(null) ));
instance(new ACTIVE(child));
@@ -193,7 +193,7 @@
public void run() {
// Start the child activity.
ActivityInfo child = new ActivityInfo(genMonotonic(),
- _oalarm.activity,
+ _oalarm.getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
instance(createChild(child, _scopeFrame, new LinkFrame(null) ));
instance(new ACTIVE(child));
@@ -226,15 +226,15 @@
public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
_comps.addAll(compensations);
- if (!_stopped && _oalarm.repeatExpr != null) {
+ if (!_stopped && _oalarm.getRepeatExpr() != null) {
Calendar next = Calendar.getInstance();
try {
- getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.repeatExpr, getEvaluationContext()).addTo(next);
+ getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.getRepeatExpr(), getEvaluationContext()).addTo(next);
} catch (EvaluationException e) {
throw new InvalidProcessException(e);
} catch (FaultException e) {
__log.error(e);
- _psc.completed(createFault(e.getQName(),_oalarm.forExpr), _comps);
+ _psc.completed(createFault(e.getQName(),_oalarm.getForExpr()), _comps);
return;
}
instance(new WAIT(next));
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
index aa0a063..093ab6f 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
@@ -27,8 +27,8 @@
import org.apache.ode.bpel.common.CorrelationKeySet;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.o.OEventHandler;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OEventHandler;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.EventHandlerControl;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
@@ -114,15 +114,15 @@
try {
PickResponse pickResponseChannel = newChannel(PickResponse.class);
CorrelationKeySet keySet = new CorrelationKeySet();
- PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
- for( OScope.CorrelationSet cset : _oevent.joinCorrelations ) {
+ PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.getPartnerLink());
+ for( OScope.CorrelationSet cset : _oevent.getJoinCorrelations() ) {
if(getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
}
}
- for( OScope.CorrelationSet cset : _oevent.matchCorrelations ) {
+ for( OScope.CorrelationSet cset : _oevent.getMatchCorrelations() ) {
if (!getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
- throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized.");
+ throw new FaultException(_oevent.getOwner().getConstants().getQnCorrelationViolation(),"Correlation not initialized.");
}
keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
}
@@ -132,7 +132,7 @@
keySet.add(new CorrelationKey("-1", new String[] {sessionId}));
}
- selector = new Selector(0,pLinkInstance,_oevent.operation.getName(), _oevent.operation.getOutput() == null, _oevent.messageExchangeId, keySet, _oevent.route);
+ selector = new Selector(0,pLinkInstance,_oevent.getOperation().getName(), _oevent.getOperation().getOutput() == null, _oevent.getMessageExchangeId(), keySet, _oevent.getRoute());
getBpelRuntimeContext().select(pickResponseChannel, null, false, new Selector[] { selector} );
instance(new WAITING(pickResponseChannel));
} catch(FaultException e){
@@ -228,19 +228,19 @@
_comps,
_fault);
- if (_oevent.variable != null) {
+ if (_oevent.getVariable() != null) {
Element msgEl = getBpelRuntimeContext().getMyRequest(mexId);
if (msgEl != null) {
try {
- VariableInstance vinst = ehScopeFrame.resolve(_oevent.variable);
+ VariableInstance vinst = ehScopeFrame.resolve(_oevent.getVariable());
getBpelRuntimeContext().writeVariable(vinst, msgEl);
- VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
+ VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.getName());
se.setNewValue(msgEl);
_scopeFrame.fillEventInfo(se);
- if (_oevent.debugInfo != null)
- se.setLineNo(_oevent.debugInfo.startLine);
+ if (_oevent.getDebugInfo() != null)
+ se.setLineNo(_oevent.getDebugInfo().getStartLine());
getBpelRuntimeContext().sendEvent(se);
} catch (Exception ex) {
__log.fatal(ex);
@@ -250,35 +250,35 @@
}
try {
- for (OScope.CorrelationSet cset : _oevent.initCorrelations) {
- initializeCorrelation(ehScopeFrame.resolve(cset), ehScopeFrame.resolve(_oevent.variable));
+ for (OScope.CorrelationSet cset : _oevent.getInitCorrelations()) {
+ initializeCorrelation(ehScopeFrame.resolve(cset), ehScopeFrame.resolve(_oevent.getVariable()));
}
- for( OScope.CorrelationSet cset : _oevent.joinCorrelations ) {
+ for( OScope.CorrelationSet cset : _oevent.getJoinCorrelations() ) {
// will be ignored if already initialized
- initializeCorrelation(ehScopeFrame.resolve(cset), ehScopeFrame.resolve(_oevent.variable));
+ initializeCorrelation(ehScopeFrame.resolve(cset), ehScopeFrame.resolve(_oevent.getVariable()));
}
- if (_oevent.partnerLink.hasPartnerRole()) {
+ if (_oevent.getPartnerLink().hasPartnerRole()) {
// Trying to initialize partner epr based on a message-provided epr/session.
if (!getBpelRuntimeContext().isPartnerRoleEndpointInitialized(ehScopeFrame
- .resolve(_oevent.partnerLink)) || !_oevent.partnerLink.initializePartnerRole) {
+ .resolve(_oevent.getPartnerLink())) || !_oevent.getPartnerLink().isInitializePartnerRole()) {
Node fromEpr = getBpelRuntimeContext().getSourceEPR(mexId);
if (fromEpr != null) {
getBpelRuntimeContext().writeEndpointReference(
- ehScopeFrame.resolve(_oevent.partnerLink), (Element) fromEpr);
+ ehScopeFrame.resolve(_oevent.getPartnerLink()), (Element) fromEpr);
}
}
String partnersSessionId = getBpelRuntimeContext().getSourceSessionId(mexId);
if (partnersSessionId != null)
- getBpelRuntimeContext().initializePartnersSessionId(ehScopeFrame.resolve(_oevent.partnerLink),
+ getBpelRuntimeContext().initializePartnersSessionId(ehScopeFrame.resolve(_oevent.getPartnerLink()),
partnersSessionId);
}
getBpelRuntimeContext().cancelOutstandingRequests(ProcessUtil.exportChannel(_pickResponseChannel));
// this request is now waiting for a reply
- getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(_oevent.partnerLink),
- _oevent.operation.getName(), _oevent.messageExchangeId, mexId);
+ getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(_oevent.getPartnerLink()),
+ _oevent.getOperation().getName(), _oevent.getMessageExchangeId(), mexId);
} catch (FaultException e) {
__log.error(e);
@@ -293,15 +293,15 @@
// load 'onMessage' activity; we'll do this even if a stop/terminate has been
// requested becasue we cannot undo the receipt of the message at this point.
ActivityInfo child = new ActivityInfo(genMonotonic(),
- _oevent.activity,
+ _oevent.getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
_active.add(child);
LinkFrame lf = new LinkFrame(null);
- ScopeFrame innerScopeFrame = new ScopeFrame((OScope) _oevent.activity,
- getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId, (OScope) _oevent.activity),
+ ScopeFrame innerScopeFrame = new ScopeFrame((OScope) _oevent.getActivity(),
+ getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId, (OScope) _oevent.getActivity()),
ehScopeFrame,
_comps,
_fault);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EventContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EventContextImpl.java
index 544a59e..3f34784 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EventContextImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EventContextImpl.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.runtime;
import org.apache.ode.bpel.evt.EventContext;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.DOMUtils;
import org.w3c.dom.Node;
@@ -70,7 +70,7 @@
{
Variable var = __scope.getVisibleVariable(varName);
VariableInstance varInstance = new VariableInstance(__scopeInstanceId, var);
- Node varNode = __runtimeContext.readVariable(varInstance.scopeInstance, varInstance.declaration.name, false);
+ Node varNode = __runtimeContext.readVariable(varInstance.scopeInstance, varInstance.declaration.getName(), false);
value = DOMUtils.domToString(varNode);
}
catch(Throwable e)
@@ -89,10 +89,10 @@
String[] __varNames = null;
try
{
- int varSize = __scope.variables.size();
+ int varSize = __scope.getVariables().size();
__varNames = new String[varSize];
- Iterator<String> _varNames = __scope.variables.keySet().iterator();
+ Iterator<String> _varNames = __scope.getVariables().keySet().iterator();
int i = 0;
while(_varNames.hasNext())
{
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java
index 12c2fe8..51f570b 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java
@@ -31,19 +31,19 @@
import org.apache.ode.bpel.evt.VariableReadEvent;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OConstantVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OConstantVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
/**
* The context in which BPEL expressions are evaluated. This class is handed of
- * the {@link org.apache.ode.bpel.o.OExpression} instances to provide access to
+ * the {@link org.apache.ode.bpel.obj.OExpression} instances to provide access to
* variables, link statuses, and the like.
*/
public class ExprEvaluationContextImpl implements EvaluationContext {
@@ -84,14 +84,14 @@
// TODO: check for null _scopeInstance
Node ret;
- if (variable.type instanceof OConstantVarType) {
- ret = ((OConstantVarType) variable.type).getValue();
+ if (variable.getType() instanceof OConstantVarType) {
+ ret = ((OConstantVarType) variable.getType()).getValue();
} else {
VariableInstance varInstance = _scopeInstance.resolve(variable);
if (varInstance == null)
return null;
VariableReadEvent vre = new VariableReadEvent();
- vre.setVarName(varInstance.declaration.name);
+ vre.setVarName(varInstance.declaration.getName());
sendEvent(vre);
ret = _scopeInstance.fetchVariableData(_native,varInstance, part, false);
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java
index 232bfff..0e6375d 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java
@@ -23,8 +23,8 @@
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OExpressionLanguage;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OExpressionLanguage;
import org.apache.ode.utils.xsd.Duration;
import org.w3c.dom.Node;
@@ -45,12 +45,12 @@
public void registerRuntime(OExpressionLanguage oelang) throws ConfigurationException {
try {
- String className = oelang.properties.get("runtime-class");
+ String className = oelang.getProperties().get("runtime-class");
// backward compatibility.
className = className.replace("com.fs.pxe.","org.apache.ode.");
Class cls = Class.forName(className);
ExpressionLanguageRuntime elangRT = (ExpressionLanguageRuntime) cls.newInstance();
- elangRT.initialize(oelang.properties);
+ elangRT.initialize(oelang.getProperties());
_runtimes.put(oelang, elangRT);
} catch (ConfigurationException ce) {
throw ce;
@@ -93,7 +93,7 @@
}
private ExpressionLanguageRuntime findRuntime(OExpression cexp) {
- return _runtimes.get(cexp.expressionLanguage);
+ return _runtimes.get(cexp.getExpressionLanguage());
}
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
index c5848ad..f9276f7 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
@@ -22,10 +22,10 @@
import java.util.Iterator;
import java.util.Set;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OFlow;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OFlow;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.LinkStatus;
import org.apache.ode.bpel.runtime.channels.ParentScope;
@@ -53,13 +53,13 @@
public void run() {
LinkFrame myLinkFrame = new LinkFrame(_linkFrame);
- for (Iterator<OLink> i = _oflow.localLinks.iterator(); i.hasNext(); ) {
+ for (Iterator<OLink> i = _oflow.getLocalLinks().iterator(); i.hasNext(); ) {
OLink link = i.next();
LinkStatus lsc = newChannel(LinkStatus.class);
myLinkFrame.links.put(link,new LinkInfo(link,lsc,lsc));
}
- for (Iterator<OActivity> i = _oflow.parallelActivities.iterator(); i.hasNext();) {
+ for (Iterator<OActivity> i = _oflow.getParallelActivities().iterator(); i.hasNext();) {
OActivity ochild = i.next();
ChildInfo childInfo = new ChildInfo(
new ActivityInfo(genMonotonic(), ochild,
@@ -128,7 +128,7 @@
}
public String toString() {
- return "<T:Act:Flow:" + _oflow.name + ">";
+ return "<T:Act:Flow:" + _oflow.getName() + ">";
}
private Iterator<ChildInfo> active() {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
index 2627a1c..1d1ab61 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
@@ -29,9 +29,9 @@
import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OForEach;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OForEach;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -67,10 +67,10 @@
public void run() {
try {
- _startCounter = evaluateCondition(_oforEach.startCounterValue);
- _finalCounter = evaluateCondition(_oforEach.finalCounterValue);
- if (_oforEach.completionCondition != null) {
- _completionCounter = evaluateCondition(_oforEach.completionCondition.branchCount);
+ _startCounter = evaluateCondition(_oforEach.getStartCounterValue());
+ _finalCounter = evaluateCondition(_oforEach.getFinalCounterValue());
+ if (_oforEach.getCompletionCondition() != null) {
+ _completionCounter = evaluateCondition(_oforEach.getCompletionCondition().getBranchCount());
}
_currentCounter = _startCounter;
} catch (FaultException fe) {
@@ -83,7 +83,7 @@
// to the maximum number of children
if (_completionCounter > 0 && _completionCounter > _finalCounter - _startCounter) {
_self.parent.completed(
- createFault(_oforEach.getOwner().constants.qnInvalidBranchCondition, _self.o), _compHandlers);
+ createFault(_oforEach.getOwner().getConstants().getQnInvalidBranchCondition(), _self.o), _compHandlers);
return;
}
@@ -92,7 +92,7 @@
_self.parent.completed(null, _compHandlers);
} else {
// If we're parrallel, starting all our child copies, otherwise one will suffice.
- if (_oforEach.parallel) {
+ if (_oforEach.isParallel()) {
for (int m = _startCounter; m <= _finalCounter; m++) {
newChild();
}
@@ -137,7 +137,7 @@
public void completed(FaultData faultData, Set<CompensationHandler> compensations) {
child.completed = true;
//
- if (_completionCounter > 0 && _oforEach.completionCondition.successfulBranchesOnly) {
+ if (_completionCounter > 0 && _oforEach.getCompletionCondition().isSuccessfulBranchesOnly()) {
if (faultData != null) _completedCounter++;
} else _completedCounter++;
@@ -149,7 +149,7 @@
}
if (shouldContinue() && _fault == null && !_terminateRequested) {
// Everything fine. If parrallel, just let our children be, otherwise making a new child
- if (!_oforEach.parallel) newChild();
+ if (!_oforEach.isParallel()) newChild();
} else {
// Work is done or something wrong happened, children shouldn't continue
for (Iterator<ChildInfo> i = active(); i.hasNext(); )
@@ -189,7 +189,7 @@
if (cond < 0) {
String msg = "ForEach counter was negative.";
__log.error(msg);
- throw new FaultException(_oforEach.getOwner().constants.qnInvalidExpressionValue,msg);
+ throw new FaultException(_oforEach.getOwner().getConstants().getQnInvalidExpressionValue(),msg);
}
if (cond > Integer.MAX_VALUE) {
@@ -200,19 +200,19 @@
// support Integer.MAX_VALUE as a maximum instead of Integer.MAX_VALUE * 2 - 1.
String msg = "ForEach counter was too large.";
__log.error(msg);
- throw new FaultException(_oforEach.getOwner().constants.qnInvalidExpressionValue,msg);
+ throw new FaultException(_oforEach.getOwner().getConstants().getQnInvalidExpressionValue(),msg);
}
return cond;
} catch (EvaluationException e) {
String msg = "ForEach counter value couldn't be evaluated as xs:unsignedInt.";
__log.error(msg, e);
- throw new FaultException(_oforEach.getOwner().constants.qnInvalidExpressionValue,msg);
+ throw new FaultException(_oforEach.getOwner().getConstants().getQnInvalidExpressionValue(),msg);
}
}
private void newChild() {
- ChildInfo child = new ChildInfo(new ActivityInfo(genMonotonic(), _oforEach.innerScope,
+ ChildInfo child = new ChildInfo(new ActivityInfo(genMonotonic(), _oforEach.getInnerScope(),
newChannel(Termination.class), newChannel(ParentScope.class)));
_children.add(child);
@@ -223,9 +223,9 @@
// Instantiating the scope directly to keep control of its scope frame, allows
// the introduction of the counter variable in there (monkey business that is).
ScopeFrame newFrame = new ScopeFrame(
- _oforEach.innerScope, getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId,
- _oforEach.innerScope), _scopeFrame, null);
- VariableInstance vinst = newFrame.resolve(_oforEach.counterVariable);
+ _oforEach.getInnerScope(), getBpelRuntimeContext().createScopeInstance(_scopeFrame.scopeInstanceId,
+ _oforEach.getInnerScope()), _scopeFrame, null);
+ VariableInstance vinst = newFrame.resolve(_oforEach.getCounterVariable());
try {
initializeVariable(vinst, counterNode);
@@ -236,17 +236,17 @@
}
// Generating event
- VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
+ VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.getName());
se.setNewValue(counterNode);
- if (_oforEach.debugInfo != null)
- se.setLineNo(_oforEach.debugInfo.startLine);
+ if (_oforEach.getDebugInfo() != null)
+ se.setLineNo(_oforEach.getDebugInfo().getStartLine());
sendEvent(se);
instance(new SCOPE(child.activity, newFrame, _linkFrame));
}
public String toString() {
- return "<T:Act:Flow:" + _oforEach.name + ">";
+ return "<T:Act:Flow:" + _oforEach.getName() + ">";
}
private Iterator<ChildInfo> active() {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
index 1a9d0a9..c7398e3 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
@@ -28,8 +28,8 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.o.OInvoke;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OInvoke;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.InvokeResponse;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -67,7 +67,7 @@
public final void run() {
Element outboundMsg;
try {
- outboundMsg = setupOutbound(_oinvoke, _oinvoke.initCorrelationsInput, _oinvoke.joinCorrelationsInput);
+ outboundMsg = setupOutbound(_oinvoke, _oinvoke.getInitCorrelationsInput(), _oinvoke.getJoinCorrelationsInput());
} catch (FaultException e) {
__log.error(e);
FaultData fault = createFault(e.getQName(), _oinvoke);
@@ -81,22 +81,22 @@
++_invoked;
// if there is no output variable, then this is a one-way invoke
- boolean isTwoWay = _oinvoke.outputVar != null;
+ boolean isTwoWay = _oinvoke.getOutputVar() != null;
try {
if (!isTwoWay) {
FaultData faultData = null;
getBpelRuntimeContext().invoke(_oinvoke.getId(),
- _scopeFrame.resolve(_oinvoke.partnerLink),
- _oinvoke.operation, outboundMsg, null);
+ _scopeFrame.resolve(_oinvoke.getPartnerLink()),
+ _oinvoke.getOperation(), outboundMsg, null);
_self.parent.completed(faultData, CompensationHandler.emptySet());
} else /* two-way */{
- final VariableInstance outputVar = _scopeFrame.resolve(_oinvoke.outputVar);
+ final VariableInstance outputVar = _scopeFrame.resolve(_oinvoke.getOutputVar());
InvokeResponse invokeResponseChannel = newChannel(InvokeResponse.class);
final String mexId = getBpelRuntimeContext().invoke(_oinvoke.getId(),
- _scopeFrame.resolve(_oinvoke.partnerLink), _oinvoke.operation,
+ _scopeFrame.resolve(_oinvoke.getPartnerLink()), _oinvoke.getOperation(),
outboundMsg, invokeResponseChannel);
object(false, compose(new ReceiveProcess() {
@@ -124,35 +124,35 @@
}
// Generating event
- VariableModificationEvent se = new VariableModificationEvent(outputVar.declaration.name);
+ VariableModificationEvent se = new VariableModificationEvent(outputVar.declaration.getName());
se.setNewValue(response);
- if (_oinvoke.debugInfo != null)
- se.setLineNo(_oinvoke.debugInfo.startLine);
+ if (_oinvoke.getDebugInfo() != null)
+ se.setLineNo(_oinvoke.getDebugInfo().getStartLine());
sendEvent(se);
try {
- for (OScope.CorrelationSet anInitCorrelationsOutput : _oinvoke.initCorrelationsOutput) {
+ for (OScope.CorrelationSet anInitCorrelationsOutput : _oinvoke.getInitCorrelationsOutput()) {
initializeCorrelation(_scopeFrame.resolve(anInitCorrelationsOutput), outputVar);
}
- for (OScope.CorrelationSet aJoinCorrelationsOutput : _oinvoke.joinCorrelationsOutput) {
+ for (OScope.CorrelationSet aJoinCorrelationsOutput : _oinvoke.getJoinCorrelationsOutput()) {
// will be ignored if already initialized
initializeCorrelation(_scopeFrame.resolve(aJoinCorrelationsOutput), outputVar);
}
- if (_oinvoke.partnerLink.hasPartnerRole()) {
+ if (_oinvoke.getPartnerLink().hasPartnerRole()) {
// Trying to initialize partner epr based on a message-provided epr/session.
if (!getBpelRuntimeContext().isPartnerRoleEndpointInitialized(_scopeFrame
- .resolve(_oinvoke.partnerLink)) || !_oinvoke.partnerLink.initializePartnerRole) {
+ .resolve(_oinvoke.getPartnerLink())) || !_oinvoke.getPartnerLink().isInitializePartnerRole()) {
Node fromEpr = getBpelRuntimeContext().getSourceEPR(mexId);
if (fromEpr != null) {
getBpelRuntimeContext().writeEndpointReference(
- _scopeFrame.resolve(_oinvoke.partnerLink), (Element) fromEpr);
+ _scopeFrame.resolve(_oinvoke.getPartnerLink()), (Element) fromEpr);
}
}
String partnersSessionId = getBpelRuntimeContext().getSourceSessionId(mexId);
if (partnersSessionId != null)
- getBpelRuntimeContext().initializePartnersSessionId(_scopeFrame.resolve(_oinvoke.partnerLink),
+ getBpelRuntimeContext().initializePartnersSessionId(_scopeFrame.resolve(_oinvoke.getPartnerLink()),
partnersSessionId);
}
@@ -171,7 +171,7 @@
Element msg = getBpelRuntimeContext().getPartnerResponse(mexId);
QName msgType = getBpelRuntimeContext().getPartnerResponseType(mexId);
FaultData fault = createFault(faultName, msg,
- _oinvoke.getOwner().messageTypes.get(msgType), _self.o);
+ _oinvoke.getOwner().getMessageTypes().get(msgType), _self.o);
_self.parent.completed(fault, CompensationHandler.emptySet());
getBpelRuntimeContext().releasePartnerMex(mexId, false);
}
@@ -211,16 +211,16 @@
private Element setupOutbound(OInvoke oinvoke, Collection<OScope.CorrelationSet> outboundInitiations, Collection<OScope.CorrelationSet> outboundJoins)
throws FaultException, ExternalVariableModuleException {
for (OScope.CorrelationSet c : outboundInitiations) {
- initializeCorrelation(_scopeFrame.resolve(c), _scopeFrame.resolve(oinvoke.inputVar));
+ initializeCorrelation(_scopeFrame.resolve(c), _scopeFrame.resolve(oinvoke.getInputVar()));
}
for (OScope.CorrelationSet c : outboundJoins) {
// will be ignored if already initialized
- initializeCorrelation(_scopeFrame.resolve(c), _scopeFrame.resolve(oinvoke.inputVar));
+ initializeCorrelation(_scopeFrame.resolve(c), _scopeFrame.resolve(oinvoke.getInputVar()));
}
- if ((oinvoke.operation.getInput() != null) && (oinvoke.operation.getInput().getMessage().getParts().size() > 0)) {
- sendVariableReadEvent(_scopeFrame.resolve(oinvoke.inputVar));
- Node outboundMsg = fetchVariableData(_scopeFrame.resolve(oinvoke.inputVar), false);
+ if ((oinvoke.getOperation().getInput() != null) && (oinvoke.getOperation().getInput().getMessage().getParts().size() > 0)) {
+ sendVariableReadEvent(_scopeFrame.resolve(oinvoke.getInputVar()));
+ Node outboundMsg = fetchVariableData(_scopeFrame.resolve(oinvoke.getInputVar()), false);
// TODO outbound message should be updated with non-initiate correlation sets
assert outboundMsg instanceof Element;
return (Element) outboundMsg;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/InstanceGlobals.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/InstanceGlobals.java
index 34215c0..8c2d5a0 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/InstanceGlobals.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/InstanceGlobals.java
@@ -22,7 +22,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.ReadWriteLock;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java
index 5a29315..ebf55f5 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.obj.OLink;
import java.io.Serializable;
import java.util.HashMap;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java
index fec40d6..f903592 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java
@@ -20,7 +20,7 @@
import java.io.Serializable;
-import org.apache.ode.bpel.o.OLink;
+import org.apache.ode.bpel.obj.OLink;
import org.apache.ode.bpel.runtime.channels.LinkStatus;
/**
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
index 714bf8d..90a777a 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
@@ -35,11 +35,11 @@
import org.apache.ode.bpel.evt.VariableModificationEvent;
import org.apache.ode.bpel.explang.EvaluationException;
import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OPickReceive;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OPickReceive;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.PickResponse;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -81,41 +81,41 @@
Selector[] selectors;
try {
- selectors = new Selector[_opick.onMessages.size()];
+ selectors = new Selector[_opick.getOnMessages().size()];
int idx = 0;
- for (OPickReceive.OnMessage onMessage : _opick.onMessages) {
+ for (OPickReceive.OnMessage onMessage : _opick.getOnMessages()) {
// collect all initiated correlations
Set<OScope.CorrelationSet> matchCorrelations = new HashSet<OScope.CorrelationSet>();
- matchCorrelations.addAll(onMessage.matchCorrelations);
- for( OScope.CorrelationSet cset : onMessage.joinCorrelations ) {
+ matchCorrelations.addAll(onMessage.getMatchCorrelations());
+ for( OScope.CorrelationSet cset : onMessage.getJoinCorrelations() ) {
if(getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
matchCorrelations.add(cset);
}
}
- PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(onMessage.partnerLink);
+ PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(onMessage.getPartnerLink());
CorrelationKeySet keySet = resolveCorrelationKey(pLinkInstance, matchCorrelations);
- selectors[idx] = new Selector(idx, pLinkInstance, onMessage.operation.getName(), onMessage.operation
- .getOutput() == null, onMessage.messageExchangeId, keySet, onMessage.route);
+ selectors[idx] = new Selector(idx, pLinkInstance, onMessage.getOperation().getName(), onMessage.getOperation()
+ .getOutput() == null, onMessage.getMessageExchangeId(), keySet, onMessage.getRoute());
idx++;
}
timeout = null;
- for (OPickReceive.OnAlarm onAlarm : _opick.onAlarms) {
- Date dt = onAlarm.forExpr != null ? offsetFromNow(getBpelRuntimeContext().getExpLangRuntime()
- .evaluateAsDuration(onAlarm.forExpr, getEvaluationContext())) : getBpelRuntimeContext()
- .getExpLangRuntime().evaluateAsDate(onAlarm.untilExpr, getEvaluationContext()).getTime();
+ for (OPickReceive.OnAlarm onAlarm : _opick.getOnAlarms()) {
+ Date dt = onAlarm.getForExpr() != null ? offsetFromNow(getBpelRuntimeContext().getExpLangRuntime()
+ .evaluateAsDuration(onAlarm.getForExpr(), getEvaluationContext())) : getBpelRuntimeContext()
+ .getExpLangRuntime().evaluateAsDate(onAlarm.getUntilExpr(), getEvaluationContext()).getTime();
if (timeout == null || timeout.compareTo(dt) > 0) {
timeout = dt;
_alarm = onAlarm;
}
}
- getBpelRuntimeContext().select(pickResponseChannel, timeout, _opick.createInstanceFlag, selectors);
+ getBpelRuntimeContext().select(pickResponseChannel, timeout, _opick.isCreateInstanceFlag(), selectors);
} catch (FaultException e) {
__log.error(e);
FaultData fault = createFault(e.getQName(), _opick, e.getMessage());
- dpe(_opick.outgoingLinks);
+ dpe(_opick.getOutgoingLinks());
_self.parent.completed(fault, CompensationHandler.emptySet());
return;
} catch (EvaluationException e) {
@@ -125,9 +125,9 @@
}
// Dead path all the alarms that have no chace of coming first.
- for (OPickReceive.OnAlarm oa : _opick.onAlarms) {
+ for (OPickReceive.OnAlarm oa : _opick.getOnAlarms()) {
if (!oa.equals(_alarm)) {
- dpe(oa.activity);
+ dpe(oa.getActivity());
}
}
@@ -146,7 +146,7 @@
private CorrelationKeySet resolveCorrelationKey(PartnerLinkInstance pLinkInstance, Set<OScope.CorrelationSet> matchCorrelations) throws FaultException {
CorrelationKeySet keySet = new CorrelationKeySet(); // is empty for the case of the createInstance activity
- if (matchCorrelations.isEmpty() && !_opick.createInstanceFlag) {
+ if (matchCorrelations.isEmpty() && !_opick.isCreateInstanceFlag()) {
// Adding a route for opaque correlation. In this case,
// correlation is on "out-of-band" session-id
String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
@@ -157,8 +157,8 @@
if(!getBpelRuntimeContext().isCorrelationInitialized(
_scopeFrame.resolve(cset))) {
- if (!_opick.createInstanceFlag) {
- throw new FaultException(_opick.getOwner().constants.qnCorrelationViolation,
+ if (!_opick.isCreateInstanceFlag()) {
+ throw new FaultException(_opick.getOwner().getConstants().getQnCorrelationViolation(),
"Correlation not initialized.");
}
} else {
@@ -191,7 +191,7 @@
@SuppressWarnings("unchecked")
private void initVariable(String mexId, OPickReceive.OnMessage onMessage) {
// This is allowed, if there is no parts in the message for example.
- if (onMessage.variable == null) return;
+ if (onMessage.getVariable() == null) return;
Element msgEl;
try {
@@ -205,26 +205,26 @@
return;
}
- Collection<String> partNames = (Collection<String>) onMessage.operation.getInput().getMessage().getParts().keySet();
+ Collection<String> partNames = (Collection<String>) onMessage.getOperation().getInput().getMessage().getParts().keySet();
// Let's do some sanity checks here so that we don't get weird errors in assignment later.
// The engine should have checked to make sure that the messages that are delivered conform
// to the correct format; but you know what they say, don't trust anyone.
- if (!(onMessage.variable.type instanceof OMessageVarType)) {
+ if (!(onMessage.getVariable().getType() instanceof OMessageVarType)) {
String errmsg = "Non-message variable for receive: should have been picked up by static analysis.";
__log.fatal(errmsg);
throw new InvalidProcessException(errmsg);
}
- OMessageVarType vartype = (OMessageVarType) onMessage.variable.type;
+ OMessageVarType vartype = (OMessageVarType) onMessage.getVariable().getType();
// Check that each part contains what we expect.
for (String pName : partNames) {
QName partName = new QName(null, pName);
Element msgPart = DOMUtils.findChildByName(msgEl, partName);
- Part part = vartype.parts.get(pName);
+ Part part = vartype.getParts().get(pName);
if (part == null) {
- String errmsg = "Inconsistent WSDL, part " + pName + " not found in message type " + vartype.messageType;
+ String errmsg = "Inconsistent WSDL, part " + pName + " not found in message type " + vartype.getMessageType();
__log.fatal(errmsg);
throw new InvalidProcessException(errmsg);
}
@@ -234,8 +234,8 @@
throw new InvalidContextException(errmsg);
}
- if (part.type instanceof OElementVarType) {
- OElementVarType ptype = (OElementVarType) part.type;
+ if (part.getType() instanceof OElementVarType) {
+ OElementVarType ptype = (OElementVarType) part.getType();
Element e = DOMUtils.getFirstChildElement(msgPart);
if (e == null) {
String errmsg = "Message (element) part " + pName + " did not contain child element.";
@@ -244,9 +244,9 @@
}
QName qn = new QName(e.getNamespaceURI(), e.getLocalName());
- if(!qn.equals(ptype.elementType)) {
+ if(!qn.equals(ptype.getElementType())) {
String errmsg = "Message (element) part " + pName + " did not contain correct child element: expected "
- + ptype.elementType + " but got " + qn;
+ + ptype.getElementType() + " but got " + qn;
__log.fatal(errmsg);
throw new InvalidContextException(errmsg);
}
@@ -254,7 +254,7 @@
}
- VariableInstance vinst = _scopeFrame.resolve(onMessage.variable);
+ VariableInstance vinst = _scopeFrame.resolve(onMessage.getVariable());
try {
initializeVariable(vinst, msgEl);
@@ -265,10 +265,10 @@
}
// Generating event
- VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
+ VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.getName());
se.setNewValue(msgEl);
- if (_opick.debugInfo != null)
- se.setLineNo(_opick.debugInfo.startLine);
+ if (_opick.getDebugInfo() != null)
+ se.setLineNo(_opick.getDebugInfo().getStartLine());
sendEvent(se);
}
@@ -286,18 +286,18 @@
private static final long serialVersionUID = -8237296827418738011L;
}.setChannel(_pickResponseChannel).setReceiver(new PickResponse() {
public void onRequestRcvd(int selectorIdx, String mexId) {
- OPickReceive.OnMessage onMessage = _opick.onMessages.get(selectorIdx);
+ OPickReceive.OnMessage onMessage = _opick.getOnMessages().get(selectorIdx);
// dead path the non-selected onMessage blocks.
- for (OPickReceive.OnMessage onmsg : _opick.onMessages) {
+ for (OPickReceive.OnMessage onmsg : _opick.getOnMessages()) {
if (!onmsg.equals(onMessage)) {
- dpe(onmsg.activity);
+ dpe(onmsg.getActivity());
}
}
// dead-path the alarm (if any)
if (_alarm != null) {
- dpe(_alarm.activity);
+ dpe(_alarm.getActivity());
}
getBpelRuntimeContext().cancelOutstandingRequests(ProcessUtil.exportChannel(_pickResponseChannel));
@@ -305,47 +305,47 @@
FaultData fault;
initVariable(mexId, onMessage);
try {
- VariableInstance vinst = _scopeFrame.resolve(onMessage.variable);
- for (OScope.CorrelationSet cset : onMessage.initCorrelations) {
+ VariableInstance vinst = _scopeFrame.resolve(onMessage.getVariable());
+ for (OScope.CorrelationSet cset : onMessage.getInitCorrelations()) {
initializeCorrelation(_scopeFrame.resolve(cset), vinst);
}
- for( OScope.CorrelationSet cset : onMessage.joinCorrelations ) {
+ for( OScope.CorrelationSet cset : onMessage.getJoinCorrelations() ) {
// will be ignored if already initialized
initializeCorrelation(_scopeFrame.resolve(cset), vinst);
}
- if (onMessage.partnerLink.hasPartnerRole()) {
+ if (onMessage.getPartnerLink().hasPartnerRole()) {
// Trying to initialize partner epr based on a
// message-provided epr/session.
if (!getBpelRuntimeContext().isPartnerRoleEndpointInitialized(
- _scopeFrame.resolve(onMessage.partnerLink))
- || !onMessage.partnerLink.initializePartnerRole) {
+ _scopeFrame.resolve(onMessage.getPartnerLink()))
+ || !onMessage.getPartnerLink().isInitializePartnerRole()) {
Node fromEpr = getBpelRuntimeContext().getSourceEPR(mexId);
if (fromEpr != null) {
if (__log.isDebugEnabled())
__log.debug("Received callback EPR " + DOMUtils.domToString(fromEpr)
- + " saving it on partner link " + onMessage.partnerLink.getName());
+ + " saving it on partner link " + onMessage.getPartnerLink().getName());
getBpelRuntimeContext().writeEndpointReference(
- _scopeFrame.resolve(onMessage.partnerLink), (Element) fromEpr);
+ _scopeFrame.resolve(onMessage.getPartnerLink()), (Element) fromEpr);
}
}
String partnersSessionId = getBpelRuntimeContext().getSourceSessionId(mexId);
if (partnersSessionId != null)
getBpelRuntimeContext().initializePartnersSessionId(
- _scopeFrame.resolve(onMessage.partnerLink), partnersSessionId);
+ _scopeFrame.resolve(onMessage.getPartnerLink()), partnersSessionId);
}
// this request is now waiting for a reply
- getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(onMessage.partnerLink),
- onMessage.operation.getName(), onMessage.messageExchangeId, mexId);
+ getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(onMessage.getPartnerLink()),
+ onMessage.getOperation().getName(), onMessage.getMessageExchangeId(), mexId);
} catch (FaultException e) {
__log.error(e);
fault = createFault(e.getQName(), onMessage);
_self.parent.completed(fault, CompensationHandler.emptySet());
- dpe(onMessage.activity);
+ dpe(onMessage.getActivity());
return;
}
@@ -354,21 +354,21 @@
// Because we are done with all the DPE, we can simply
// re-use our control
// channels for the child.
- ActivityInfo child = new ActivityInfo(genMonotonic(), onMessage.activity, _self.self, _self.parent);
+ ActivityInfo child = new ActivityInfo(genMonotonic(), onMessage.getActivity(), _self.self, _self.parent);
instance(createChild(child, _scopeFrame, _linkFrame));
}
public void onTimeout() {
// Dead path all the onMessage activiites (the other alarms
// have already been DPE'ed)
- for (OPickReceive.OnMessage onMessage : _opick.onMessages) {
- dpe(onMessage.activity);
+ for (OPickReceive.OnMessage onMessage : _opick.getOnMessages()) {
+ dpe(onMessage.getActivity());
}
// Because we are done with all the DPE, we can simply
// re-use our control
// channels for the child.
- ActivityInfo child = new ActivityInfo(genMonotonic(), _alarm.activity, _self.self, _self.parent);
+ ActivityInfo child = new ActivityInfo(genMonotonic(), _alarm.getActivity(), _self.self, _self.parent);
instance(createChild(child, _scopeFrame, _linkFrame));
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java
index ad74e34..fec12e7 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PROCESS.java
@@ -21,11 +21,11 @@
import java.util.Set;
import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OFailureHandling;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OFailureHandling;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.ReadWriteLock;
@@ -45,18 +45,18 @@
public void run() {
BpelRuntimeContext ntive = getBpelRuntimeContext();
- Long scopeInstanceId = ntive.createScopeInstance(null, _oprocess.procesScope);
+ Long scopeInstanceId = ntive.createScopeInstance(null, _oprocess.getProcesScope());
createGlobals();
ProcessInstanceStartedEvent evt = new ProcessInstanceStartedEvent();
evt.setRootScopeId(scopeInstanceId);
- evt.setScopeDeclarationId(_oprocess.procesScope.getId());
+ evt.setScopeDeclarationId(_oprocess.getProcesScope().getId());
ntive.sendEvent(evt);
ActivityInfo child = new ActivityInfo(genMonotonic(),
- _oprocess.procesScope,
+ _oprocess.getProcesScope(),
newChannel(Termination.class), newChannel(ParentScope.class));
- ScopeFrame processFrame = new ScopeFrame(_oprocess.procesScope, scopeInstanceId, null, null,_globals);
+ ScopeFrame processFrame = new ScopeFrame(_oprocess.getProcesScope(), scopeInstanceId, null, null,_globals);
instance(new SCOPE(child, processFrame, new LinkFrame(null)));
object(new ReceiveProcess() {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PartnerLinkInstance.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PartnerLinkInstance.java
index f42e099..a79df96 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PartnerLinkInstance.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PartnerLinkInstance.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OPartnerLink;
+import org.apache.ode.bpel.obj.OPartnerLink;
import org.apache.ode.utils.ObjectPrinter;
import java.io.Serializable;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
index 552996c..c40b07b 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
@@ -28,13 +28,13 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.engine.BpelRuntimeContextImpl;
import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.utils.DOMUtils;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -51,15 +51,15 @@
public PropertyAliasEvaluationContext(Element msgData, Map<String, Node> headerParts, OProcess.OPropertyAlias alias) {
// We need to tweak the context node based on what kind of variable (element vs non-element)
- if (alias.header != null) {
- _root = headerParts.get(alias.header);
- } else if (alias.part != null) {
- Element part = DOMUtils.findChildByName(msgData,new QName(null, alias.part.name),false);
+ if (alias.getHeader() != null) {
+ _root = headerParts.get(alias.getHeader());
+ } else if (alias.getPart() != null) {
+ Element part = DOMUtils.findChildByName(msgData,new QName(null, alias.getPart().getName()),false);
//check if the property alias is defined on the header part of the message
if(part == null){
- _root = headerParts.get(alias.part.name);
- } else if (part != null && alias.part.type instanceof OElementVarType) {
- _root = DOMUtils.findChildByName(part, ((OElementVarType)alias.part.type).elementType);
+ _root = headerParts.get(alias.getPart().getName());
+ } else if (part != null && alias.getPart().getType() instanceof OElementVarType) {
+ _root = DOMUtils.findChildByName(part, ((OElementVarType)alias.getPart().getType()).getElementType());
} else
_root = part;
} else {
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
index 2aea365..38b9366 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
@@ -25,8 +25,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.ORepeatUntil;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.ORepeatUntil;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -50,7 +50,7 @@
public void run() {
ActivityInfo child = new ActivityInfo(genMonotonic(),
- getORepeatUntil().activity,
+ getORepeatUntil().getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
instance(createChild(child, _scopeFrame, _linkFrame));
instance(new WAITER(child));
@@ -79,7 +79,7 @@
*/
private boolean checkCondition() throws FaultException {
try {
- return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getORepeatUntil().untilCondition,getEvaluationContext());
+ return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getORepeatUntil().getUntilCondition(),getEvaluationContext());
} catch (EvaluationException e) {
String msg = "Unexpected expression evaluation error checking repeatUntil condition.";
__log.error(msg, e);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
index 82bfa6f..abe0fc1 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
@@ -19,8 +19,8 @@
package org.apache.ode.bpel.runtime;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OReply;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OReply;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.channels.FaultData;
import java.util.Iterator;
@@ -42,33 +42,33 @@
final OReply oreply = (OReply)_self.o;
if (__log.isDebugEnabled()) {
- __log.debug("<reply> partnerLink=" + oreply.partnerLink + ", operation=" + oreply.operation);
+ __log.debug("<reply> partnerLink=" + oreply.getPartnerLink() + ", operation=" + oreply.getOperation());
}
FaultData fault = null;
// TODO: Check for fault without message.
try {
- sendVariableReadEvent(_scopeFrame.resolve(oreply.variable));
- Node msg = fetchVariableData(_scopeFrame.resolve(oreply.variable), false);
+ sendVariableReadEvent(_scopeFrame.resolve(oreply.getVariable()));
+ Node msg = fetchVariableData(_scopeFrame.resolve(oreply.getVariable()), false);
assert msg instanceof Element;
- for (Iterator<OScope.CorrelationSet> i = oreply.initCorrelations.iterator(); i.hasNext(); ) {
+ for (Iterator<OScope.CorrelationSet> i = oreply.getInitCorrelations().iterator(); i.hasNext(); ) {
OScope.CorrelationSet cset = i.next();
initializeCorrelation(_scopeFrame.resolve(cset),
- _scopeFrame.resolve(oreply.variable));
+ _scopeFrame.resolve(oreply.getVariable()));
}
- for (OScope.CorrelationSet aJoinCorrelation : oreply.joinCorrelations) {
+ for (OScope.CorrelationSet aJoinCorrelation : oreply.getJoinCorrelations()) {
// will be ignored if already initialized
- initializeCorrelation(_scopeFrame.resolve(aJoinCorrelation), _scopeFrame.resolve(oreply.variable));
+ initializeCorrelation(_scopeFrame.resolve(aJoinCorrelation), _scopeFrame.resolve(oreply.getVariable()));
}
// send reply
getBpelRuntimeContext()
- .reply(_scopeFrame.resolve(oreply.partnerLink), oreply.operation.getName(),
- oreply.messageExchangeId, (Element)msg,
- (oreply.fault != null) ? oreply.fault : null);
+ .reply(_scopeFrame.resolve(oreply.getPartnerLink()), oreply.getOperation().getName(),
+ oreply.getMessageExchangeId(), (Element)msg,
+ (oreply.getFault() != null) ? oreply.getFault() : null);
} catch (FaultException e) {
__log.error(e);
fault = createFault(e.getQName(), oreply);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
index 64629b6..4a0a7b0 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPE.java
@@ -34,16 +34,16 @@
import org.apache.ode.bpel.evt.ScopeFaultEvent;
import org.apache.ode.bpel.evt.ScopeStartEvent;
import org.apache.ode.bpel.evt.VariableModificationEvent;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OCatch;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OEventHandler;
-import org.apache.ode.bpel.o.OFailureHandling;
-import org.apache.ode.bpel.o.OFaultHandler;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OCatch;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OEventHandler;
+import org.apache.ode.bpel.obj.OFailureHandling;
+import org.apache.ode.bpel.obj.OFaultHandler;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
import org.apache.ode.bpel.runtime.channels.Compensation;
import org.apache.ode.bpel.runtime.channels.EventHandlerControl;
import org.apache.ode.bpel.runtime.channels.FaultData;
@@ -72,19 +72,19 @@
public SCOPE(ActivityInfo self, ScopeFrame frame, LinkFrame linkFrame) {
super(self, frame, linkFrame);
_oscope = (OScope) self.o;
- assert _oscope.activity != null;
+ assert _oscope.getActivity() != null;
}
public void run() {
// Start the child activity.
_child = new ActivityInfo(genMonotonic(),
- _oscope.activity,
+ _oscope.getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
instance(createChild(_child, _scopeFrame, _linkFrame));
- if (_oscope.eventHandler != null) {
- for (Iterator<OEventHandler.OAlarm> i = _oscope.eventHandler.onAlarms.iterator(); i.hasNext(); ) {
+ if (_oscope.getEventHandler() != null) {
+ for (Iterator<OEventHandler.OAlarm> i = _oscope.getEventHandler().getOnAlarms().iterator(); i.hasNext(); ) {
OEventHandler.OAlarm alarm = i.next();
EventHandlerInfo ehi = new EventHandlerInfo(alarm,
newChannel(EventHandlerControl.class),
@@ -94,7 +94,7 @@
instance(new EH_ALARM(ehi.psc,ehi.tc, ehi.cc, alarm, _scopeFrame));
}
- for (Iterator<OEventHandler.OEvent> i = _oscope.eventHandler.onMessages.iterator(); i.hasNext(); ) {
+ for (Iterator<OEventHandler.OEvent> i = _oscope.getEventHandler().getOnMessages().iterator(); i.hasNext(); ) {
OEventHandler.OEvent event = i.next();
EventHandlerInfo ehi = new EventHandlerInfo(event,
newChannel(EventHandlerControl.class),
@@ -106,7 +106,7 @@
}
getBpelRuntimeContext().initializePartnerLinks(_scopeFrame.scopeInstanceId,
- _oscope.partnerLinks.values());
+ _oscope.getPartnerLinks().values());
sendEvent(new ScopeStartEvent());
instance(new ACTIVE());
@@ -197,7 +197,7 @@
public void cancelled() {
// Implicit scope holds links of the enclosed activity,
// they only get cancelled when we propagate upwards.
- if (_oscope.implicitScope)
+ if (_oscope.isImplicitScope())
_self.parent.cancelled();
else
completed(null, CompensationHandler.emptySet());
@@ -263,9 +263,9 @@
// Maintain a set of links needing dead-path elimination.
Set<OLink> linksNeedingDPE = new HashSet<OLink>();
- if (_oscope.faultHandler != null)
- for (Iterator<OCatch> i = _oscope.faultHandler.catchBlocks.iterator(); i.hasNext(); )
- linksNeedingDPE.addAll(i.next().outgoingLinks);
+ if (_oscope.getFaultHandler() != null)
+ for (Iterator<OCatch> i = _oscope.getFaultHandler().getCatchBlocks().iterator(); i.hasNext(); )
+ linksNeedingDPE.addAll(i.next().getOutgoingLinks());
// We're done with the main work, if we were terminated, we will
// need to load the termination handler:
@@ -276,16 +276,16 @@
// ??? Should we forward
// If termination handler defined, and the scope has not faulted
- if (_oscope.terminationHandler != null && _fault == null) {
+ if (_oscope.getTerminationHandler() != null && _fault == null) {
// We have to create a scope for the catch block.
BpelRuntimeContext ntive = getBpelRuntimeContext();
- ActivityInfo terminationHandlerActivity = new ActivityInfo(genMonotonic(), _oscope.terminationHandler,
+ ActivityInfo terminationHandlerActivity = new ActivityInfo(genMonotonic(), _oscope.getTerminationHandler(),
newChannel(Termination.class,"TH"), newChannel(ParentScope.class,"TH"));
- ScopeFrame terminationHandlerScopeFrame = new ScopeFrame(_oscope.terminationHandler,
- ntive.createScopeInstance(_scopeFrame.scopeInstanceId, _oscope.terminationHandler),
+ ScopeFrame terminationHandlerScopeFrame = new ScopeFrame(_oscope.getTerminationHandler(),
+ ntive.createScopeInstance(_scopeFrame.scopeInstanceId, _oscope.getTerminationHandler()),
_scopeFrame, CompensationHandler.emptySet(), (FaultData)null);
// Create the temination handler scope.
@@ -321,7 +321,7 @@
sendEvent(new ScopeFaultEvent(_fault.getFaultName(), _fault.getFaultLineNo(),_fault.getExplanation()));
// Find a fault handler for our fault.
- OCatch catchBlock = _oscope.faultHandler == null ? null : findCatch(_oscope.faultHandler, _fault.getFaultName(), _fault.getFaultType());
+ OCatch catchBlock = _oscope.getFaultHandler() == null ? null : findCatch(_oscope.getFaultHandler(), _fault.getFaultName(), _fault.getFaultType());
// Collect all the compensation data for completed child scopes.
assert !!_eventHandlers.isEmpty();
@@ -339,7 +339,7 @@
__log.warn(_self + ": has a fault handler for "
+ _fault.getFaultName() + ": "+ catchBlock + " , " + _fault.toString());
- linksNeedingDPE.removeAll(catchBlock.outgoingLinks);
+ linksNeedingDPE.removeAll(catchBlock.getOutgoingLinks());
// We have to create a scope for the catch block.
BpelRuntimeContext ntive = getBpelRuntimeContext();
@@ -350,16 +350,16 @@
ScopeFrame faultHandlerScopeFrame = new ScopeFrame(catchBlock,
ntive.createScopeInstance(_scopeFrame.scopeInstanceId, catchBlock),
_scopeFrame, _compensations, _fault);
- if (catchBlock.faultVariable != null) {
+ if (catchBlock.getFaultVariable() != null) {
try {
- VariableInstance vinst = faultHandlerScopeFrame.resolve(catchBlock.faultVariable);
+ VariableInstance vinst = faultHandlerScopeFrame.resolve(catchBlock.getFaultVariable());
initializeVariable(vinst, _fault.getFaultMessage().cloneNode(true));
// Generating event
- VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.name);
+ VariableModificationEvent se = new VariableModificationEvent(vinst.declaration.getName());
se.setNewValue(_fault.getFaultMessage());
- if (_oscope.debugInfo != null)
- se.setLineNo(_oscope.debugInfo.startLine);
+ if (_oscope.getDebugInfo() != null)
+ se.setLineNo(_oscope.getDebugInfo().getStartLine());
sendEvent(se);
} catch (Exception ex) {
__log.fatal(ex);
@@ -394,7 +394,7 @@
} else /* completed ok */ {
sendEvent(new ScopeCompletionEvent());
- if (_oscope.compensationHandler != null) {
+ if (_oscope.getCompensationHandler() != null) {
CompensationHandler compensationHandler = new CompensationHandler(
_scopeFrame,
newChannel(Compensation.class),
@@ -437,36 +437,36 @@
private static OCatch findCatch(OFaultHandler fh, QName faultName, OVarType faultType) {
OCatch bestMatch = null;
- for (OCatch c : fh.catchBlocks) {
+ for (OCatch c : fh.getCatchBlocks()) {
// First we try to eliminate this catch block based on fault-name mismatches:
- if (c.faultName != null) {
+ if (c.getFaultName() != null) {
if (faultName == null)
continue;
- if (!faultName.equals(c.faultName))
+ if (!faultName.equals(c.getFaultName()))
continue;
}
// Then we try to eliminate this catch based on type incompatibility:
- if (c.faultVariable != null) {
+ if (c.getFaultVariable() != null) {
if (faultType == null)
continue;
- else if (c.faultVariable.type instanceof OMessageVarType) {
+ else if (c.getFaultVariable().getType() instanceof OMessageVarType) {
if (faultType instanceof OMessageVarType
- && ((OMessageVarType) faultType).equals(c.faultVariable.type)) {
+ && ((OMessageVarType) faultType).equals(c.getFaultVariable().getType())) {
// Don't eliminate.
} else if (faultType instanceof OElementVarType
- && ((OMessageVarType) c.faultVariable.type).docLitType != null
- && !((OMessageVarType) c.faultVariable.type).docLitType.equals(faultType)) {
+ && ((OMessageVarType) c.getFaultVariable().getType()).getDocLitType() != null
+ && !((OMessageVarType) c.getFaultVariable().getType()).getDocLitType().equals(faultType)) {
// Don't eliminate.
} else {
continue; // Eliminate.
}
- } else if (c.faultVariable.type instanceof OElementVarType) {
- if (faultType instanceof OElementVarType && faultType.equals(c.faultVariable.type)) {
+ } else if (c.getFaultVariable().getType() instanceof OElementVarType) {
+ if (faultType instanceof OElementVarType && faultType.equals(c.getFaultVariable().getType())) {
// Don't eliminate
} else if (faultType instanceof OMessageVarType
- && ((OMessageVarType) faultType).docLitType != null
- && ((OMessageVarType) faultType).docLitType.equals(c.faultVariable.type)) {
+ && ((OMessageVarType) faultType).getDocLitType() != null
+ && ((OMessageVarType) faultType).getDocLitType().equals(c.getFaultVariable().getType())) {
// Don't eliminate
} else {
continue; // eliminate
@@ -484,8 +484,8 @@
} else {
// Otherwise we prefer name and variable matches but prefer name-only matches to
// variable-only matches.
- int existingScore = (bestMatch.faultName == null ? 0 : 2) + (bestMatch.faultVariable == null ? 0 : 1);
- int currentScore = (c.faultName == null ? 0 : 2) + (c.faultVariable == null ? 0 : 1);
+ int existingScore = (bestMatch.getFaultName() == null ? 0 : 2) + (bestMatch.getFaultVariable() == null ? 0 : 1);
+ int currentScore = (c.getFaultName() == null ? 0 : 2) + (c.getFaultVariable() == null ? 0 : 1);
if (currentScore > existingScore) {
bestMatch = c;
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
index 74ecad6..f203e83 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
@@ -29,9 +29,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.LinkStatus;
import org.apache.ode.bpel.runtime.channels.ParentScope;
@@ -56,7 +56,7 @@
}
public void run() {
- if (((OScope) _self.o).isolatedScope) {
+ if (((OScope) _self.o).isIsolatedScope()) {
__log.debug("found ISOLATED scope, instance ISOLATEDGUARD");
instance(new ISOLATEDGUARD(createLockList(), newChannel(Synch.class)));
@@ -66,7 +66,7 @@
// Depending on whether we are ATOMIC or not, we'll need to create outgoing link status interceptors
LinkFrame linkframe;
- if (((OScope) _self.o).atomicScope && !_self.o.outgoingLinks.isEmpty()) {
+ if (((OScope) _self.o).isAtomicScope() && !_self.o.getOutgoingLinks().isEmpty()) {
Val linkInterceptorControl = newChannel(Val.class);
ParentScope psc = newChannel(ParentScope.class);
linkframe = createInterceptorLinkFrame();
@@ -91,11 +91,11 @@
LinkedList<IsolationLock> requiredLocks = new LinkedList<IsolationLock>();
OScope o = ((OScope) _self.o);
- Set<Variable> vrs = new HashSet<Variable>(o.variableRd);
- vrs.addAll(o.variableWr);
+ Set<Variable> vrs = new HashSet<Variable>(o.getVariableRd());
+ vrs.addAll(o.getVariableWr());
for (Variable v : vrs)
- requiredLocks.add(new IsolationLock(v, o.variableWr.contains(v), _scopeFrame.globals._varLocks.get(v)));
+ requiredLocks.add(new IsolationLock(v, o.getVariableWr().contains(v), _scopeFrame.globals._varLocks.get(v)));
// Very important, we must sort the locks to prevent deadlocks.
Collections.sort(requiredLocks);
@@ -110,7 +110,7 @@
*/
private LinkFrame createInterceptorLinkFrame() {
LinkFrame newframe = new LinkFrame(_linkFrame);
- for (OLink outlink : _self.o.outgoingLinks) {
+ for (OLink outlink : _self.o.getOutgoingLinks()) {
LinkInfo original = _linkFrame.resolve(outlink);
LinkStatus newchannel = newChannel(LinkStatus.class);
newframe.links.put(original.olink, new LinkInfo(original.olink, newchannel, newchannel));
@@ -197,7 +197,7 @@
* @return
*/
private boolean isDone() {
- return (_statuses.keySet().size() < SCOPEACT.this._self.o.outgoingLinks.size());
+ return (_statuses.keySet().size() < SCOPEACT.this._self.o.getOutgoingLinks().size());
}
}
@@ -344,7 +344,7 @@
__log.debug("UNLOCKER: unlockAll: " + _locks);
}
- if (((OScope)SCOPEACT.this._self.o).atomicScope)
+ if (((OScope)SCOPEACT.this._self.o).isAtomicScope())
getBpelRuntimeContext().forceFlush();
for (IsolationLock il : _locks)
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java
index ca980cc..a3608d0 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SEQUENCE.java
@@ -25,9 +25,9 @@
import java.util.Set;
import java.util.TreeSet;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OSequence;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OSequence;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -47,7 +47,7 @@
private final Set<CompensationHandler> _compensations;
SEQUENCE(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
- this(self, scopeFrame, linkFrame, ((OSequence)self.o).sequence, CompensationHandler.emptySet());
+ this(self, scopeFrame, linkFrame, ((OSequence)self.o).getSequence(), CompensationHandler.emptySet());
}
SEQUENCE(ActivityInfo self,
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java
index 6671397..1f291c2 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java
@@ -21,7 +21,7 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OSwitch;
+import org.apache.ode.bpel.obj.OSwitch;
import org.apache.ode.bpel.runtime.channels.FaultData;
import java.util.Iterator;
@@ -51,13 +51,13 @@
OSwitch.OCase ocase = (OSwitch.OCase) i.next();
try{
try {
- if(getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(ocase.expression, evalCtx)){
+ if(getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(ocase.getExpression(), evalCtx)){
matchedOCase = ocase;
break;
}
} catch (EvaluationException e) {
- __log.error("Sub-Language execution failure evaluating " + ocase.expression, e);
- throw new FaultException(oswitch.getOwner().constants.qnSubLanguageExecutionFault, e.getMessage());
+ __log.error("Sub-Language execution failure evaluating " + ocase.getExpression(), e);
+ throw new FaultException(oswitch.getOwner().getConstants().getQnSubLanguageExecutionFault(), e.getMessage());
}
}catch(FaultException e){
__log.error(e.getMessage(),e);
@@ -66,7 +66,7 @@
// Dead path all the child activiites:
for (Iterator<OSwitch.OCase> j = oswitch.getCases().iterator(); j.hasNext(); )
- dpe(j.next().activity);
+ dpe(j.next().getActivity());
return;
}
}
@@ -75,7 +75,7 @@
for (Iterator<OSwitch.OCase> i = oswitch.getCases().iterator(); i.hasNext(); ) {
OSwitch.OCase cs = i.next();
if (cs != matchedOCase)
- dpe(cs.activity);
+ dpe(cs.getActivity());
}
// no conditions satisfied, we're done.
@@ -83,7 +83,7 @@
_self.parent.completed(null, CompensationHandler.emptySet());
} else /* matched case */ {
// Re-use our current channels.
- ActivityInfo child = new ActivityInfo(genMonotonic(),matchedOCase.activity, _self.self, _self.parent);
+ ActivityInfo child = new ActivityInfo(genMonotonic(),matchedOCase.getActivity(), _self.self, _self.parent);
instance(createChild(child,_scopeFrame,_linkFrame));
}
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
index 155d966..0af1f6d 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ScopeFrame.java
@@ -23,11 +23,11 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.evt.ScopeEvent;
import org.apache.ode.bpel.iapi.BpelEngineException;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
import org.apache.ode.bpel.runtime.BpelRuntimeContext.ValueReferencePair;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.utils.DOMUtils;
@@ -98,7 +98,7 @@
public ScopeFrame find(OScope scope) {
- if (oscope.name.equals(scope.name)) {
+ if (oscope.getName().equals(scope.getName())) {
return this;
}
@@ -108,17 +108,17 @@
}
public VariableInstance resolve(OScope.Variable variable) {
- ScopeFrame scopeFrame = find(variable.declaringScope);
+ ScopeFrame scopeFrame = find(variable.getDeclaringScope());
if (scopeFrame == null) return null;
return new VariableInstance(scopeFrame.scopeInstanceId, variable);
}
public CorrelationSetInstance resolve(OScope.CorrelationSet cset) {
- return new CorrelationSetInstance(find(cset.declaringScope).scopeInstanceId, cset);
+ return new CorrelationSetInstance(find(cset.getDeclaringScope()).scopeInstanceId, cset);
}
public PartnerLinkInstance resolve(OPartnerLink partnerLink) {
- return new PartnerLinkInstance(find(partnerLink.declaringScope).scopeInstanceId, partnerLink);
+ return new PartnerLinkInstance(find(partnerLink.getDeclaringScope()).scopeInstanceId, partnerLink);
}
public String toString() {
@@ -150,17 +150,17 @@
ScopeFrame currentScope = this;
ArrayList<String> parentNames = new ArrayList<String>();
while (currentScope != null) {
- parentNames.add(currentScope.oscope.name);
+ parentNames.add(currentScope.oscope.getName());
currentScope = currentScope.parent;
}
event.setParentScopesNames(parentNames);
if (parent != null)
event.setParentScopeId(parent.scopeInstanceId);
event.setScopeId(scopeInstanceId);
- event.setScopeName(oscope.name);
+ event.setScopeName(oscope.getName());
event.setScopeDeclerationId(oscope.getId());
- if (event.getLineNo() == -1 && oscope.debugInfo != null)
- event.setLineNo(oscope.debugInfo.startLine);
+ if (event.getLineNo() == -1 && oscope.getDebugInfo() != null)
+ event.setLineNo(oscope.getDebugInfo().getStartLine());
}
@@ -172,42 +172,42 @@
Node fetchVariableData(BpelRuntimeContext brc, VariableInstance variable, boolean forWriting)
throws FaultException
{
- if (variable.declaration.extVar != null) {
+ if (variable.declaration.getExtVar() != null) {
// Note, that when using external variables, the database will not contain the value of the
// variable, instead we need to go the external variable subsystems.
- Element reference = (Element) fetchVariableData(brc, resolve(variable.declaration.extVar.related), false);
+ Element reference = (Element) fetchVariableData(brc, resolve(variable.declaration.getExtVar().getRelated()), false);
try {
Node ret = brc.readExtVar(variable.declaration, reference );
if (ret == null) {
- throw new FaultException(oscope.getOwner().constants.qnUninitializedVariable,
- "The external variable \"" + variable.declaration.name + "\" has not been initialized.");
+ throw new FaultException(oscope.getOwner().getConstants().getQnUninitializedVariable(),
+ "The external variable \"" + variable.declaration.getName() + "\" has not been initialized.");
}
return ret;
} catch (IncompleteKeyException ike) {
// This indicates that the external variable needed to be written do, put has not been.
__log.error("External variable could not be read due to incomplete key; the following key " +
"components were missing: " + ike.getMissing());
- throw new FaultException(oscope.getOwner().constants.qnUninitializedVariable,
- "The extenral variable \"" + variable.declaration.name + "\" has not been properly initialized;" +
+ throw new FaultException(oscope.getOwner().getConstants().getQnUninitializedVariable(),
+ "The extenral variable \"" + variable.declaration.getName() + "\" has not been properly initialized;" +
"the following key compoenents were missing:" + ike.getMissing());
} catch (ExternalVariableModuleException e) {
throw new BpelEngineException(e);
}
} else /* not external */ {
- Node data = brc.readVariable(variable.scopeInstance,variable.declaration.name, forWriting);
+ Node data = brc.readVariable(variable.scopeInstance,variable.declaration.getName(), forWriting);
if (data == null) {
// Special case of messageType variables with no part
- if (variable.declaration.type instanceof OMessageVarType) {
- OMessageVarType msgType = (OMessageVarType) variable.declaration.type;
- if (msgType.parts.size() == 0) {
+ if (variable.declaration.getType() instanceof OMessageVarType) {
+ OMessageVarType msgType = (OMessageVarType) variable.declaration.getType();
+ if (msgType.getParts().size() == 0) {
Document doc = DOMUtils.newDocument();
Element root = doc.createElement("message");
doc.appendChild(root);
return root;
}
}
- throw new FaultException(oscope.getOwner().constants.qnUninitializedVariable,
- "The variable " + variable.declaration.name + " isn't properly initialized.");
+ throw new FaultException(oscope.getOwner().getConstants().getQnUninitializedVariable(),
+ "The variable " + variable.declaration.getName() + " isn't properly initialized.");
}
return data;
}
@@ -220,7 +220,7 @@
// If we want a specific part, we will need to navigate through the
// message/part structure
- if (var.declaration.type instanceof OMessageVarType && part != null) {
+ if (var.declaration.getType() instanceof OMessageVarType && part != null) {
container = getPartData((Element) container, part);
}
return container;
@@ -229,10 +229,10 @@
Node initializeVariable(BpelRuntimeContext context, VariableInstance var, Node value)
throws ExternalVariableModuleException {
- if (var.declaration.extVar != null) /* external variable */ {
+ if (var.declaration.getExtVar() != null) /* external variable */ {
if (__log.isDebugEnabled())
__log.debug("Initialize external variable: name="+var.declaration + " value="+DOMUtils.domToString(value));
- VariableInstance related = resolve(var.declaration.extVar.related);
+ VariableInstance related = resolve(var.declaration.getExtVar().getRelated());
Node reference = null;
try {
reference = fetchVariableData(context, related, true);
@@ -255,10 +255,10 @@
Node writeVariable(BpelRuntimeContext context, VariableInstance var, Node value) throws ExternalVariableModuleException {
- if (var.declaration.extVar != null) /* external variable */ {
+ if (var.declaration.getExtVar() != null) /* external variable */ {
if(__log.isDebugEnabled())
__log.debug("Write external variable: name="+var.declaration + " value="+DOMUtils.domToString(value));
- VariableInstance related = resolve(var.declaration.extVar.related);
+ VariableInstance related = resolve(var.declaration.getExtVar().getRelated());
Node reference = null;
try {
reference = fetchVariableData(context, related, true);
@@ -279,10 +279,10 @@
Node getPartData(Element message, Part part) {
// borrowed from ASSIGN.evalQuery()
- QName partName = new QName(null, part.name);
+ QName partName = new QName(null, part.getName());
Node ret = DOMUtils.findChildByName(message, partName);
- if (part.type instanceof OElementVarType) {
- QName elName = ((OElementVarType) part.type).elementType;
+ if (part.getType() instanceof OElementVarType) {
+ QName elName = ((OElementVarType) part.getType()).getElementType();
ret = DOMUtils.findChildByName((Element) ret, elName);
}
return ret;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/THROW.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/THROW.java
index 763ba68..3917837 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/THROW.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/THROW.java
@@ -19,7 +19,7 @@
package org.apache.ode.bpel.runtime;
import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.o.OThrow;
+import org.apache.ode.bpel.obj.OThrow;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -44,18 +44,18 @@
public void run() {
FaultData fault = null;
- if(_othrow.faultVariable != null){
+ if(_othrow.getFaultVariable() != null){
try {
- sendVariableReadEvent(_scopeFrame.resolve(_othrow.faultVariable));
- Node faultVariable = fetchVariableData(_scopeFrame.resolve(_othrow.faultVariable), false);
- fault = createFault(_othrow.faultName, (Element)faultVariable,_othrow.faultVariable.type,_othrow);
+ sendVariableReadEvent(_scopeFrame.resolve(_othrow.getFaultVariable()));
+ Node faultVariable = fetchVariableData(_scopeFrame.resolve(_othrow.getFaultVariable()), false);
+ fault = createFault(_othrow.getFaultName(), (Element)faultVariable,_othrow.getFaultVariable().getType(),_othrow);
} catch (FaultException e) {
// deal with this as a fault (just not the one we hoped for)
__log.error(e);
fault = createFault(e.getQName(), _othrow);
}
}else{
- fault = createFault(_othrow.faultName, _othrow);
+ fault = createFault(_othrow.getFaultName(), _othrow);
}
_self.parent.completed(fault, CompensationHandler.emptySet());
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/VariableInstance.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/VariableInstance.java
index 63358fa..c057fb1 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/VariableInstance.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/VariableInstance.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope;
import java.io.Serializable;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
index a2efcfc..7c40939 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
@@ -26,7 +26,7 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OWait;
+import org.apache.ode.bpel.obj.OWait;
import org.apache.ode.bpel.runtime.channels.Termination;
import org.apache.ode.bpel.runtime.channels.TimerResponse;
import org.apache.ode.jacob.ReceiveProcess;
@@ -59,7 +59,7 @@
} catch (EvaluationException ee) {
String msg = "Unexpected error evaluating wait condition.";
__log.error(msg, ee);
- _self.parent.completed(createFault(_self.o.getOwner().constants.qnSubLanguageExecutionFault, _self.o), CompensationHandler.emptySet());
+ _self.parent.completed(createFault(_self.o.getOwner().getConstants().getQnSubLanguageExecutionFault(), _self.o), CompensationHandler.emptySet());
return;
}
@@ -114,11 +114,11 @@
Date dueDate = null;
if (wait.hasFor()) {
Calendar cal = Calendar.getInstance();
- Duration duration = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(wait.forExpression, evalCtx);
+ Duration duration = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(wait.getForExpression(), evalCtx);
duration.addTo(cal);
dueDate = cal.getTime();
} else if (wait.hasUntil()) {
- Calendar cal = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(wait.untilExpression, evalCtx);
+ Calendar cal = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(wait.getUntilExpression(), evalCtx);
dueDate = cal.getTime();
} else {
throw new AssertionError("Static checks failed to find bad WaitActivity!");
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
index 08f34e7..c6afa74 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
@@ -25,8 +25,8 @@
import org.apache.commons.logging.LogFactory;
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OWhile;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OWhile;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.ParentScope;
import org.apache.ode.bpel.runtime.channels.Termination;
@@ -65,7 +65,7 @@
if (condResult) {
ActivityInfo child = new ActivityInfo(genMonotonic(),
- getOWhile().activity,
+ getOWhile().getActivity(),
newChannel(Termination.class), newChannel(ParentScope.class));
instance(createChild(child, _scopeFrame, _linkFrame));
instance(new WAITER(child));
@@ -97,7 +97,7 @@
*/
private boolean checkCondition() throws FaultException {
try {
- return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getOWhile().whileCondition,getEvaluationContext());
+ return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getOWhile().getWhileCondition(),getEvaluationContext());
} catch (EvaluationException e) {
String msg = "Unexpected expression evaluation error checking while condition.";
__log.error(msg, e);
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/FaultData.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/FaultData.java
index 1da4f71..812b675 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/FaultData.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/FaultData.java
@@ -18,10 +18,10 @@
*/
package org.apache.ode.bpel.runtime.channels;
-import org.apache.ode.bpel.o.OBase;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OVarType;
+import org.apache.ode.bpel.obj.OBase;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OVarType;
import org.apache.ode.utils.SerializableElement;
import org.w3c.dom.Element;
@@ -110,9 +110,9 @@
protected int findLineNo(OBase location) {
if (location == null)
return -1;
- if (location.debugInfo == null)
+ if (location.getDebugInfo() == null)
return -1;
- return location.debugInfo.startLine;
+ return location.getDebugInfo().getStartLine();
}
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java
index 32efc4b..57ece13 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/channels/ParentScope.java
@@ -20,7 +20,7 @@
import java.util.Set;
-import org.apache.ode.bpel.o.OScope;
+import org.apache.ode.bpel.obj.OScope;
import org.apache.ode.bpel.runtime.CompensationHandler;
import org.apache.ode.jacob.Channel;
import org.apache.ode.jacob.Synch;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
index 926d730..f96e4f6 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
@@ -20,8 +20,8 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.explang.*;
-import org.apache.ode.bpel.o.OConstantExpression;
-import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.obj.OConstantExpression;
+import org.apache.ode.bpel.obj.OExpression;
import org.apache.ode.utils.xsd.Duration;
import org.w3c.dom.Node;
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/monitor/ProcessMonitor.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/monitor/ProcessMonitor.java
index 34bd316..e970100 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/monitor/ProcessMonitor.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/monitor/ProcessMonitor.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.bpel.runtime.monitor;
-import org.apache.ode.bpel.o.OProcess;
+import org.apache.ode.bpel.obj.OProcess;
/**
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/URIResolverTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/URIResolverTest.java
index 525a1de..ef292c7 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/URIResolverTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/URIResolverTest.java
@@ -27,7 +27,7 @@
import javax.xml.transform.Source;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
import org.apache.ode.utils.DOMUtils;
import org.junit.Ignore;
import org.junit.Test;
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntimeTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntimeTest.java
index f31904d..6be5998 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntimeTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntimeTest.java
@@ -12,15 +12,16 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.elang.xpath10.compiler.XPath10ExpressionCompilerBPEL20;
-import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
+import org.apache.ode.bpel.elang.xpath10.obj.OXPath10Expression;
import org.apache.ode.bpel.elang.xpath20.runtime.MockCompilerContext;
import org.apache.ode.bpel.explang.EvaluationContext;
import org.apache.ode.bpel.explang.EvaluationException;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.NSContext;
import org.junit.After;
@@ -67,7 +68,7 @@
OXPath10Expression exp = compile("number('/tns:Title/tns:Data')");
NSContext context = new NSContext();
context.register("tns", "http://foobar");
- exp.namespaceCtx = context;
+ exp.setNamespaceCtx(context);
Node retVal = _runtime.evaluateNode(exp, this);
@@ -75,65 +76,53 @@
assertEquals(String.valueOf(Double.NaN), retVal.getTextContent());
}
- @Override
public Node readVariable(Variable variable, Part part)
throws FaultException {
return null;
}
- @Override
public Node getPartData(Element message, Part part) throws FaultException {
return null;
}
- @Override
- public String readMessageProperty(Variable variable, OProperty property)
+ public String readMessageProperty(OScope.Variable variable, OProcess.OProperty property)
throws FaultException {
return null;
}
- @Override
public boolean isLinkActive(OLink olink) throws FaultException {
return false;
}
- @Override
public Node getRootNode() {
return null;
}
- @Override
public Node evaluateQuery(Node root, OExpression expr)
throws FaultException, EvaluationException {
return null;
}
- @Override
public Long getProcessId() {
return null;
}
- @Override
public QName getProcessQName() {
return null;
}
- @Override
public boolean narrowTypes() {
return false;
}
- @Override
public URI getBaseResourceURI() {
return null;
}
- @Override
public Node getPropertyValue(QName propertyName) {
return null;
}
- @Override
public Date getCurrentEventDateTime() {
return null;
}
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/MockCompilerContext.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/MockCompilerContext.java
index 8a6a075..1c4acb9 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/MockCompilerContext.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/MockCompilerContext.java
@@ -35,23 +35,23 @@
import org.apache.ode.bpel.compiler.bom.BpelObject;
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.compiler.bom.ScopeLikeActivity;
-import org.apache.ode.bpel.o.OActivity;
-import org.apache.ode.bpel.o.OElementVarType;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLValueExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OVarType;
-import org.apache.ode.bpel.o.OXsdTypeVarType;
-import org.apache.ode.bpel.o.OXslSheet;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OProcess.OPropertyAlias;
-import org.apache.ode.bpel.o.OScope.CorrelationSet;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OActivity;
+import org.apache.ode.bpel.obj.OElementVarType;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLValueExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OVarType;
+import org.apache.ode.bpel.obj.OXsdTypeVarType;
+import org.apache.ode.bpel.obj.OXslSheet;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+import org.apache.ode.bpel.obj.OProcess.OPropertyAlias;
+import org.apache.ode.bpel.obj.OScope.CorrelationSet;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.NSContext;
public class MockCompilerContext implements CompilerContext {
@@ -109,7 +109,7 @@
}
public Part resolvePart(Variable variable, String partname) throws CompilationException {
- return ((OMessageVarType)variable.type).parts.get(partname);
+ return ((OMessageVarType)variable.getType()).getParts().get(partname);
}
public OActivity compile(Activity child) throws CompilationException {
@@ -189,7 +189,7 @@
public void registerElementVar(String name, QName type) {
OElementVarType varType = new OElementVarType(getOProcess(),type);
OScope.Variable var = new OScope.Variable(getOProcess(),varType);
- var.name = name;
+ var.setName(name);
_vars.put(name, var);
}
@@ -202,7 +202,7 @@
}
OMessageVarType varType = new OMessageVarType(getOProcess(),type,parts);
OScope.Variable var = new OScope.Variable(getOProcess(),varType);
- var.name = name;
+ var.setName(name);
_vars.put(name, var);
}
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntimeTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntimeTest.java
index 3968b05..68d55a8 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntimeTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntimeTest.java
@@ -18,11 +18,11 @@
*/
package org.apache.ode.bpel.elang.xpath20.runtime;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.net.URI;
@@ -36,14 +36,15 @@
import org.apache.ode.bpel.common.FaultException;
import org.apache.ode.bpel.compiler.bom.Expression;
import org.apache.ode.bpel.elang.xpath20.compiler.XPath20ExpressionCompilerBPEL20;
-import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
+import org.apache.ode.bpel.elang.xpath20.obj.OXPath20ExpressionBPEL20;
import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.o.OExpression;
-import org.apache.ode.bpel.o.OLink;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OProcess.OProperty;
-import org.apache.ode.bpel.o.OScope.Variable;
+import org.apache.ode.bpel.obj.OExpression;
+import org.apache.ode.bpel.obj.OLink;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OProcess.OProperty;
+import org.apache.ode.bpel.obj.OScope.Variable;
import org.apache.ode.utils.DOMUtils;
+import org.apache.ode.utils.Namespaces;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -193,7 +194,7 @@
String insertElementName="InsertedNode";
OXPath20ExpressionBPEL20 exp = compile("$messageVar.parameters/"+insertElementName);
- exp.insertMissingData = true;
+ exp.setInsertMissingData(true);
// Setup root node
_rootNode = DOMUtils.stringToDOM("<message><parameters>" +
@@ -215,7 +216,7 @@
String insertElementName="InsertedNode";
OXPath20ExpressionBPEL20 exp = compile("$reallyEmptyVar/"+insertElementName);
- exp.insertMissingData = true;
+ exp.setInsertMissingData(true);
// Setup root node
_rootNode = DOMUtils.stringToDOM("<tns:ApplicationData xmlns:tns=\"http://foobar\"/>");
@@ -230,9 +231,17 @@
fail("Missing '"+insertElementName+"' element has not been inserted");
}
}
+
+ public void testODE911() throws Exception {
+ OXPath20ExpressionBPEL20 exp = compile("ode:delete($ODE991var/tns:empty)");
+ Element retVal = (Element)_runtime.evaluateNode(exp, this);
+ assertNotNull(retVal);
+ assertEquals(3, retVal.getElementsByTagNameNS("http://foobar", "notempty").getLength());
+ assertEquals(0, retVal.getElementsByTagNameNS("http://foobar", "empty").getLength());
+ }
public Node readVariable(Variable variable, Part part) throws FaultException {
- return _vars.get(variable.name);
+ return _vars.get(variable.getName());
}
public Node getPartData(Element message, Part part) throws FaultException {
@@ -274,6 +283,8 @@
doc.appendChild(e);
e.appendChild(doc.createTextNode(xpath));
Expression exp = new Expression(e);
+ exp.getNamespaceContext().register("tns", "http://foobar");
+ exp.getNamespaceContext().register("ode", Namespaces.ODE_EXTENSION_NS);
return (OXPath20ExpressionBPEL20)_compiler.compileLValue(exp);
}
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java
index e5a9992..f713c90 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/extvar/jdbc/JdbcExternalVariableEngineTest.java
@@ -21,7 +21,7 @@
import java.sql.Connection;
import java.sql.Statement;
import java.util.ArrayList;
-
+import java.util.Properties;
import javax.xml.namespace.QName;
import junit.framework.TestCase;
@@ -32,7 +32,7 @@
import org.apache.ode.utils.GUID;
import org.apache.ode.bpel.evar.ExternalVariableModule.Locator;
import org.apache.ode.bpel.evar.ExternalVariableModule.Value;
-import org.hsqldb.jdbc.jdbcDataSource;
+import org.h2.jdbcx.JdbcDataSource;
import org.junit.Test;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -54,26 +54,26 @@
final QName _varType = new QName("foo", "foobar");
ExternalVariableConf _econf;
- jdbcDataSource _ds;
+ JdbcDataSource _ds;
JdbcExternalVariableModule _engine;
Element _el1;
public void setUp() throws Exception {
- _ds = new org.hsqldb.jdbc.jdbcDataSource();
- _ds.setDatabase("jdbc:hsqldb:mem:" + new GUID().toString());
+ _ds = new org.h2.jdbcx.JdbcDataSource();
+ _ds.setURL("jdbc:h2:mem:" + new GUID().toString()+";DB_CLOSE_DELAY=-1");
_ds.setUser("sa");
Connection conn = _ds.getConnection();
Statement s = conn.createStatement();
s.execute("create table extvartable1 (" +
- "id1 VARCHAR PRIMARY KEY," +
- "_id2_ VARCHAR," +
- "pid VARCHAR, " +
+ "id1 VARCHAR(255) PRIMARY KEY," +
+ "_id2_ VARCHAR(255)," +
+ "pid VARCHAR(255), " +
"iid INT," +
"cts DATETIME," +
"uts DATETIME," +
- "foo VARCHAR," +
- "bar VARCHAR );");
+ "foo VARCHAR(255)," +
+ "bar VARCHAR(255));");
_engine = new JdbcExternalVariableModule();
_engine.registerDataSource("testds",_ds);
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
index e8032ec..d0b33a7 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
@@ -33,7 +33,7 @@
import org.apache.ode.bpel.iapi.MessageExchangeContext;
import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange;
-import org.apache.ode.bpel.o.OFailureHandling;
+import org.apache.ode.bpel.obj.OFailureHandling;
import org.apache.ode.bpel.pmapi.BpelManagementFacade;
import org.apache.ode.bpel.pmapi.ProcessInfoDocument;
import org.apache.ode.bpel.pmapi.TActivityInfo;
diff --git a/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java b/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
index 1e0fdb0..456c1cf 100644
--- a/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
+++ b/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
@@ -35,18 +35,18 @@
import org.apache.ode.bpel.evar.ExternalVariableModuleException;
import org.apache.ode.bpel.evt.ProcessInstanceEvent;
import org.apache.ode.bpel.iapi.ProcessConf.PartnerRoleConfig;
-import org.apache.ode.bpel.o.OCatch;
-import org.apache.ode.bpel.o.OEmpty;
-import org.apache.ode.bpel.o.OFaultHandler;
-import org.apache.ode.bpel.o.OFlow;
-import org.apache.ode.bpel.o.OMessageVarType;
-import org.apache.ode.bpel.o.OMessageVarType.Part;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.OScope;
-import org.apache.ode.bpel.o.OScope.Variable;
-import org.apache.ode.bpel.o.OSequence;
-import org.apache.ode.bpel.o.OThrow;
+import org.apache.ode.bpel.obj.OCatch;
+import org.apache.ode.bpel.obj.OEmpty;
+import org.apache.ode.bpel.obj.OFaultHandler;
+import org.apache.ode.bpel.obj.OFlow;
+import org.apache.ode.bpel.obj.OMessageVarType;
+import org.apache.ode.bpel.obj.OMessageVarType.Part;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.OScope;
+import org.apache.ode.bpel.obj.OScope.Variable;
+import org.apache.ode.bpel.obj.OSequence;
+import org.apache.ode.bpel.obj.OThrow;
import org.apache.ode.bpel.runtime.channels.ActivityRecovery;
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.bpel.runtime.channels.InvokeResponse;
@@ -171,8 +171,8 @@
public void testEmptyProcess() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- proc.procesScope.activity = new OEmpty(proc, proc.procesScope);
+ proc.setProcesScope(new OScope(proc, null));
+ proc.getProcesScope().setActivity(new OEmpty(proc, proc.getProcesScope()));
run(proc);
@@ -183,28 +183,28 @@
public void testThrow() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OThrow othrow = new OThrow(proc, proc.procesScope);
- othrow.faultName = new QName("foo", "bar");
- proc.procesScope.activity = othrow;
+ proc.setProcesScope(new OScope(proc, null));
+ OThrow othrow = new OThrow(proc, proc.getProcesScope());
+ othrow.setFaultName(new QName("foo", "bar"));
+ proc.getProcesScope().setActivity(othrow);
run(proc);
assertFalse(_completedOk);
assertFalse(_terminate);
- assertEquals(_fault.getFaultName(), othrow.faultName);
+ assertEquals(_fault.getFaultName(), othrow.getFaultName());
}
public void testFaultHandling() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OThrow othrow = new OThrow(proc, proc.procesScope);
- othrow.faultName = new QName("foo", "bar");
- proc.procesScope.activity = othrow;
- proc.procesScope.faultHandler = new OFaultHandler(proc);
- OCatch ocatch = new OCatch(proc, proc.procesScope);
- proc.procesScope.faultHandler.catchBlocks.add(ocatch);
- ocatch.activity = new OEmpty(proc, ocatch);
+ proc.setProcesScope(new OScope(proc, null));
+ OThrow othrow = new OThrow(proc, proc.getProcesScope());
+ othrow.setFaultName(new QName("foo", "bar"));
+ proc.getProcesScope().setActivity(othrow);
+ proc.getProcesScope().setFaultHandler(new OFaultHandler(proc));
+ OCatch ocatch = new OCatch(proc, proc.getProcesScope());
+ proc.getProcesScope().getFaultHandler().getCatchBlocks().add(ocatch);
+ ocatch.setActivity(new OEmpty(proc, ocatch));
run(proc);
assertTrue(_completedOk);
@@ -214,10 +214,10 @@
public void testOneElementSequence() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OSequence sequence = new OSequence(proc, proc.procesScope);
- proc.procesScope.activity = sequence;
- sequence.sequence.add(new OEmpty(proc, sequence));
+ proc.setProcesScope(new OScope(proc, null));
+ OSequence sequence = new OSequence(proc, proc.getProcesScope());
+ proc.getProcesScope().setActivity(sequence);
+ sequence.getSequence().add(new OEmpty(proc, sequence));
run(proc);
@@ -228,11 +228,11 @@
public void testTwoElementSequence() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OSequence sequence = new OSequence(proc, proc.procesScope);
- proc.procesScope.activity = sequence;
- sequence.sequence.add(new OEmpty(proc, sequence));
- sequence.sequence.add(new OEmpty(proc, sequence));
+ proc.setProcesScope(new OScope(proc, null));
+ OSequence sequence = new OSequence(proc, proc.getProcesScope());
+ proc.getProcesScope().setActivity(sequence);
+ sequence.getSequence().add(new OEmpty(proc, sequence));
+ sequence.getSequence().add(new OEmpty(proc, sequence));
run(proc);
@@ -243,8 +243,8 @@
public void testEmptyFlow() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- proc.procesScope.activity = new OFlow(proc, proc.procesScope);
+ proc.setProcesScope(new OScope(proc, null));
+ proc.getProcesScope().setActivity(new OFlow(proc, proc.getProcesScope()));
run(proc);
@@ -255,10 +255,10 @@
public void testSingleElementFlow() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OFlow flow = new OFlow(proc, proc.procesScope);
- proc.procesScope.activity = flow;
- flow.parallelActivities.add(new OEmpty(proc, flow));
+ proc.setProcesScope(new OScope(proc, null));
+ OFlow flow = new OFlow(proc, proc.getProcesScope());
+ proc.getProcesScope().setActivity(flow);
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
run(proc);
@@ -269,11 +269,11 @@
public void testTwoElementFlow() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OFlow flow = new OFlow(proc, proc.procesScope);
- proc.procesScope.activity = flow;
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
+ proc.setProcesScope(new OScope(proc, null));
+ OFlow flow = new OFlow(proc, proc.getProcesScope());
+ proc.getProcesScope().setActivity(flow);
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
run(proc);
@@ -284,24 +284,24 @@
public void testFlowTermination() {
OProcess proc = new OProcess("2.0");
- proc.procesScope = new OScope(proc, null);
- OFlow flow = new OFlow(proc, proc.procesScope);
- proc.procesScope.activity = flow;
+ proc.setProcesScope(new OScope(proc, null));
+ OFlow flow = new OFlow(proc, proc.getProcesScope());
+ proc.getProcesScope().setActivity(flow);
OThrow othrow = new OThrow(proc, flow);
- othrow.faultName = new QName("foo", "bar");
- flow.parallelActivities.add(othrow);
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
- flow.parallelActivities.add(new OEmpty(proc, flow));
+ othrow.setFaultName(new QName("foo", "bar"));
+ flow.getParallelActivities().add(othrow);
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
+ flow.getParallelActivities().add(new OEmpty(proc, flow));
run(proc);
assertFalse(_completedOk);
assertFalse(_terminate);
- assertEquals(_fault.getFaultName(), othrow.faultName);
+ assertEquals(_fault.getFaultName(), othrow.getFaultName());
}
private void run(OProcess proc) {
diff --git a/bpel-runtime/src/test/resources/xpath20/variables.xml b/bpel-runtime/src/test/resources/xpath20/variables.xml
index 919cbc3..38c5996 100644
--- a/bpel-runtime/src/test/resources/xpath20/variables.xml
+++ b/bpel-runtime/src/test/resources/xpath20/variables.xml
@@ -71,4 +71,14 @@
</tns:ExampleMessage>
</messageTypeVar>
+ <elementVar name="ODE991var" xmlns:tns="http://foobar" >
+ <tns:ApplicationData>
+ <tns:empty/>
+ <tns:notempty/>
+ <tns:empty/>
+ <tns:notempty/>
+ <tns:empty/>
+ <tns:notempty/>
+ </tns:ApplicationData>
+ </elementVar>
</variables>
\ No newline at end of file
diff --git a/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java b/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
index d3e5720..3c5e577 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
@@ -50,7 +50,10 @@
import org.apache.ode.bpel.dd.TDeployment;
import org.apache.ode.bpel.dd.TDeployment.Process;
import org.apache.ode.bpel.iapi.ContextException;
-import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
+import org.apache.ode.bpel.obj.serde.OmDeserializer;
+import org.apache.ode.bpel.obj.serde.OmSerdeFactory;
import org.apache.ode.utils.InternPool;
import org.apache.ode.utils.InternPool.InternableBlock;
import org.apache.ode.utils.fs.FileUtils;
@@ -215,9 +218,8 @@
private CBPInfo loadCBPInfo(File f) {
InputStream is = null;
try {
- is = new FileInputStream(f);
- Serializer ofh = new Serializer(is);
- CBPInfo info = new CBPInfo(ofh.type, ofh.guid, f);
+ DeSerializer deserializer = new DeSerializer(f);
+ CBPInfo info = new CBPInfo(deserializer.getWrapper().getType(),deserializer.getWrapper().getGuid(), f);
return info;
} catch (Exception e) {
throw new ContextException("Couldn't read compiled BPEL process " + f.getAbsolutePath(), e);
diff --git a/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java b/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
index 28903ac..a0770e9 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
@@ -60,7 +60,7 @@
import org.apache.ode.bpel.iapi.ProcessConf;
import org.apache.ode.bpel.iapi.ProcessState;
import org.apache.ode.bpel.iapi.Scheduler.JobDetails;
-import org.apache.ode.bpel.o.OFailureHandling;
+import org.apache.ode.bpel.obj.OFailureHandling;
import org.apache.ode.store.DeploymentUnitDir.CBPInfo;
import org.apache.ode.utils.CollectionUtils;
import org.apache.ode.utils.CronExpression;
@@ -190,9 +190,9 @@
if (invoke.isSetFailureHandling()) {
FailureHandling f = invoke.getFailureHandling();
g = new OFailureHandling();
- if (f.isSetFaultOnFailure()) g.faultOnFailure = f.getFaultOnFailure();
- if (f.isSetRetryDelay()) g.retryDelay = f.getRetryDelay();
- if (f.isSetRetryFor()) g.retryFor = f.getRetryFor();
+ if (f.isSetFaultOnFailure()) g.setFaultOnFailure(f.getFaultOnFailure());
+ if (f.isSetRetryDelay()) g.setRetryDelay(f.getRetryDelay());
+ if (f.isSetRetryFor()) g.setRetryFor(f.getRetryFor());
}
PartnerRoleConfig c = new PartnerRoleConfig(g, invoke.getUsePeer2Peer());
@@ -269,6 +269,14 @@
throw new ContextException("File Not Found: " + cbpInfo.cbp, e);
}
}
+
+ @Override
+ public File getCBPFile(){
+ CBPInfo cbpInfo = _du.getCBPInfo(getType());
+ if (cbpInfo == null)
+ throw new ContextException("CBP record not found for type " + getType());
+ return cbpInfo.cbp;
+ }
public long getCBPFileSize() {
CBPInfo cbpInfo = _du.getCBPInfo(getType());
diff --git a/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java b/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
index 91f0bff..05252a1 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/ProcessStoreImpl.java
@@ -29,7 +29,7 @@
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
import org.apache.ode.utils.msg.MessageBundle;
-import org.hsqldb.jdbc.jdbcDataSource;
+import org.h2.jdbcx.JdbcDataSource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -48,7 +48,7 @@
/**
* <p>
- * JDBC-based implementation of a process store. Also provides an "in-memory" store by way of HSQL database.
+ * JDBC-based implementation of a process store. Also provides an "in-memory" store by way of H2 database.
* </p>
*
* <p>
@@ -103,6 +103,8 @@
*/
private DataSource _inMemDs;
+ private static final ThreadLocal<Long> _currentVersion = new ThreadLocal<Long>();
+
public ProcessStoreImpl() {
this(null, null, "", new OdeConfigProperties(new Properties(), ""), true);
}
@@ -118,27 +120,30 @@
_cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(ds, props.getProperties(), createDatamodel, props.getTxFactoryClass());
}
} else {
- // If the datasource is not provided, then we create a HSQL-based
+ // If the datasource is not provided, then we create a H2-based
// in-memory database. Makes testing a bit simpler.
- DataSource hsqlds = createInternalDS(new GUID().toString());
+ DataSource h2 = createInternalDS(new GUID().toString());
if ("hibernate".equalsIgnoreCase(persistenceType)) {
- _cf = new org.apache.ode.store.hib.DbConfStoreConnectionFactory(hsqlds, props.getProperties(), createDatamodel, props.getTxFactoryClass());
+ _cf = new org.apache.ode.store.hib.DbConfStoreConnectionFactory(h2, props.getProperties(), createDatamodel, props.getTxFactoryClass());
} else {
- _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(hsqlds, props.getProperties(), createDatamodel, props.getTxFactoryClass());
+ _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(h2, props.getProperties(), createDatamodel, props.getTxFactoryClass());
}
- _inMemDs = hsqlds;
+ _inMemDs = h2;
}
+
+
}
+
/**
* Constructor that hardwires OpenJPA on a new in-memory database. Suitable for tests.
*/
public ProcessStoreImpl(EndpointReferenceContext eprContext, DataSource inMemDs) {
this.eprContext = eprContext;
- DataSource hsqlds = createInternalDS(new GUID().toString());
+ DataSource h2 = createInternalDS(new GUID().toString());
//when in memory we always create the model as we are starting from scratch
- _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(hsqlds, true, OdeConfigProperties.DEFAULT_TX_FACTORY_CLASS_NAME);
- _inMemDs = hsqlds;
+ _cf = new org.apache.ode.store.jpa.DbConfStoreConnectionFactory(h2, true, OdeConfigProperties.DEFAULT_TX_FACTORY_CLASS_NAME);
+ _inMemDs = h2;
}
public void shutdown() {
@@ -192,11 +197,12 @@
long version;
if (autoincrementVersion || du.getStaticVersion() == -1) {
// Process and DU use a monotonically increased single version number by default.
- version = exec(new Callable<Long>() {
- public Long call(ConfStoreConnection conn) {
- return conn.getNextVersion();
- }
- });
+ try {
+ version = getCurrentVersion();
+ } finally {
+ //we need to reset the current version thread local value.
+ _currentVersion.set(null);
+ }
} else {
version = du.getStaticVersion();
}
@@ -293,7 +299,6 @@
newDao.setProperty(prop.getKey(), DOMUtils.domToString(prop.getValue()));
}
deployed.add(pc.getProcessId());
- conn.setVersion(pc.getVersion());
} catch (Throwable e) {
String errmsg = "Error persisting deployment record for " + pc.getProcessId()
+ "; process will not be available after restart!";
@@ -305,7 +310,9 @@
});
- // We want the events to be fired outside of the bounds of the writelock.
+
+ _rw.readLock().lock();
+ boolean readLockHeld = true;
try {
for (ProcessConfImpl process : processes) {
fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.DEPLOYED, process.getProcessId(), process.getDeploymentUnit()
@@ -313,11 +320,18 @@
fireStateChange(process.getProcessId(), process.getState(), process.getDeploymentUnit().getName());
}
} catch (Exception e) {
+ //need to unlock as undeploy operation will need a writeLock
+ _rw.readLock().unlock();
+ readLockHeld = false;
+
// A problem at that point means that engine deployment failed, we don't want the store to keep the du
__log.warn("Deployment failed within the engine, store undeploying process.", e);
undeploy(deploymentUnitDirectory);
if (e instanceof ContextException) throw (ContextException) e;
else throw new ContextException("Deployment failed within the engine. " + e.getMessage(), e);
+ } finally {
+ if(readLockHeld)
+ _rw.readLock().unlock();
}
return deployed;
@@ -552,12 +566,18 @@
}
public long getCurrentVersion() {
+ if (_currentVersion.get() != null){
+ return _currentVersion.get();
+ }
+
long version = exec(new Callable<Long>() {
public Long call(ConfStoreConnection conn) {
return conn.getNextVersion();
}
});
- return version;
+
+ _currentVersion.set(version);
+ return _currentVersion.get();
}
protected void fireEvent(ProcessStoreEvent pse) {
@@ -826,11 +846,10 @@
}
public static DataSource createInternalDS(String guid) {
- jdbcDataSource hsqlds = new jdbcDataSource();
- hsqlds.setDatabase("jdbc:hsqldb:mem:" + guid);
- hsqlds.setUser("sa");
- hsqlds.setPassword("");
- return hsqlds;
+ JdbcDataSource h2 = new JdbcDataSource();
+ h2.setURL("jdbc:h2:mem:" + new GUID().toString()+";DB_CLOSE_DELAY=-1");
+ h2.setUser("sa");
+ return h2;
}
public static void shutdownInternalDB(DataSource ds) {
diff --git a/bpel-store/src/main/java/org/apache/ode/store/hib/ConfStoreConnectionHib.java b/bpel-store/src/main/java/org/apache/ode/store/hib/ConfStoreConnectionHib.java
index c8469ae..a7c7099 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/hib/ConfStoreConnectionHib.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/hib/ConfStoreConnectionHib.java
@@ -25,6 +25,8 @@
import org.apache.ode.store.ProcessConfDAO;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
+import org.hibernate.LockMode;
+import org.hibernate.Query;
import org.hibernate.Session;
import javax.xml.namespace.QName;
@@ -77,21 +79,32 @@
}
public long getNextVersion() {
- VersionTrackerDAOImpl vt = (VersionTrackerDAOImpl)
- _session.createQuery("from VersionTrackerDAOImpl v ").uniqueResult();
- if (vt == null) return 1;
- else return vt.getVersion() + 1;
+ Query q = _session.createQuery("from VersionTrackerDAOImpl v ");
+ q.setLockMode("v", LockMode.UPGRADE);
+ VersionTrackerDAOImpl vt = (VersionTrackerDAOImpl) q.uniqueResult();
+ if (vt == null) {
+ vt = new VersionTrackerDAOImpl();
+ vt.setVersion(1);
+ }else {
+ vt.setVersion(vt.getVersion() + 1);
+ }
+ _session.save(vt);
+ return vt.getVersion();
}
public void setVersion(long version) {
_session.flush();
- VersionTrackerDAOImpl vt = (VersionTrackerDAOImpl)
- _session.createQuery("from VersionTrackerDAOImpl v ").uniqueResult();
+
+ Query q = _session.createQuery("from VersionTrackerDAOImpl v ");
+ q.setLockMode("v", LockMode.UPGRADE);
+ VersionTrackerDAOImpl vt = (VersionTrackerDAOImpl) q.uniqueResult();
if (vt == null) {
vt = new VersionTrackerDAOImpl();
vt.setId(1);
+ vt.setVersion(1);
+ } else {
+ vt.setVersion(version);
}
- vt.setVersion(version);
_session.save(vt);
}
diff --git a/bpel-store/src/main/java/org/apache/ode/store/hib/ProcessConfDaoImpl.java b/bpel-store/src/main/java/org/apache/ode/store/hib/ProcessConfDaoImpl.java
index 6816cc2..2aba974 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/hib/ProcessConfDaoImpl.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/hib/ProcessConfDaoImpl.java
@@ -68,7 +68,7 @@
* @hibernate.map table="STORE_PROCESS_PROP" role="properties_"
* @hibernate.collection-key column="propId" foreign-key="none"
* @hibernate.collection-index column="name" type="string"
- * @hibernate.collection-element column="value" type="string" length="2048"
+ * @hibernate.collection-element column="data" type="text"
*/
public Map<String,String> getProperties_() {
return _properties;
diff --git a/bpel-store/src/main/java/org/apache/ode/store/jpa/ConfStoreConnectionJpa.java b/bpel-store/src/main/java/org/apache/ode/store/jpa/ConfStoreConnectionJpa.java
index fa2f4a7..72a9df9 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/jpa/ConfStoreConnectionJpa.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/jpa/ConfStoreConnectionJpa.java
@@ -25,6 +25,7 @@
import org.apache.ode.store.DeploymentUnitDAO;
import javax.persistence.EntityManager;
+import javax.persistence.Query;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@@ -64,19 +65,39 @@
}
public long getNextVersion() {
- List<VersionTrackerDAOImpl> res = _em.createQuery("select v from VersionTrackerDAOImpl v").getResultList();
- if (res.size() == 0) return 1;
- else {
- VersionTrackerDAOImpl vt = res.get(0);
- return vt.getVersion() + 1;
- }
+ VersionTrackerDAOImpl vt = null;
+ Query query = _em.createQuery("select v from VersionTrackerDAOImpl v");
+ query.setHint("openjpa.FetchPlan.ReadLockMode", "WRITE");
+
+ List<VersionTrackerDAOImpl> res = query.getResultList();
+
+ if(!res.isEmpty())
+ vt = res.get(0);
+
+ if (vt == null) {
+ vt = new VersionTrackerDAOImpl();
+ vt.setVersion(1);
+ } else {
+ vt.setVersion(vt.getVersion() + 1);
+ }
+
+ _em.persist(vt);
+ return vt.getVersion();
}
public void setVersion(long version) {
- List<VersionTrackerDAOImpl> res = _em.createQuery("select v from VersionTrackerDAOImpl v").getResultList();
- VersionTrackerDAOImpl vt;
- if (res.size() == 0) vt = new VersionTrackerDAOImpl();
- else vt = res.get(0);
+ VersionTrackerDAOImpl vt = null;
+ Query query = _em.createQuery("select v from VersionTrackerDAOImpl v");
+ query.setHint("openjpa.FetchPlan.ReadLockMode", "WRITE");
+
+ List<VersionTrackerDAOImpl> res = query.getResultList();
+
+ if(!res.isEmpty())
+ vt = res.get(0);
+
+ if (vt == null)
+ vt = new VersionTrackerDAOImpl();
+
vt.setVersion(version);
_em.persist(vt);
}
diff --git a/bpel-store/src/main/java/org/apache/ode/store/jpa/DbConfStoreConnectionFactory.java b/bpel-store/src/main/java/org/apache/ode/store/jpa/DbConfStoreConnectionFactory.java
index bd8508f..407e18a 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/jpa/DbConfStoreConnectionFactory.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/jpa/DbConfStoreConnectionFactory.java
@@ -60,6 +60,7 @@
propMap.put("openjpa.ConnectionFactoryMode", "managed");
propMap.put("openjpa.FlushBeforeQueries", "false");
propMap.put("openjpa.FetchBatchSize", 1000);
+ propMap.put("openjpa.LockManager","pessimistic");
//dirty hack for ODE-1015
String skipIsolation = System.getProperty("openjpa.connection.isolation.skip", "N");
diff --git a/bpel-store/src/main/java/org/apache/ode/store/jpa/ProcessConfPropertyDaoImpl.java b/bpel-store/src/main/java/org/apache/ode/store/jpa/ProcessConfPropertyDaoImpl.java
index 08ef39a..60b2cdc 100644
--- a/bpel-store/src/main/java/org/apache/ode/store/jpa/ProcessConfPropertyDaoImpl.java
+++ b/bpel-store/src/main/java/org/apache/ode/store/jpa/ProcessConfPropertyDaoImpl.java
@@ -22,6 +22,7 @@
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
+import javax.persistence.Lob;
import javax.persistence.Table;
/**
@@ -33,7 +34,7 @@
@Basic @Column(name="PROP_KEY")
private String _key;
- @Basic @Column(name="PROP_VAL")
+ @Lob @Column(name="DATA")
private String _value;
public String getKey() {
diff --git a/ci-build.sh b/ci-build.sh
index 115f2f6..1a590b7 100755
--- a/ci-build.sh
+++ b/ci-build.sh
@@ -1,21 +1,36 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
#
-# http://www.apache.org/licenses/LICENSE-2.0
+# http://www.apache.org/licenses/LICENSE-2.0
#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
-set -e
-export TEST_DUMMY_ENV_VAR=42;
-JAVA_OPTS="-XX:MaxPermSize=256m -Xmx2048m -Dlog4j.debug=true" TEST_PORTS="8888,7171" buildr _1.3.5_ clean test
+#!/bin/sh
-echo SUCCESS
+docker pull vanto/apache-buildr:latest-jruby-jdk7
+export JAVA_OPTS="-Xmx1024M -XX:MaxPermSize=512M"
+BUILDR_ARGS="$@"
+CONTAINER_USERNAME="dummy"
+CONTAINER_GROUPNAME="dummy"
+HOMEDIR="/home/$CONTAINER_USERNAME"
+GROUP_ID=$(id -g)
+USER_ID=$( id -u)
+
+CREATE_USER_COMMAND="groupadd -f -g $GROUP_ID $CONTAINER_GROUPNAME && useradd -u $USER_ID -g $CONTAINER_GROUPNAME $CONTAINER_USERNAME && mkdir --parent $HOMEDIR && chown -R $CONTAINER_USERNAME:$CONTAINER_GROUPNAME $HOMEDIR"
+
+BUNDLER_COMMAND="/opt/jruby/bin/jruby -S bundler install --gemfile=/workspace/Gemfile"
+
+BUILDR_COMMAND="su $CONTAINER_USERNAME -c '/opt/jruby/bin/jruby -S buildr $BUILDR_ARGS'"
+
+FINAL_COMMAND="$CREATE_USER_COMMAND && $BUNDLER_COMMAND && $BUILDR_COMMAND"
+
+docker run --rm -e JAVADOC=no -e JAVA_OPTS -v `pwd`:/workspace -v $HOME/.m2:/home/dummy/.m2 -v $HOME/.buildr:/home/dummy/.buildr -v /tmp:/tmp --entrypoint bash vanto/apache-buildr:latest-jruby-jdk7 -c "$FINAL_COMMAND"
diff --git a/dao-hibernate-db/src/main/sql/index.sql b/dao-hibernate-db/src/main/sql/index.sql
new file mode 100644
index 0000000..c99df88
--- /dev/null
+++ b/dao-hibernate-db/src/main/sql/index.sql
@@ -0,0 +1,34 @@
+
+CREATE INDEX IDX_CORRELATOR_CID on BPEL_CORRELATOR (CID);
+CREATE INDEX IDX_BPEL_CORRELATOR_PROCESS_ID on BPEL_CORRELATOR(PROCESS_ID);
+CREATE INDEX IDX_BPEL_CORRELATOR_MSG_CKEY on BPEL_CORRELATOR_MESSAGE_CKEY (CKEY);
+CREATE INDEX IDX_SELECTOR_SELGRPID on BPEL_SELECTORS (SELGRPID);
+CREATE INDEX IDX_SELECTOR_CKEY on BPEL_SELECTORS (CORRELATION_KEY);
+CREATE INDEX IDX_SELECTOR_CORRELATOR on BPEL_SELECTORS (CORRELATOR);
+CREATE INDEX IDX_SELECTOR_INSTANCE on BPEL_SELECTORS (PIID);
+CREATE INDEX IDX_BPEL_SELECTORS_PROC_TYPE on BPEL_SELECTORS(PROC_TYPE);
+CREATE INDEX IDX_UNMATCHED_CORRELATOR on BPEL_UNMATCHED (CORRELATOR);
+CREATE INDEX IDX_UNMATCHED_CKEY on BPEL_UNMATCHED (CORRELATION_KEY);
+CREATE INDEX IDX_UNMATCHED_CORRELATOR_CKEY on BPEL_UNMATCHED (CORRELATOR,CORRELATION_KEY);
+CREATE INDEX IDX_UNMATCHED_MEX on BPEL_UNMATCHED (MEX);
+CREATE INDEX IDX_XMLDATA_IID on BPEL_XML_DATA (PIID);
+CREATE INDEX IDX_XMLDATA_SID on BPEL_XML_DATA (SCOPE_ID);
+CREATE INDEX IDX_XMLDATA_NAME on BPEL_XML_DATA (NAME);
+CREATE INDEX IDX_XMLDATA_NAME_SID on BPEL_XML_DATA (NAME, SCOPE_ID);
+CREATE INDEX IDX_EVENT_IID on BPEL_EVENT (IID);
+CREATE INDEX IDX_EVENT_PID on BPEL_EVENT (PID);
+CREATE INDEX IDX_CORR_SET_NAME on BPEL_CORRELATION_SET (CORR_SET_NAME);
+CREATE INDEX IDX_CORR_SET_SCOPE_ID on BPEL_CORRELATION_SET (SCOPE_ID);
+CREATE INDEX IDX_BPEL_INSTANCE_PROCESS_ID on BPEL_INSTANCE (PROCESS_ID);
+CREATE INDEX IDX_BPEL_INSTANCE_STATE on BPEL_INSTANCE (STATE);
+CREATE INDEX IDX_BPEL_PROCESS_TYPE_NAME on BPEL_PROCESS (type_name);
+CREATE INDEX IDX_BPEL_PROCESS_TYPE_NS on BPEL_PROCESS (type_ns);
+CREATE INDEX IDX_PLINK_VAL_PROCESS_IDX on BPEL_PLINK_VAL (PROCESS);
+CREATE INDEX IDX_PLINK_VAL_SCOPE on BPEL_PLINK_VAL (SCOPE);
+CREATE INDEX IDX_PLINK_VAL_MODELID on BPEL_PLINK_VAL (MODELID);
+CREATE INDEX IDX_VARPROP_XMLDATA on VAR_PROPERTY (XML_DATA_ID);
+CREATE INDEX IDX_VARPROP_NAME on VAR_PROPERTY (PROP_NAME);
+CREATE INDEX IDX_VARPROP_VALUE on VAR_PROPERTY (PROP_VALUE);
+CREATE INDEX IDX_MESSAGE_MEX on BPEL_MESSAGE(MEX);
+CREATE INDEX IDX_MESSAGE_EXCHANGE_PIID on BPEL_MESSAGE_EXCHANGE(PIID);
+CREATE INDEX IDX_SCOPE_PIID on BPEL_SCOPE(PIID);
diff --git a/dao-hibernate-db/src/main/sql/simplesched-hsql.sql b/dao-hibernate-db/src/main/sql/simplesched-hsql.sql
index 1074afc..6ade040 100644
--- a/dao-hibernate-db/src/main/sql/simplesched-hsql.sql
+++ b/dao-hibernate-db/src/main/sql/simplesched-hsql.sql
@@ -5,9 +5,9 @@
--
CREATE TABLE ode_job (
- jobid CHAR(64) NOT NULL DEFAULT '',
+ jobid varchar(64) NOT NULL DEFAULT '',
ts BIGINT NOT NULL DEFAULT 0,
- nodeid char(64),
+ nodeid varchar(64),
scheduled int NOT NULL DEFAULT 0,
transacted int NOT NULL DEFAULT 0,
@@ -20,7 +20,7 @@
correlationKeySet varchar(255),
retryCount int,
inMem int,
- detailsExt binary(4096),
+ detailsExt blob(4096),
PRIMARY KEY(jobid));
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/CriteriaBuilder.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/CriteriaBuilder.java
index 1661bd0..c3c3d63 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/CriteriaBuilder.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/CriteriaBuilder.java
@@ -240,7 +240,7 @@
try {
dt = ISO8601DateParser.parse(date);
} catch (ParseException e) {
- e.printStackTrace();
+ __log.error(e.getMessage(), e);
}
Timestamp ts = new Timestamp(dt.getTime());
return op + " '" + ts.toString() + "'";
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelator.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelator.java
index a74a413..cc25337 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelator.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelator.java
@@ -70,7 +70,7 @@
/**
* @hibernate.property
- * @hibernate.column name="CID" index="IDX_CORRELATOR_CID"
+ * @hibernate.column name="CID"
*/
public String getCorrelatorId() {
return _correlatorId;
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessage.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessage.java
index 3b904a5..1696e46 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessage.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessage.java
@@ -54,7 +54,6 @@
/**
* @hibernate.property column="CORRELATION_KEY"
* @hibernate.column name="CORRELATION_KEY"
- * index="IDX_UNMATCHED_CKEY"
*
*/
public String getCorrelationKey() {
@@ -67,7 +66,7 @@
/**
* @hibernate.many-to-one foreign-key="none"
- * @hibernate.column name="CORRELATOR" index="IDX_UNMATCHED_CORRELATOR" not-null="true"
+ * @hibernate.column name="CORRELATOR" not-null="true"
*/
public HCorrelator getCorrelator() {
return _correlator;
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessageKey.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessageKey.java
index d64693d..910e4af 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessageKey.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorMessageKey.java
@@ -45,7 +45,6 @@
* not-null="true"
* @hibernate.column
* name="CKEY"
- * index="IDX_BPEL_CORRELATOR_MESSAGE_CKEY"
*/
public String getCanonical() {
return _keyCanonical;
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java
index d71ff55..d12f3d6 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HCorrelatorSelector.java
@@ -52,7 +52,7 @@
/**
* @hibernate.property column="SELGRPID"
- * @hibernate.column name="SELGRPID" index="IDX_SELECTOR_SELGRPID" not-null="true"
+ * @hibernate.column name="SELGRPID" not-null="true"
*/
public String getGroupId() {
return _groupId;
@@ -83,7 +83,6 @@
/**
* @hibernate.property column="CORRELATION_KEY" not-null="true"
* @hibernate.column name="CORRELATION_KEY"
- * index="IDX_SELECTOR_CKEY"
* not-null="true"
* unique-key="UNIQ_SELECTOR"
*
@@ -120,8 +119,7 @@
/**
* @hibernate.many-to-one not-null="true" foreign-key="none"
- * @hibernate.column name="CORRELATOR" not-null="true"
- * index="IDX_SELECTOR_CORRELATOR" unique-key="UNIQ_SELECTOR"
+ * @hibernate.column name="CORRELATOR" not-null="true" unique-key="UNIQ_SELECTOR"
*/
public HCorrelator getCorrelator() {
return _correlator;
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HVariableProperty.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HVariableProperty.java
index ef53974..4aa3425 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HVariableProperty.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/hobj/HVariableProperty.java
@@ -62,7 +62,6 @@
/**
* @hibernate.property
* column="PROP_VALUE"
- * index="PROP_VALUE_IDX"
*/
public String getValue() {
return _propertyValue;
@@ -77,7 +76,6 @@
* type="string"
* length="255"
* not-null="true"
- * index="PROP_NAME_IDX"
*/
public String getName() {
return _propertyName;
diff --git a/dao-jpa-ojpa-derby/src/main/descriptors/persistence.sqlserver.xml b/dao-jpa-ojpa-derby/src/main/descriptors/persistence.sqlserver.xml
new file mode 100644
index 0000000..e96094f
--- /dev/null
+++ b/dao-jpa-ojpa-derby/src/main/descriptors/persistence.sqlserver.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0">
+ <persistence-unit name="ode-unit-test-embedded">
+ <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
+ <class>org.apache.ode.dao.jpa.ActivityRecoveryDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.CorrelationSetDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.CorrelatorDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.EventDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.FaultDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageExchangeDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.MessageRouteDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.PartnerLinkDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ProcessDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ProcessInstanceDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.ScopeDAOImpl</class>
+ <class>org.apache.ode.dao.jpa.XmlDataDAOImpl</class>
+
+ <class>org.apache.ode.store.jpa.ProcessConfDaoImpl</class>
+ <class>org.apache.ode.store.jpa.ProcessConfPropertyDaoImpl</class>
+ <class>org.apache.ode.store.jpa.DeploymentUnitDaoImpl</class>
+ <class>org.apache.ode.store.jpa.VersionTrackerDAOImpl</class>
+
+ <properties>
+ <!-- Properties for an embedded Derby connection -->
+ <property name="openjpa.ConnectionDriverName" value="org.apache.commons.dbcp.BasicDataSource"/>
+ <property name="openjpa.jdbc.DBDictionary" value="org.apache.openjpa.jdbc.sql.SQLServerDictionary"/>
+ <!-- To validate DBSchema and create DDL at runtime - use this property. Currently the DDL is created at build time -->
+ <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
+
+ <property name="openjpa.ConnectionProperties"
+ value="DriverClassName=org.apache.derby.jdbc.EmbeddedDriver,Url=jdbc:derby:target/database/openjpa-test-database;create=true,MaxActive=100,MaxWait=10000,TestOnBorrow=true"/>
+
+ </properties>
+ </persistence-unit>
+</persistence>
+
diff --git a/dao-jpa-ojpa-derby/src/main/scripts/simplesched-sqlserver.sql b/dao-jpa-ojpa-derby/src/main/scripts/simplesched-sqlserver.sql
new file mode 100644
index 0000000..abe97f9
--- /dev/null
+++ b/dao-jpa-ojpa-derby/src/main/scripts/simplesched-sqlserver.sql
@@ -0,0 +1,30 @@
+-- Apache ODE - SimpleScheduler Database Schema
+--
+-- Apache Derby scripts by Maciej Szefler.
+--
+--
+
+CREATE TABLE ode_job (
+ jobid CHAR(64) NOT NULL DEFAULT '',
+ ts BIGINT NOT NULL DEFAULT 0,
+ nodeid char(64),
+ scheduled int NOT NULL DEFAULT 0,
+ transacted int NOT NULL DEFAULT 0,
+
+ instanceId BIGINT,
+ mexId varchar(255),
+ processId varchar(255),
+ type varchar(255),
+ channel varchar(255),
+ correlatorId varchar(255),
+ correlationKeySet varchar(255),
+ retryCount int,
+ inMem int,
+ detailsExt blob(4096),
+
+ PRIMARY KEY(jobid));
+
+CREATE INDEX IDX_ODE_JOB_TS ON ode_job(ts);
+CREATE INDEX IDX_ODE_JOB_NODEID ON ode_job(nodeid);
+
+
diff --git a/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/InsertObjectTest.java b/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/InsertObjectTest.java
index 6fc25e3..df35da0 100644
--- a/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/InsertObjectTest.java
+++ b/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/InsertObjectTest.java
@@ -37,7 +37,7 @@
import org.apache.ode.il.EmbeddedGeronimoFactory;
import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.GUID;
-import org.hsqldb.jdbc.jdbcDataSource;
+import org.h2.jdbcx.JdbcDataSource;
import org.xml.sax.SAXException;
import javax.sql.DataSource;
@@ -62,11 +62,10 @@
@Override
protected void setUp() throws Exception {
- jdbcDataSource hsqlds = new jdbcDataSource();
- hsqlds.setDatabase("jdbc:hsqldb:mem:" + new GUID().toString());
- hsqlds.setUser("sa");
- hsqlds.setPassword("");
- _ds = hsqlds;
+ JdbcDataSource h2 = new JdbcDataSource();
+ h2.setURL("jdbc:h2:mem:" + new GUID().toString()+";DB_CLOSE_DELAY=-1");
+ h2.setUser("sa");
+ _ds = h2;
_txm = new EmbeddedGeronimoFactory().getTransactionManager();
diff --git a/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/SelectObjectTest.java b/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/SelectObjectTest.java
index e17995f..e049a4a 100644
--- a/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/SelectObjectTest.java
+++ b/dao-jpa-ojpa-derby/src/test/java/org/apache/ode/dao/jpa/test/SelectObjectTest.java
@@ -39,7 +39,7 @@
import org.apache.ode.dao.jpa.BPELDAOConnectionFactoryImpl;
import org.apache.ode.il.EmbeddedGeronimoFactory;
import org.apache.ode.utils.GUID;
-import org.hsqldb.jdbc.jdbcDataSource;
+import org.h2.jdbcx.JdbcDataSource;
import javax.persistence.EntityManager;
import javax.sql.DataSource;
@@ -65,11 +65,10 @@
@Override
protected void setUp() throws Exception {
- jdbcDataSource hsqlds = new jdbcDataSource();
- hsqlds.setDatabase("jdbc:hsqldb:mem:" + new GUID().toString());
- hsqlds.setUser("sa");
- hsqlds.setPassword("");
- _ds = hsqlds;
+ JdbcDataSource h2 = new JdbcDataSource();
+ h2.setURL("jdbc:h2:mem:" + new GUID().toString()+";DB_CLOSE_DELAY=-1");
+ h2.setUser("sa");
+ _ds = h2;
_txm = new EmbeddedGeronimoFactory().getTransactionManager();
diff --git a/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java b/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java
index 37338ac..17e7903 100644
--- a/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java
+++ b/dao-jpa/src/main/java/org/apache/ode/dao/jpa/BPELDAOConnectionImpl.java
@@ -148,7 +148,7 @@
try {
dt = ISO8601DateParser.parse(date);
} catch (ParseException e) {
- e.printStackTrace();
+ __log.error(e.getMessage(), e);
}
Timestamp ts = new Timestamp(dt.getTime());
return op + " '" + ts.toString() + "'";
diff --git a/dependencies.rb b/dependencies.rb
index 33da5e4..f469c02 100644
--- a/dependencies.rb
+++ b/dependencies.rb
@@ -78,7 +78,12 @@
HAZELCAST ="com.hazelcast:hazelcast:jar:3.4.2"
HIBERNATE = [ "org.hibernate:hibernate-core:jar:3.3.2.GA", "javassist:javassist:jar:3.9.0.GA", "antlr:antlr:jar:2.7.6",
"asm:asm:jar:3.3.1", "cglib:cglib:jar:2.2", "net.sf.ehcache:ehcache:jar:1.2.3" ]
-HSQLDB = "hsqldb:hsqldb:jar:1.8.0.7"
+HSQLDB = "org.hsqldb:hsqldb:jar:2.3.3"
+JACKSON = [ "com.fasterxml.jackson.core:jackson-core:jar:2.4.0",
+ "com.fasterxml.jackson.core:jackson-databind:jar:2.4.0",
+ "com.fasterxml.jackson.core:jackson-annotations:jar:2.4.0",
+ "com.fasterxml.jackson.dataformat:jackson-dataformat-smile:jar:2.4.0",
+ "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.4.0"]
JACOB = "org.apache.ode:jacob:jar:2.0a-SNAPSHOT"
JAVAX = struct(
:activation =>"javax.activation:activation:jar:1.1",
@@ -105,6 +110,7 @@
:under=>"org.apache.felix", :version=>"0.6.1")
]
LOG4J = "log4j:log4j:jar:1.2.17"
+OBJECT_DIFF = "de.danielbechler:java-object-diff:jar:0.13.1"
OPENJPA = ["org.apache.openjpa:openjpa:jar:1.2.3",
"net.sourceforge.serp:serp:jar:1.13.1"]
@@ -144,7 +150,7 @@
WOODSTOX = "woodstox:wstx-asl:jar:3.2.4"
WSDL4J = "wsdl4j:wsdl4j:jar:1.6.3"
XALAN = "xalan:xalan:jar:2.7.1"
-XERCES = "xerces:xercesImpl:jar:2.9.1"
+XERCES = ["xerces:xercesImpl:jar:2.11.0", "xml-apis:xml-apis:jar:1.4.01"]
WS_COMMONS = struct(
:axiom =>AXIOM,
:neethi =>"org.apache.neethi:neethi:jar:3.0.2",
diff --git a/jbi-karaf-commands/src/main/java/org/apache/ode/karaf/commands/OdeListCommand.java b/jbi-karaf-commands/src/main/java/org/apache/ode/karaf/commands/OdeListCommand.java
index e091926..6fcd7cf 100644
--- a/jbi-karaf-commands/src/main/java/org/apache/ode/karaf/commands/OdeListCommand.java
+++ b/jbi-karaf-commands/src/main/java/org/apache/ode/karaf/commands/OdeListCommand.java
@@ -117,7 +117,7 @@
collectFailedActivities(scopeInfo, failedActivites);
}
} catch (Exception e) {
- e.printStackTrace();
+ __log.error(e.getMessage(), e);
}
return failedActivites;
}
@@ -131,7 +131,7 @@
return scopeInfoDoc.getScopeInfo();
}
} catch (Exception e) {
- e.printStackTrace();
+ __log.error(e.getMessage(), e);
}
}
return null;
diff --git a/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java b/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
index f1ac60d..c8fed8d 100644
--- a/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
+++ b/jbi/src/main/java/org/apache/ode/jbi/OdeContext.java
@@ -18,7 +18,7 @@
*/
package org.apache.ode.jbi;
-import java.io.InputStream;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -46,9 +46,9 @@
import org.apache.ode.bpel.iapi.Endpoint;
import org.apache.ode.bpel.iapi.EndpointReference;
import org.apache.ode.bpel.iapi.ProcessConf;
-import org.apache.ode.bpel.o.OPartnerLink;
-import org.apache.ode.bpel.o.OProcess;
-import org.apache.ode.bpel.o.Serializer;
+import org.apache.ode.bpel.obj.OPartnerLink;
+import org.apache.ode.bpel.obj.OProcess;
+import org.apache.ode.bpel.obj.serde.DeSerializer;
import org.apache.ode.bpel.pmapi.InstanceManagement;
import org.apache.ode.bpel.pmapi.ProcessManagement;
import org.apache.ode.jbi.msgmap.Mapper;
@@ -195,19 +195,16 @@
service = new OdeService(this, endpoint);
try {
ProcessConf pc = _store.getProcessConfiguration(pid);
- InputStream is = pc.getCBPInputStream();
+ File cbpFile = pc.getCBPFile();
OProcess compiledProcess = null;
- try {
- Serializer ofh = new Serializer(is);
- compiledProcess = ofh.readOProcess();
- } finally {
- is.close();
- }
+ DeSerializer deserializer = new DeSerializer(cbpFile);
+ compiledProcess = deserializer.deserialize();
+
QName portType = null;
for (Map.Entry<String, Endpoint> provide : pc.getProvideEndpoints().entrySet()) {
if (provide.getValue().equals(endpoint)) {
OPartnerLink plink = compiledProcess.getPartnerLink(provide.getKey());
- portType = plink.myRolePortType.getQName();
+ portType = plink.getMyRolePortType().getQName();
break;
}
}
diff --git a/jca-ra/src/main/java/org/apache/ode/ra/OdeConnectionImpl.java b/jca-ra/src/main/java/org/apache/ode/ra/OdeConnectionImpl.java
index 6c07b9c..d3b800f 100644
--- a/jca-ra/src/main/java/org/apache/ode/ra/OdeConnectionImpl.java
+++ b/jca-ra/src/main/java/org/apache/ode/ra/OdeConnectionImpl.java
@@ -100,10 +100,8 @@
String methodSig = Reflect.generateMethodSignature(method);
return mc().getTransport().invokeConnectionMethod(methodSig, args);
} catch (RuntimeException pe) {
- pe.printStackTrace();
throw new OdeConnectionException("Unexpected RuntimeException", pe);
} catch (RemoteException re) {
- re.printStackTrace();
throw new OdeConnectionException("Unexpected RemoteException.", re);
} catch (InvocationTargetException ite) {
throw ite.getTargetException();
diff --git a/repositories.rb b/repositories.rb
index e23cde1..02bec0e 100644
--- a/repositories.rb
+++ b/repositories.rb
@@ -15,5 +15,6 @@
repositories.remote << "http://repo1.maven.org/maven2"
repositories.remote << "http://people.apache.org/~vanto/m2/"
-repositories.remote << "http://repository.apache.org/content/groups/snapshots"
+repositories.remote << "https://repository.apache.org/content/groups/snapshots"
+repositories.remote << "http://spoon.gforge.inria.fr/repositories/releases"
repositories.release_to[:url] ||= "sftp://guest@localhost/home/guest"
diff --git a/scheduler-simple/src/test/java/org/apache/ode/scheduler/simple/DelegateSupport.java b/scheduler-simple/src/test/java/org/apache/ode/scheduler/simple/DelegateSupport.java
index 618a8e4..dffdb5b 100644
--- a/scheduler-simple/src/test/java/org/apache/ode/scheduler/simple/DelegateSupport.java
+++ b/scheduler-simple/src/test/java/org/apache/ode/scheduler/simple/DelegateSupport.java
@@ -48,11 +48,10 @@
}
protected void initialize(TransactionManager txm) throws Exception {
- JdbcDataSource ds = new JdbcDataSource();
- ds.setURL("jdbc:h2:mem:" + new GUID().toString() + ";DB_CLOSE_DELAY=-1");
- ds.setUser("sa");
- ds.setPassword("");
- _ds = ds;
+ JdbcDataSource h2 = new JdbcDataSource();
+ h2.setURL("jdbc:h2:mem:" + new GUID().toString()+";DB_CLOSE_DELAY=-1");
+ h2.setUser("sa");
+ _ds = h2;
setup();
_del = new JdbcDelegate(_ds);
@@ -68,7 +67,7 @@
StringBuffer sql = new StringBuffer();
{
- InputStream in = getClass().getResourceAsStream("/simplesched-hsql.sql");
+ InputStream in = getClass().getResourceAsStream("/simplesched-h2.sql");
int v;
while ((v = in.read()) != -1) {
sql.append((char) v);
diff --git a/scheduler-simple/src/test/resources/simplesched-h2.sql b/scheduler-simple/src/test/resources/simplesched-h2.sql
new file mode 100644
index 0000000..a2c0929
--- /dev/null
+++ b/scheduler-simple/src/test/resources/simplesched-h2.sql
@@ -0,0 +1,28 @@
+-- Apache ODE - SimpleScheduler Database Schema
+--
+-- Apache H2 scripts by Maciej Szefler.
+--
+--
+CREATE TABLE ODE_JOB (
+ jobid CHAR(64) NOT NULL DEFAULT '',
+ ts BIGINT NOT NULL DEFAULT 0,
+ nodeid char(64) NULL,
+ scheduled int NOT NULL DEFAULT 0,
+ transacted int NOT NULL DEFAULT 0,
+
+ instanceId BIGINT,
+ mexId varchar(255),
+ processId varchar(255),
+ type varchar(255),
+ channel varchar(255),
+ correlatorId varchar(255),
+ correlationKeySet varchar(255),
+ retryCount int,
+ inMem int,
+ detailsExt blob(4096),
+
+ PRIMARY KEY(jobid)
+);
+
+create index IDX_ODE_JOB_TS on ODE_JOB(ts);
+create index IDX_ODE_JOB_NODEID on ODE_JOB(nodeid);
\ No newline at end of file
diff --git a/scheduler-simple/src/test/resources/simplesched-hsql.sql b/scheduler-simple/src/test/resources/simplesched-hsql.sql
index 8edaec7..b62a1b4 100644
--- a/scheduler-simple/src/test/resources/simplesched-hsql.sql
+++ b/scheduler-simple/src/test/resources/simplesched-hsql.sql
@@ -1,7 +1,7 @@
CREATE TABLE ode_job (
- jobid CHAR(64) NOT NULL,
+ jobid varchar(64) NOT NULL DEFAULT '',
ts BIGINT NOT NULL,
- nodeid char(64),
+ nodeid varchar(64),
scheduled int NOT NULL,
transacted int NOT NULL,
@@ -14,7 +14,7 @@
correlationKeySet varchar(255),
retryCount int,
inMem int,
- detailsExt binary(4096),
+ detailsExt blob(4096),
PRIMARY KEY(jobid));
diff --git a/schema-updates/ODE-1035.sql b/schema-updates/ODE-1035.sql
new file mode 100644
index 0000000..800ed2e
--- /dev/null
+++ b/schema-updates/ODE-1035.sql
@@ -0,0 +1,26 @@
+# USE COLUMN TYPE FOR COLUMN "DATA" FOR THE RELEVANT DATABASE
+#Mysql TEXT
+#SQLServer TEXT
+#Postgres TEXT
+#Oracle CLOB
+#H2 CLOB
+#Derby CLOB
+#HSQL LONGVARCHAR
+
+
+
+#Hibernate MYSQL Script
+ALTER TABLE STORE_PROCESS_PROP ADD COLUMN DATA TEXT;
+CREATE TABLE STORE_PROCESS_PROP_TEST SELECT * FROM STORE_PROCESS_PROP;
+UPDATE STORE_PROCESS_PROP A SET A.DATA=(SELECT VALUE FROM STORE_PROCESS_PROP_TEST WHERE PROPID=A.PROPID AND NAME=A.NAME);
+DROP TABLE STORE_PROCESS_PROP_TEST;
+ALTER TABLE STORE_PROCESS_PROP DROP COLUMN VALUE;
+
+
+#OpenJPA MYSQL Script
+ALTER TABLE STORE_PROCESS_PROP ADD COLUMN DATA TEXT;
+CREATE TABLE STORE_PROCESS_PROP_TEST SELECT * FROM STORE_PROCESS_PROP;
+UPDATE STORE_PROCESS_PROP A SET A.DATA=(SELECT PROP_VAL FROM STORE_PROCESS_PROP_TEST WHERE ID=A.ID);
+DROP TABLE STORE_PROCESS_PROP_TEST;
+ALTER TABLE STORE_PROCESS_PROP DROP COLUMN PROP_VAL;
+
diff --git a/tasks/pomwithdependencies.rake b/tasks/pomwithdependencies.rake
new file mode 100644
index 0000000..03b6371
--- /dev/null
+++ b/tasks/pomwithdependencies.rake
@@ -0,0 +1,83 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with this
+# work for additional information regarding copyright ownership. The ASF
+# licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations under
+# the License.
+
+module Buildr
+
+ #
+ # Module to add project dependencies to our artifact's pom files.
+ # Inspired by BUILDR-486 and https://github.com/jvshahid/buildr-dependency-extensions.
+ #
+ module PomWithDependencies
+ include Extension
+
+ # We have to add the dependencies to the monkey patched POM before the dependencies are
+ # changed in the compile, test and run after_define
+ after_define(:compile) do |project|
+ deps =
+ [project.compile.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash)}.map { |a| a.to_hash.merge(:scope => 'compile') },
+ project.test.dependencies.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'test') },
+ project.run.classpath.select {|dep| dep.respond_to?(:to_spec) && dep.respond_to?(:to_hash) && !project.compile.dependencies.include?(dep)}.map { |a| a.to_hash.merge(:scope => 'runtime') }
+ ].flatten
+
+ project.packages.each {|pack| pack.pom.dependencies = deps}
+ end
+ end
+
+ module ActsAsArtifact
+ # monkey patch Buildr's the pom xml generation
+ def pom_xml
+ Proc.new do
+ xml = Builder::XmlMarkup.new(:indent=>2)
+ xml.instruct!
+ xml.project do
+ xml.modelVersion '4.0.0'
+ xml.groupId group
+ xml.artifactId id
+ xml.version version
+ xml.classifier classifier if classifier
+ unless @dependencies.nil? || @dependencies.empty?
+ xml.dependencies do
+ @dependencies.uniq.each do |art|
+ xml.dependency do
+ xml.groupId art[:group]
+ xml.artifactId art[:id]
+ xml.version art[:version]
+ xml.classifier art[:classifier] if art.has_key? :classifier
+ xml.scope art[:scope] if art.has_key? :scope
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+
+ # make ActAsArtifac dependency aware
+ def dependencies=(dependencies)
+ @dependencies = dependencies
+ end
+
+ def dependencies
+ @dependencies ||= POM.load(self).dependencies.map { |spec| artifact(spec) } if self.is_a? Artifact
+ @dependencies ||= []
+ end
+
+ end
+end
+
+# use this module for all projects.
+class Buildr::Project
+ include Buildr::PomWithDependencies
+end
diff --git a/tools/src/main/java/org/apache/ode/tools/bpelc/cline/BpelC.java b/tools/src/main/java/org/apache/ode/tools/bpelc/cline/BpelC.java
index f351578..4d4831c 100644
--- a/tools/src/main/java/org/apache/ode/tools/bpelc/cline/BpelC.java
+++ b/tools/src/main/java/org/apache/ode/tools/bpelc/cline/BpelC.java
@@ -104,7 +104,7 @@
// This is really quite unexpected, so we should
// print the stack trace to stderr.
consoleErr(t.getMessage());
- t.printStackTrace();
+ __log.error(t.getMessage(), t);
System.exit(-2);
}
System.exit(0);
diff --git a/tools/src/main/java/org/apache/ode/tools/sendsoap/cline/HttpSoapSender.java b/tools/src/main/java/org/apache/ode/tools/sendsoap/cline/HttpSoapSender.java
index 59e98c1..d494d0e 100644
--- a/tools/src/main/java/org/apache/ode/tools/sendsoap/cline/HttpSoapSender.java
+++ b/tools/src/main/java/org/apache/ode/tools/sendsoap/cline/HttpSoapSender.java
@@ -122,6 +122,7 @@
httpPostMethod.setRequestHeader("SOAPAction", "\"" + soapAction + "\"");
httpPostMethod.setRequestHeader("Content-Type", "text/xml");
httpPostMethod.setRequestEntity(new StringRequestEntity(sb.toString()));
+ mgr.getParams().setSoTimeout(10000);
httpClient.executeMethod(httpPostMethod);
return httpPostMethod.getResponseBodyAsString() + "\n";
} finally {
diff --git a/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java b/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
index 78e63ea..072a990 100644
--- a/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
+++ b/utils/src/main/java/org/apache/ode/utils/xsd/SchemaModelImpl.java
@@ -18,9 +18,21 @@
*/
package org.apache.ode.utils.xsd;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.xerces.dom.DOMInputImpl;
import org.apache.xerces.impl.Constants;
import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.impl.xs.util.LSInputListImpl;
import org.apache.xerces.xni.XMLResourceIdentifier;
import org.apache.xerces.xni.XNIException;
import org.apache.xerces.xni.parser.XMLEntityResolver;
@@ -28,20 +40,10 @@
import org.apache.xerces.xs.LSInputList;
import org.apache.xerces.xs.XSModel;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.DOMErrorHandler;
import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
import org.w3c.dom.ls.LSInput;
-import javax.xml.namespace.QName;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
/**
* Xerces based schema model.
*/
@@ -79,18 +81,14 @@
++idx;
}
- LSInputList list = new LSInputList() {
- public LSInput item(int index) {
- DOMInputImpl input = new DOMInputImpl();
- input.setSystemId(uris[index]);
- input.setByteStream(new ByteArrayInputStream(content[index]));
- return input;
- }
-
- public int getLength() {
- return uris.length;
- }
- };
+ LSInput[] inputs = new LSInput[uris.length];
+ for (int index = 0; index < uris.length; index++) {
+ DOMInputImpl input = new DOMInputImpl();
+ input.setSystemId(uris[index]);
+ input.setByteStream(new ByteArrayInputStream(content[index]));
+ inputs[index] = input;
+ }
+ LSInputList list = new LSInputListImpl(inputs, inputs.length);
XSModel xsm = schemaLoader.loadInputList(list);
return new SchemaModelImpl(xsm);
diff --git a/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java b/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
index 841bf00..0c2cc26 100644
--- a/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
+++ b/utils/src/main/java/org/apache/ode/utils/xsd/XSUtils.java
@@ -18,18 +18,6 @@
*/
package org.apache.ode.utils.xsd;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.utils.msg.MessageBundle;
-import org.apache.xerces.dom.DOMInputImpl;
-import org.apache.xerces.impl.xs.XMLSchemaLoader;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLErrorHandler;
-import org.apache.xerces.xni.parser.XMLParseException;
-import org.apache.xerces.xs.XSModel;
-import org.w3c.dom.ls.LSInput;
-
import java.io.ByteArrayInputStream;
import java.net.URI;
import java.util.ArrayList;
@@ -37,6 +25,21 @@
import java.util.List;
import java.util.Map;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.utils.msg.MessageBundle;
+import org.apache.xerces.dom.DOMInputImpl;
+import org.apache.xerces.impl.Constants;
+import org.apache.xerces.impl.xs.XMLSchemaLoader;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLErrorHandler;
+import org.apache.xerces.xni.parser.XMLParseException;
+import org.apache.xerces.xs.XSModel;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.ls.LSInput;
+
/**
* Various utility methods related to XML Schema processing.
@@ -93,6 +96,9 @@
LoggingXmlErrorHandler eh = new LoggingXmlErrorHandler(__log);
schemaLoader.setErrorHandler(eh);
+ LoggingDOMErrorHandler deh = new LoggingDOMErrorHandler(__log);
+ schemaLoader.setParameter(Constants.DOM_ERROR_HANDLER, deh);
+
XSModel model = schemaLoader.load(input);
// The following mess is due to XMLSchemaLoaders funkyness in error
@@ -103,15 +109,26 @@
* Someone inside Xerces will have eaten this exception, for no good
* reason.
*/
+ XsdException ex = null;
+
List<XMLParseException> errors = eh.getErrors();
if (errors.size() != 0) {
__log.error("captureSchema: XMLParseException(s) in " + input);
- XsdException ex = null;
for (XMLParseException xpe : errors) {
ex = new XsdException(ex, xpe.getMessage(), xpe.getLineNumber(), xpe.getColumnNumber(),
xpe.getLiteralSystemId());
}
+ }
+
+ List<Exception> exceptions = deh.getExceptions();
+ if (exceptions.size() != 0) {
+ for (Exception e : exceptions) {
+ ex = new XsdException(ex, e.getMessage());
+ }
+ }
+
+ if (ex != null) {
throw ex;
}
@@ -188,4 +205,29 @@
throw new XNIException("Unknown XSD error state; domain=" + domain + ", key=" +key);
}
}
+
+ static class LoggingDOMErrorHandler implements DOMErrorHandler {
+
+ private ArrayList<Exception> _exceptions = new ArrayList<Exception>();
+ private Log _log;
+
+ public LoggingDOMErrorHandler(Log log) {
+ assert log != null;
+ _log = log;
+ }
+
+ public boolean handleError(DOMError error) {
+ if (_log.isDebugEnabled()) {
+ _log.debug("Exception occurred during parsing schema: " + error.getMessage());
+ }
+ if (error != null) {
+ _exceptions.add((Exception) error.getRelatedException());
+ }
+ return false;
+ }
+
+ public ArrayList<Exception> getExceptions() {
+ return _exceptions;
+ }
+ }
}
diff --git a/utils/src/main/java/org/apache/ode/utils/xsd/XsdException.java b/utils/src/main/java/org/apache/ode/utils/xsd/XsdException.java
index ad7e16b..e82cab3 100644
--- a/utils/src/main/java/org/apache/ode/utils/xsd/XsdException.java
+++ b/utils/src/main/java/org/apache/ode/utils/xsd/XsdException.java
@@ -58,6 +58,11 @@
_systemId = literalSystemId;
_previous = previous;
}
+
+ public XsdException(XsdException previous, String message) {
+ super(__msgs.msgXsdExceptionMessage(message));
+ _message = message;
+ }
public String getDetailMessage() {
return _message;
diff --git a/utils/src/main/java/org/apache/ode/utils/xsd/XsdMessages.java b/utils/src/main/java/org/apache/ode/utils/xsd/XsdMessages.java
index f91a396..a3051ac 100644
--- a/utils/src/main/java/org/apache/ode/utils/xsd/XsdMessages.java
+++ b/utils/src/main/java/org/apache/ode/utils/xsd/XsdMessages.java
@@ -100,6 +100,10 @@
systemId, lineNumber, columnNumber);
}
+ public String msgXsdExceptionMessage(String message) {
+ return this.format("Unable to process XML Schema: {0}", message);
+ }
+
/** An unknown error occured processing schema at {0}" */
public String msgXsdUnknownError(String systemId) {
return this.format("An unknown error occured processing schema at {0}", systemId);
diff --git a/utils/src/test/java/org/apache/ode/utils/xsd/SchemaCaptureTest.java b/utils/src/test/java/org/apache/ode/utils/xsd/SchemaCaptureTest.java
index c0ff13d..aa09424 100644
--- a/utils/src/test/java/org/apache/ode/utils/xsd/SchemaCaptureTest.java
+++ b/utils/src/test/java/org/apache/ode/utils/xsd/SchemaCaptureTest.java
@@ -18,14 +18,7 @@
*/
package org.apache.ode.utils.xsd;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.ode.utils.StreamUtils;
-import org.apache.ode.utils.TestResources;
-import org.apache.xerces.xni.XMLResourceIdentifier;
-import org.apache.xerces.xni.XNIException;
-import org.apache.xerces.xni.parser.XMLEntityResolver;
-import org.apache.xerces.xni.parser.XMLInputSource;
+import static org.junit.Assert.*;
import java.io.FileInputStream;
import java.io.IOException;
@@ -35,37 +28,70 @@
import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.utils.StreamUtils;
+import org.apache.ode.utils.TestResources;
+import org.apache.xerces.xni.XMLResourceIdentifier;
+import org.apache.xerces.xni.XNIException;
+import org.apache.xerces.xni.parser.XMLEntityResolver;
+import org.apache.xerces.xni.parser.XMLInputSource;
+import org.junit.Test;
+
/**
* Test schema capture functionality.
*/
-public class SchemaCaptureTest extends TestCase {
+public class SchemaCaptureTest {
private static Log __log = LogFactory.getLog(SchemaCaptureTest.class);
- public void testSchemaCapture() throws Exception {
- __log.debug("GETTING RESOURCE " + TestResources.getRetailerSchema());
- InputStream xsdStream = TestResources.getRetailerSchema().openStream();
- byte[] data;
- try {
- data = StreamUtils.read(xsdStream);
- } finally {
- xsdStream.close();
+ @Test
+ public void testSchemaCapture() throws Exception {
+ __log.debug("GETTING RESOURCE " + TestResources.getRetailerSchema());
+ InputStream xsdStream = TestResources.getRetailerSchema().openStream();
+ byte[] data;
+ try {
+ data = StreamUtils.read(xsdStream);
+ } finally {
+ xsdStream.close();
+ }
+
+ Map<URI, byte[]> s = XSUtils.captureSchema(URI.create("schema.xsd"), data, new XMLEntityResolver() {
+ public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
+ XMLInputSource src = new XMLInputSource(resourceIdentifier);
+ String literalUri = resourceIdentifier.getLiteralSystemId();
+
+ if (literalUri != null) {
+ src.setByteStream(getClass().getClassLoader().getResourceAsStream(literalUri));
+ }
+
+ return src;
+ }
+ }, 0);
+ // we expect the root schema and three includes
+ __log.debug("loaded " + s.keySet());
+ assertEquals(5, s.size());
}
- Map<URI, byte[]> s = XSUtils.captureSchema(URI.create("schema.xsd"), data, new XMLEntityResolver() {
- public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
- XMLInputSource src = new XMLInputSource(resourceIdentifier);
- String literalUri = resourceIdentifier.getLiteralSystemId();
-
- if (literalUri != null) {
- src.setByteStream(getClass().getClassLoader().getResourceAsStream(literalUri));
- }
-
- return src;
+ /**
+ * Test for ODE-1019, provided by Igor Vorobiov
+ */
+ @Test(expected = Exception.class)
+ public void testSchemaCaptureException() throws Exception {
+ InputStream xsdStream = new FileInputStream(TestResources.getRetailerSchema().getFile());
+ byte[] data;
+ try {
+ data = StreamUtils.read(xsdStream);
+ } finally {
+ xsdStream.close();
}
- }, 0);
- // we expect the root schema and three includes
- __log.debug("loaded " + s.keySet());
- assertEquals(5, s.size());
- }
+ XSUtils.captureSchema(URI.create("schema.xsd"), data, new XMLEntityResolver() {
+ public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException {
+ // !!! cause NullPointerException
+ return null;
+ }
+ }, 0);
+
+ __log.error("mustn't reach this place");
+ }
}