You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by mr...@apache.org on 2008/05/21 19:27:37 UTC
svn commit: r658773 - in /ode/trunk:
bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/
bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/
bpel-test/src/test/java/org/apache/ode/test/
bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/
Author: mriou
Date: Wed May 21 10:27:36 2008
New Revision: 658773
URL: http://svn.apache.org/viewvc?rev=658773&view=rev
Log:
ODE289 Compiler doesn't properly flag outgoing links from structured activities. A bit more logging on runtime links handling.
Added:
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.bpel
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.wsdl
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/deploy.xml
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/soapRequest.txt
ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/test.properties
Modified:
ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?rev=658773&r1=658772&r2=658773&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java Wed May 21 10:27:36 2008
@@ -966,6 +966,7 @@
.getTransitionCondition());
_structureStack.topActivity().sourceLinks.add(ol);
+ _structureStack.topActivity().outgoingLinks.add(ol);
}
private void compile(final PartnerLink plink) {
@@ -1045,23 +1046,19 @@
if (newtop != null) {
newtop.nested.add(popped);
- // Transfer outgoing and incoming links, excluding the locally
- // defined links.
+ // 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);
+ if (newtop instanceof OFlow) newtop.incomingLinks.removeAll(((OFlow) newtop).localLinks);
newtop.outgoingLinks.addAll(popped.outgoingLinks);
- if (newtop instanceof OFlow)
- newtop.outgoingLinks.removeAll(((OFlow) newtop).localLinks);
+ if (newtop instanceof OFlow) newtop.outgoingLinks.removeAll(((OFlow) newtop).localLinks);
// Transfer variables read/writen
newtop.variableRd.addAll(popped.variableRd);
newtop.variableWr.addAll(popped.variableWr);
}
- if (topScope != null && popped instanceof OScope)
- topScope.compensatable.add((OScope) popped);
+ if (topScope != null && popped instanceof OScope) topScope.compensatable.add((OScope) popped);
}
}
@@ -1323,6 +1320,7 @@
if (oscope.getLocalVariable(src.getName()) != null)
throw new CompilationException(__cmsgs.errDuplicateVariableDecl(src.getName()).setSource(src));
+ if (src.getTypeName() == null) throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(src.getName()));
OVarType varType;
switch (src.getKind()) {
case ELEMENT:
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java?rev=658773&r1=658772&r2=658773&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java Wed May 21 10:27:36 2008
@@ -113,8 +113,10 @@
protected void dpe(Collection<OLink> links) {
// Dead path all of the outgoing links (nothing has been activated yet!)
- for (Iterator<OLink> i = links.iterator(); i.hasNext();)
- _linkFrame.resolve(i.next()).channel.linkStatus(false);
+ for (OLink link : links) {
+ if (__log.isDebugEnabled()) __log.debug("DPE on link " + link.name);
+ _linkFrame.resolve(link).pub.linkStatus(false);
+ }
}
protected OConstants getConstants() {
Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java?rev=658773&r1=658772&r2=658773&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java Wed May 21 10:27:36 2008
@@ -92,7 +92,7 @@
if (_oactivity.suppressJoinFailure) {
_self.parent.completed(null, CompensationHandler.emptySet());
if (__log.isDebugEnabled())
- __log.debug("Join condition false, suppress join failureon activity " + _self.aId);
+ __log.debug("Join condition false, suppress join failure on activity " + _self.aId);
} else {
FaultData fault = null;
fault = createFault(_oactivity.getOwner().constants.qnJoinFailure,_oactivity);
@@ -110,12 +110,11 @@
public void terminate() {
// Complete immediately, without faulting or registering any comps.
_self.parent.completed(null, CompensationHandler.emptySet());
-
// Dead-path activity
dpe(_oactivity);
}
});
- for (Iterator<OLink> i = _oactivity.targetLinks.iterator();i.hasNext();) {
+ for (final OLink link : _oactivity.targetLinks) {
final OLink link = i.next();
mlset.add(new LinkStatusChannelListener(_linkFrame.resolve(link).channel) {
private static final long serialVersionUID = 1024137371118887935L;
Modified: ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java?rev=658773&r1=658772&r2=658773&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java (original)
+++ ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java Wed May 21 10:27:36 2008
@@ -29,6 +29,10 @@
// Test Flow with XPath10
go("/bpel/2.0/TestFlowActivity2");
}
+ @Test public void testFlowLinks() throws Throwable {
+ // Test Flow with XPath10
+ go("/bpel/2.0/TestFlowLinks");
+ }
@Test public void testIsolatedScopes1() throws Throwable {
// Test Flow with XPath10
Added: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.bpel?rev=658773&view=auto
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.bpel (added)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.bpel Wed May 21 10:27:36 2008
@@ -0,0 +1,92 @@
+<?xml version="1.0"?>
+<bpel:process xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
+ xmlns:saw="workflowns"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ name="TestCase" targetNamespace="workflowns"
+ queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
+ suppressJoinFailure="no" exitOnStandardFault="no" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable">
+ <bpel:import namespace="workflowns" location="TestCase.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" />
+ <bpel:partnerLinks>
+ <bpel:partnerLink name="TestCase" partnerLinkType="saw:TestCase" myRole="WorkflowRole" />
+ </bpel:partnerLinks>
+ <bpel:variables>
+ <bpel:variable name="In" messageType="saw:ExecuteWorkflowSoapIn" />
+ </bpel:variables>
+ <bpel:sequence name="Outer_Workflow">
+ <bpel:receive name="Receive" partnerLink="TestCase" portType="saw:Workflow" operation="ExecuteWorkflow" variable="In" createInstance="yes"/>
+ <bpel:flow name="EndlessRunningFlowOfPain">
+ <bpel:links>
+ <bpel:link name="transition1"/>
+ <bpel:link name="transition2"/>
+ <bpel:link name="transition3"/>
+ <bpel:link name="transition4" />
+ <bpel:link name="test_foo" />
+ </bpel:links>
+ <bpel:sequence name="State-Actioning_Start">
+ <bpel:sources>
+ <bpel:source linkName="transition1" />
+ </bpel:sources>
+ <bpel:empty/>
+ </bpel:sequence>
+ <bpel:if name="TransitionResolver">
+ <bpel:targets>
+ <bpel:target linkName="transition1" />
+ </bpel:targets>
+ <bpel:condition>false()</bpel:condition>
+ <bpel:empty>
+ <bpel:sources>
+ <bpel:source linkName="transition2" />
+ </bpel:sources>
+ </bpel:empty>
+ <bpel:elseif>
+ <bpel:condition>true()</bpel:condition>
+ <bpel:empty>
+ <bpel:sources>
+ <bpel:source linkName="test_foo" />
+ </bpel:sources>
+ </bpel:empty>
+ </bpel:elseif>
+ <bpel:else>
+ <bpel:throw faultName="saw:TransitionConditionOutOfRangeException" />
+ </bpel:else>
+ </bpel:if>
+ <bpel:empty name="test_foo_flow">
+ <bpel:targets>
+ <bpel:target linkName="test_foo" />
+ </bpel:targets>
+ <bpel:empty/>
+ </bpel:empty>
+ <bpel:sequence name="State-Inbound_Workflows_Selectors" suppressJoinFailure="yes">
+ <bpel:targets>
+ <bpel:target linkName="transition2" />
+ </bpel:targets>
+ <bpel:sources>
+ <bpel:source linkName="transition3" />
+ </bpel:sources>
+ <bpel:empty/>
+ </bpel:sequence>
+ <bpel:if name="TransitionResolver2" suppressJoinFailure="yes">
+ <bpel:targets>
+ <bpel:target linkName="transition3" />
+ </bpel:targets>
+ <bpel:condition> true() </bpel:condition>
+ <bpel:empty name="should-be-dpe">
+ <bpel:sources>
+ <bpel:source linkName="transition4" />
+ </bpel:sources>
+ </bpel:empty>
+ <bpel:else>
+ <bpel:empty />
+ </bpel:else>
+ </bpel:if>
+ <bpel:sequence name="State-Simple_Inbound" suppressJoinFailure="yes">
+ <bpel:targets>
+ <bpel:target linkName="transition4" />
+ </bpel:targets>
+ <bpel:empty />
+ </bpel:sequence>
+ </bpel:flow>
+ <bpel:reply name="Reply" partnerLink="TestCase" portType="saw:Workflow" operation="ExecuteWorkflow" variable="In"/>
+ </bpel:sequence>
+</bpel:process>
\ No newline at end of file
Added: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.wsdl
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.wsdl?rev=658773&view=auto
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.wsdl (added)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/TestCase.wsdl Wed May 21 10:27:36 2008
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="TestCase"
+ xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:saw="workflowns"
+ xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="workflowns"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="workflowns">
+ <xsd:element name="ExecuteWorkflow">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="ExecuteWorkflowResponse">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="ExecuteWorkflowSoapIn">
+ <wsdl:part name="parameters" element="saw:ExecuteWorkflow"/>
+ </wsdl:message>
+ <wsdl:message name="ExecuteWorkflowSoapOut">
+ <wsdl:part name="parameters" element="saw:ExecuteWorkflowResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="Workflow">
+ <wsdl:operation name="ExecuteWorkflow">
+ <wsdl:input message="saw:ExecuteWorkflowSoapIn"/>
+ <wsdl:output message="saw:ExecuteWorkflowSoapIn"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="WorkflowSOAP" type="saw:Workflow">
+ <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="ExecuteWorkflow">
+ <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="workflowns/ExecuteWorkflow"/>
+ <wsdl:input>
+ <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="TestCase">
+ <wsdl:port name="Workflow" binding="saw:WorkflowSOAP">
+ <soap:address location="http://localhost:8080/ode/processes/TestCase"/>
+ </wsdl:port>
+ </wsdl:service>
+ <plnk:partnerLinkType name="TestCase">
+ <plnk:role name="WorkflowRole" portType="saw:Workflow"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
\ No newline at end of file
Added: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/deploy.xml
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/deploy.xml?rev=658773&view=auto
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/deploy.xml (added)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/deploy.xml Wed May 21 10:27:36 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<deploy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.apache.org/ode/schemas/dd/2007/03">
+ <process xmlns:q1="workflowns" name="q1:TestCase">
+ <provide partnerLink="TestCase">
+ <service name="q1:TestCase" port="Workflow" />
+ </provide>
+ </process>
+ <process-events>
+ <enable-event>dataHandling</enable-event>
+ <enable-event>activityLifecycle</enable-event>
+ </process-events>
+</deploy>
\ No newline at end of file
Added: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/soapRequest.txt
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/soapRequest.txt?rev=658773&view=auto
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/soapRequest.txt (added)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/soapRequest.txt Wed May 21 10:27:36 2008
@@ -0,0 +1,6 @@
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+ <!-- test soap message -->
+ <SOAP-ENV:Body>
+ <ns1:ExecuteWorkflow xmlns:ns1="workflowns"><value>foo</value></ns1:ExecuteWorkflow>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
Added: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/test.properties
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/test.properties?rev=658773&view=auto
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/test.properties (added)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowLinks/test.properties Wed May 21 10:27:36 2008
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+namespace=workflowns
+service=TestCase
+operation=ExecuteWorkflow
+request1=<message><parameters><ns1:ExecuteWorkflow xmlns:ns1="workflowns"><value>foo</value></ns1:ExecuteWorkflow></parameters></message>
+response1=.*