You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by "Nowakowski, Mateusz" <Ma...@sabre-holdings.com> on 2008/10/07 18:09:15 UTC

Dynamic onAlarm value Is it possible ?

Hi all,

I have one design problem. From syntactical point of view it should
work, but I don't know if it is possible in ODE.

BPEL has onAlarm functionality. It can be placed inside global event
handler field like this:
	<bpel:eventHandlers>
		<bpel:onAlarm>
			<bpel:for>"PT1M50S"</bpel:for>
			<bpel:scope>
				<bpel:throw
faultName="tns:TimeoutFault"/>
			</bpel:scope>
		</bpel:onAlarm>
	</bpel:eventHandlers>

But if it is in global place, there can be only static value. 

My situation is that the client can send this value in payload and I
would like to use this value as onAlarm value. In other words I want
dynamic onAlarm value.

My solution is: 
- Declare global variable: 
<bpel:variable name="onAlarmValue" type="xs:string"/>
- Main sequence will receive message, assign value to onAlarmValue
variable
- create new scope with eventHandlers defined like this:
	<bpel:eventHandlers>
		<bpel:onAlarm>
			<bpel:for>$onAlarmValue</bpel:for>
			<bpel:scope>
				<bpel:throw
faultName="tns:TimeoutFault"/>
			</bpel:scope>
		</bpel:onAlarm>
	</bpel:eventHandlers>
- the whole other instructions are inside sequence inside scope

Assuming that onAlarmValue variable format is correct, will it work ?

-- 
Regards
Mateusz Nowakowski

Re: Dynamic onAlarm value Is it possible ?

Posted by Matthieu Riou <ma...@offthelip.org>.
On Tue, Oct 7, 2008 at 9:09 AM, Nowakowski, Mateusz <
Mateusz.Nowakowski@sabre-holdings.com> wrote:

> Hi all,
>
> I have one design problem. From syntactical point of view it should
> work, but I don't know if it is possible in ODE.
>
> BPEL has onAlarm functionality. It can be placed inside global event
> handler field like this:
>        <bpel:eventHandlers>
>                <bpel:onAlarm>
>                        <bpel:for>"PT1M50S"</bpel:for>
>                        <bpel:scope>
>                                <bpel:throw
> faultName="tns:TimeoutFault"/>
>                        </bpel:scope>
>                </bpel:onAlarm>
>        </bpel:eventHandlers>
>
> But if it is in global place, there can be only static value.
>
> My situation is that the client can send this value in payload and I
> would like to use this value as onAlarm value. In other words I want
> dynamic onAlarm value.
>
> My solution is:
> - Declare global variable:
> <bpel:variable name="onAlarmValue" type="xs:string"/>
> - Main sequence will receive message, assign value to onAlarmValue
> variable
> - create new scope with eventHandlers defined like this:
>        <bpel:eventHandlers>
>                <bpel:onAlarm>
>                        <bpel:for>$onAlarmValue</bpel:for>
>                        <bpel:scope>
>                                <bpel:throw
> faultName="tns:TimeoutFault"/>
>                        </bpel:scope>
>                </bpel:onAlarm>
>        </bpel:eventHandlers>
> - the whole other instructions are inside sequence inside scope
>
> Assuming that onAlarmValue variable format is correct, will it work ?
>

It definitely should. Did you find any problem?

Thanks,
Matthieu


>
> --
> Regards
> Mateusz Nowakowski
>

RE: Dynamic onAlarm value Is it possible ?

Posted by "Pellegrini, Mike (PLC, IT)" <Mi...@thehartford.com>.
Hi Mateusz,

This behavior is spec defined so will work in spec compliant
implementations and therefore should work in Ode.

Section 12.7.3 on the WS-BPEL 2.0 spec states the following:

The event handlers associated with a scope are enabled when the parent
scope starts. If the event handler is enclosed by the <process> scope,
the event handler is enabled as soon as the process instance is created.
This allows the alarm time for a global alarm event to be specified
using the data provided within the message that creates a process
instance, as shown in the following example (see the example in the
spec).

Try it out in Ode and see if what results you get.

-Mike

-----Original Message-----
From: Nowakowski, Mateusz [mailto:Mateusz.Nowakowski@sabre-holdings.com]

Sent: Tuesday, October 07, 2008 12:09 PM
To: user@ode.apache.org
Subject: Dynamic onAlarm value Is it possible ?

Hi all,

I have one design problem. From syntactical point of view it should
work, but I don't know if it is possible in ODE.

BPEL has onAlarm functionality. It can be placed inside global event
handler field like this:
	<bpel:eventHandlers>
		<bpel:onAlarm>
			<bpel:for>"PT1M50S"</bpel:for>
			<bpel:scope>
				<bpel:throw
faultName="tns:TimeoutFault"/>
			</bpel:scope>
		</bpel:onAlarm>
	</bpel:eventHandlers>

But if it is in global place, there can be only static value. 

My situation is that the client can send this value in payload and I
would like to use this value as onAlarm value. In other words I want
dynamic onAlarm value.

My solution is: 
- Declare global variable: 
<bpel:variable name="onAlarmValue" type="xs:string"/>
- Main sequence will receive message, assign value to onAlarmValue
variable
- create new scope with eventHandlers defined like this:
	<bpel:eventHandlers>
		<bpel:onAlarm>
			<bpel:for>$onAlarmValue</bpel:for>
			<bpel:scope>
				<bpel:throw
faultName="tns:TimeoutFault"/>
			</bpel:scope>
		</bpel:onAlarm>
	</bpel:eventHandlers>
- the whole other instructions are inside sequence inside scope

Assuming that onAlarmValue variable format is correct, will it work ?

--
Regards
Mateusz Nowakowski


*************************************************************************
This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information.  If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited.  If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************