You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by seriousme <se...@orange.fr> on 2008/08/24 18:38:35 UTC

How to throw an anonymous fault ?

Hi,

trying to throw a fault inside a process it appears that it is never caught
even with a "catchAll" activity.

This very basic process shows the problem :
<?xml version="1.0" encoding="utf-8" ?>
<wsbpel:process
	name="testerProcess"

	xmlns:wsbpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable"

	targetNamespace="http://services"
	xmlns:tns="http://services"
>

	<wsbpel:import importType="http://schemas.xmlsoap.org/wsdl/"
location="tester.wsdl"	namespace="http://services" />

	<wsbpel:partnerLinks>
		<wsbpel:partnerLink name="linkToClient"
partnerLinkType="tns:testerLinkType"	myRole="tester"/>
	</wsbpel:partnerLinks>

	<wsbpel:variables>
		<wsbpel:variable	name="input"	messageType="tns:testInput" />
		<wsbpel:variable	name="output"	messageType="tns:testOutput" />
	</wsbpel:variables>

	<wsbpel:faultHandlers>
		<!--<wsbpel:catch faultName="fault0">
			<wsbpel:assign>
				<wsbpel:copy>
					<wsbpel:from>'fault0 caught'</wsbpel:from>
					<wsbpel:to>$output.result</wsbpel:to>
				</wsbpel:copy>
			</wsbpel:assign>
			<wsbpel:reply partnerLink="linkToClient" portType="tns:testerPortType"
operation="test" variable="output" />
		</wsbpel:catch>
		<wsbpel:catch faultName="fault1">
			<wsbpel:assign>
				<wsbpel:copy>
					<wsbpel:from>'fault1 caught'</wsbpel:from>
					<wsbpel:to>$output.result</wsbpel:to>
				</wsbpel:copy>
			</wsbpel:assign>
			<wsbpel:reply partnerLink="linkToClient" portType="tns:testerPortType"
operation="test" variable="output" />
		</wsbpel:catch>-->
		<wsbpel:catchAll>
			<wsbpel:assign>
				<wsbpel:copy>
					<wsbpel:from>'fault caught'</wsbpel:from>
					<wsbpel:to>$output.result</wsbpel:to>
				</wsbpel:copy>
			</wsbpel:assign>
			<wsbpel:reply partnerLink="linkToClient" portType="tns:testerPortType"
operation="test" variable="output" />
		</wsbpel:catchAll>
	</wsbpel:faultHandlers>

	<wsbpel:sequence>
		<wsbpel:receive createInstance="yes" partnerLink="linkToClient"
portType="tns:testerPortType" operation="test" variable="input" />

		<wsbpel:if>
			<wsbpel:condition>string($input.data) = '0'</wsbpel:condition>
			<wsbpel:then>
				<wsbpel:throw faultName="fault0" />
			</wsbpel:then>
			<wsbpel:elseif>
				<wsbpel:condition>string($input.data) = '1'</wsbpel:condition>
				<wsbpel:throw faultName="fault1" />
			</wsbpel:elseif>
			<wsbpel:else>
				<!--<wsbpel:throw faultName="fault2" />-->
				<wsbpel:empty/>
			</wsbpel:else>
		</wsbpel:if>
		<wsbpel:assign>
			<wsbpel:copy>
				<wsbpel:from>'Test'</wsbpel:from>
				<wsbpel:to>$output.result</wsbpel:to>
			</wsbpel:copy>
		</wsbpel:assign>
		<wsbpel:reply partnerLink="linkToClient" portType="tns:testerPortType"
operation="test" variable="output" />
	</wsbpel:sequence>

</wsbpel:process>

When invoked with a value that provoke an exception, that is "0" and "1",
nothing is replied to the client and the process seems to do nothing.
The behavior is normal when invoked with other values, that is the value
'Test' is returned.

The problem comes, of course, from the misuse of the "throw...catch"
feature, particularly from the non definition of the faults.

So two questions :
Is there a way to throw anonymous, that is non defined, fault the way it is
done in this process ?
If not, how to properly use the WS-BPEL throw-catch construct, particularly
how to declare the faults which names will go into "faultName" attribute of
the "throw" and "catch" ?

Thanks by advance for your help.
-- 
View this message in context: http://www.nabble.com/How-to-throw-an-anonymous-fault---tp19132119p19132119.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: ODE 1.2 artifacts cannot be obtained from Maven repositories

Posted by Matthieu Riou <ma...@offthelip.org>.
On Mon, Aug 25, 2008 at 5:39 AM, Nowakowski, Mateusz <
Mateusz.Nowakowski@sabre-holdings.com> wrote:

> Hi,
>
>
>
> ODE 1.2 artifacts cannot be downloaded from
>
>
>
> http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/ode
> /
>
> neither from
>
> http://repo1.maven.org/maven2/org/apache/ode/
>
>
I always manage to forget Maven repositories when I release, sorry about
that. I've just rsync'd it so give it a few hours to get mirrored to
maven.org and ibiblio.

Thanks,
Matthieu


>
>
>
>
> --
>
> Regards
>
> Mateusz Nowakowski
>
>

ODE 1.2 artifacts cannot be obtained from Maven repositories

Posted by "Nowakowski, Mateusz" <Ma...@sabre-holdings.com>.
Hi,

 

ODE 1.2 artifacts cannot be downloaded from

 

http://people.apache.org/repo/m2-ibiblio-rsync-repository/org/apache/ode
/

neither from

http://repo1.maven.org/maven2/org/apache/ode/

 

 

-- 

Regards

Mateusz Nowakowski


Re: How to throw an anonymous fault ?

Posted by seriousme <se...@orange.fr>.
Thanks for your reply.

But using  qualified name this way :
<wsbpel:throw faultName="tns:fault0" />
does not work either.

Is it what you meant ?

Otherwise, how to declare non anonymous faults ?

Thanks.
-- 
View this message in context: http://www.nabble.com/How-to-throw-an-anonymous-fault---tp19132119p19150636.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: How to throw an anonymous fault ?

Posted by Matthieu Riou <ma...@offthelip.org>.
On Sun, Aug 24, 2008 at 9:38 AM, seriousme <se...@orange.fr> wrote:

>
> Hi,
>
> trying to throw a fault inside a process it appears that it is never caught
> even with a "catchAll" activity.
>
> This very basic process shows the problem :
> <?xml version="1.0" encoding="utf-8" ?>
> <wsbpel:process
>        name="testerProcess"
>
>        xmlns:wsbpel="
> http://docs.oasis-open.org/wsbpel/2.0/process/executable"
>
>        targetNamespace="http://services"
>        xmlns:tns="http://services"
> >
>
>        <wsbpel:import importType="http://schemas.xmlsoap.org/wsdl/"
> location="tester.wsdl"  namespace="http://services" />
>
>        <wsbpel:partnerLinks>
>                <wsbpel:partnerLink name="linkToClient"
> partnerLinkType="tns:testerLinkType"    myRole="tester"/>
>        </wsbpel:partnerLinks>
>
>        <wsbpel:variables>
>                <wsbpel:variable        name="input"
>  messageType="tns:testInput" />
>                <wsbpel:variable        name="output"
> messageType="tns:testOutput" />
>        </wsbpel:variables>
>
>        <wsbpel:faultHandlers>
>                <!--<wsbpel:catch faultName="fault0">
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault0
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catch>
>                <wsbpel:catch faultName="fault1">
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault1
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catch>-->
>                <wsbpel:catchAll>
>                        <wsbpel:assign>
>                                <wsbpel:copy>
>                                        <wsbpel:from>'fault
> caught'</wsbpel:from>
>
>  <wsbpel:to>$output.result</wsbpel:to>
>                                </wsbpel:copy>
>                        </wsbpel:assign>
>                        <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>                </wsbpel:catchAll>
>        </wsbpel:faultHandlers>
>
>        <wsbpel:sequence>
>                <wsbpel:receive createInstance="yes"
> partnerLink="linkToClient"
> portType="tns:testerPortType" operation="test" variable="input" />
>
>                <wsbpel:if>
>                        <wsbpel:condition>string($input.data) =
> '0'</wsbpel:condition>
>                        <wsbpel:then>
>                                <wsbpel:throw faultName="fault0" />
>                        </wsbpel:then>
>                        <wsbpel:elseif>
>                                <wsbpel:condition>string($input.data) =
> '1'</wsbpel:condition>
>                                <wsbpel:throw faultName="fault1" />
>                        </wsbpel:elseif>
>                        <wsbpel:else>
>                                <!--<wsbpel:throw faultName="fault2" />-->
>                                <wsbpel:empty/>
>                        </wsbpel:else>
>                </wsbpel:if>
>                <wsbpel:assign>
>                        <wsbpel:copy>
>                                <wsbpel:from>'Test'</wsbpel:from>
>                                <wsbpel:to>$output.result</wsbpel:to>
>                        </wsbpel:copy>
>                </wsbpel:assign>
>                <wsbpel:reply partnerLink="linkToClient"
> portType="tns:testerPortType"
> operation="test" variable="output" />
>        </wsbpel:sequence>
>
> </wsbpel:process>
>
> When invoked with a value that provoke an exception, that is "0" and "1",
> nothing is replied to the client and the process seems to do nothing.
> The behavior is normal when invoked with other values, that is the value
> 'Test' is returned.
>
> The problem comes, of course, from the misuse of the "throw...catch"
> feature, particularly from the non definition of the faults.
>
> So two questions :
> Is there a way to throw anonymous, that is non defined, fault the way it is
> done in this process ?


Have you tried using a qualified name for your fault? We have some working
tests using non-declared faults:

http://svn.apache.org/repos/asf/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestCatchFaultInFaultHandler/

Cheers,
Matthieu


>
> If not, how to properly use the WS-BPEL throw-catch construct, particularly
> how to declare the faults which names will go into "faultName" attribute of
> the "throw" and "catch" ?
>
> Thanks by advance for your help.
> --
> View this message in context:
> http://www.nabble.com/How-to-throw-an-anonymous-fault---tp19132119p19132119.html
> Sent from the Apache Ode User mailing list archive at Nabble.com.
>
>