ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mszef...@apache.org
Subject svn commit: r546203 - /incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
Date Mon, 11 Jun 2007 17:08:09 GMT
Author: mszefler
Date: Mon Jun 11 10:08:08 2007
New Revision: 546203

URL: http://svn.apache.org/viewvc?view=rev&rev=546203
Log:
Allow user to specify WSDL file for BPEL 1.1 processes in the deployment 
descriptor. 


Modified:
    incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java

Modified: incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java?view=diff&rev=546203&r1=546202&r2=546203
==============================================================================
--- incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
(original)
+++ incubator/ode/trunk/bpel-store/src/main/java/org/apache/ode/store/DeploymentUnitDir.java
Mon Jun 11 10:08:08 2007
@@ -147,6 +147,12 @@
 
     private void compile(File bpelFile) {
         BpelC bpelc = BpelC.newBpelCompiler();
+        
+        // BPEL 1.1 does not suport the <import> element, so "global" WSDL needs to
be configured explicitly.
+        File bpel11wsdl = findBpel11Wsdl(bpelFile);
+        if (bpel11wsdl != null)
+            bpelc.setProcessWSDL(bpel11wsdl.toURI());
+        
         bpelc.setCompileProperties(prepareCompileProperties(bpelFile));
         try {
             bpelc.compile(bpelFile);
@@ -313,6 +319,9 @@
     private Map<String, Object> prepareCompileProperties(File bpelFile) {
         List<Process> plist = getDeploymentDescriptor().getDeploy().getProcessList();
         for (Process process : plist) {
+            if (process.getFileName() == null || "".equals(process.getFileName()))
+                continue;
+            
             if (bpelFile.getName().equals(process.getFileName())) {
                 Map<QName, Node> props = ProcessStoreImpl.calcInitialProperties(process);
                 Map<String, Object> result = new HashMap<String, Object>();
@@ -323,6 +332,27 @@
         return null;
     }
 
+    
+    /**
+     * Figure out the name of the WSDL file for a BPEL 1.1 process. 
+     * @param bpelFile BPEL process file name
+     * @return file name of the WSDL, or null if none specified.
+     */
+    private File findBpel11Wsdl(File bpelFile) {
+        List<Process> plist = getDeploymentDescriptor().getDeploy().getProcessList();
+        for (Process process : plist) {
+            if (process.getFileName() == null || "".equals(process.getFileName()))
+                continue;
+            if (!bpelFile.getName().equals(process.getFileName()))
+                continue;
+            if (process.getBpel11WsdlFileName() == null || "".equals(process.getBpel11WsdlFileName()))
+                return null;
+            
+            return new File(bpelFile.getParentFile(), process.getBpel11WsdlFileName());
+        }
+        return null;
+    }
+    
     public long getVersion() {
         return _version;
     }



Mime
View raw message