You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by kodeninja <ko...@gmail.com> on 2009/07/21 16:30:05 UTC

Reading from a DB/File in a BPEL process

Howdy,

If I want to read/write some stuff from/to a DB/File from within a BPEL
process, should that also be exposed as web service to my process, or is
there a way to write, say, some custom Java code that can talk directly to
concerned entity? I'm trying to find out what kind customizations/hooks a
BPEL supports?

When I search for this stuff online, most of the links returned are from
Oracle, where they talk about writing Adapters for achieving the above. Are
adapters some standard BPEL stuff?

Thanks,
-Kodeninja


-- 
View this message in context: http://www.nabble.com/Reading-from-a-DB-File-in-a-BPEL-process-tp24588737p24588737.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Reading from a DB/File in a BPEL process

Posted by Rafal Rusin <ra...@gmail.com>.
It's also possible to call java class static methods, since ODE uses
Saxon for expressions (
http://www.saxonica.com/documentation/extensibility/functions/staticmethods.html
)
It's something like this from inside xquery:
<line xmlns:nd="java:com.example.code.NodeData">
    { nd:line-number() }
</line>

XPaths should be similar.
You need to put your jar in ODE classpath.

I guess, you can also use jdbc getConnection + some SQL operations
from jndi-taken data source inside your static method. As long as you
configure it properly, you can connect to global transaction in JTA
environment, which ODE uses, so your changes will be committed by ODE
scheduler.

This is kind of hacking, but may be useful.

2009/7/21 Ford, Mark <ma...@ll.mit.edu>:
> At a minimum, you'll need to have WSDL that describes the services that you want to invoke or receive messages on. If you deploy ODE to ServiceMix, then it would be possible to bind the partner links to POJO's or other components. For example, setup a camel route that polls a directory and sends the contents of an xml file into your BPEL process whenever a file appears.
>
> If you want to explicitly model the interaction with a database or file system within your BPEL then you'll need to look at vendors like Oracle that have implemented custom activities for file and db access.
>
> However, keep in mind that BPEL works with the abstract interfaces defined by WSDL so it's best to think of everything as a service since once you start down the path of modeling interactions with concrete bindings like SQL queries or inline Java code then you're making your orchestration dependent on these bindings and more prone to break when things change. It also locks you into the customizations provided by the vendor. A better approach is to keep at the abstract level and encapsulate everything with interfaces - even if it's just a thin wrapper around a file system or db.
>
>
> On 7/21/09 10:48 AM, "kodeninja" <ko...@gmail.com> wrote:
>
>
>
> So what you're saying, Nelson, is that if something like this is required, it
> also has to be exposed as a web service and that there's no other way?
>
>
> Nelson Andrés Alvarez Salcedo wrote:
>>
>> El 21/07/2009 9:30, kodeninja escribió:
>>> Howdy,
>>>
>>> If I want to read/write some stuff from/to a DB/File from within a BPEL
>>> process, should that also be exposed as web service to my process, or is
>>> there a way to write, say, some custom Java code that can talk directly
>>> to
>>> concerned entity? I'm trying to find out what kind customizations/hooks a
>>> BPEL supports?
>>>
>>> When I search for this stuff online, most of the links returned are from
>>> Oracle, where they talk about writing Adapters for achieving the above.
>>> Are
>>> adapters some standard BPEL stuff?
>>>
>>> Thanks,
>>> -Kodeninja
>>>
>>>
>>>
>> You should consider the elements you manage in the BPEL process as
>> *basic services*. Following this point of view, a BPEL process should
>> only interact with exposed services and it was, as far as i know,
>> designed to work that way. BPEL orchestrates (tells everyone what to do
>> and when to do it, even integrating human tasks into the process) and
>> its XML speech means that it talks to services through XML messages.
>>
>> Hope I make myself clear while trying to be helpful.
>> --
>> Nelson Álvarez Salcedo
>> /"Verba volant, scripta manent"/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Reading-from-a-DB-File-in-a-BPEL-process-tp24588737p24589123.html
> Sent from the Apache Ode User mailing list archive at Nabble.com.
>
>
>
>
>
> --
> Mark Ford
> MIT Lincoln Laboratory
> 244 Wood Street
> Lexington MA 02420
> (781) 981-1843
>



-- 
Rafał Rusin
http://www.touk.pl
http://top.touk.pl
http://www.mimuw.edu.pl/~rrusin

Re: Reading from a DB/File in a BPEL process

Posted by Nelson Andrés Alvarez Salcedo <na...@itosmosys.com>.
El 21/07/2009 9:48, kodeninja escribió:
> So what you're saying, Nelson, is that if something like this is required, it
> also has to be exposed as a web service and that there's no other way?
>
>
> Nelson Andrés Alvarez Salcedo wrote:
>    
>> El 21/07/2009 9:30, kodeninja escribió:
>>      
>>> Howdy,
>>>
>>> If I want to read/write some stuff from/to a DB/File from within a BPEL
>>> process, should that also be exposed as web service to my process, or is
>>> there a way to write, say, some custom Java code that can talk directly
>>> to
>>> concerned entity? I'm trying to find out what kind customizations/hooks a
>>> BPEL supports?
>>>
>>> When I search for this stuff online, most of the links returned are from
>>> Oracle, where they talk about writing Adapters for achieving the above.
>>> Are
>>> adapters some standard BPEL stuff?
>>>
>>> Thanks,
>>> -Kodeninja
>>>
>>>
>>>
>>>        
>> You should consider the elements you manage in the BPEL process as
>> *basic services*. Following this point of view, a BPEL process should
>> only interact with exposed services and it was, as far as i know,
>> designed to work that way. BPEL orchestrates (tells everyone what to do
>> and when to do it, even integrating human tasks into the process) and
>> its XML speech means that it talks to services through XML messages.
>>
>> Hope I make myself clear while trying to be helpful.
>> -- 
>> Nelson Álvarez Salcedo
>> /"Verba volant, scripta manent"/
>>
>>
>>      
>
>    
What I share here is related to different projects I've been working on. 
A BPEL process lives among many other things in a SOA environment. 
Hence, the focus should be that. A BPEL process, in the very end 
(despite the vendor's kind-of-standard-implementation), is an XML file 
used by your BPEL engine. Whatever it uses, lies outside, somewhere out 
there. Just like using an ESB which follows the VETRO pattern (Validate, 
Enrich, Transform, Route, Operate). Here as well, the bus handles some 
validation logic as well as transformation, but the real talking to the 
artifacts you're using to gather/store data is done by the web services 
alongside the bus.

This link could help. *http://tinyurl.com/lpxeef. *Also, the User guide 
in ODE's website could make it clearer*. *Regards and good luck*.
*
-- 
Nelson Álvarez Salcedo
/"Verba volant, scripta manent"/

Re: Reading from a DB/File in a BPEL process

Posted by "Ford, Mark" <ma...@ll.mit.edu>.
At a minimum, you'll need to have WSDL that describes the services that you want to invoke or receive messages on. If you deploy ODE to ServiceMix, then it would be possible to bind the partner links to POJO's or other components. For example, setup a camel route that polls a directory and sends the contents of an xml file into your BPEL process whenever a file appears.

If you want to explicitly model the interaction with a database or file system within your BPEL then you'll need to look at vendors like Oracle that have implemented custom activities for file and db access.

However, keep in mind that BPEL works with the abstract interfaces defined by WSDL so it's best to think of everything as a service since once you start down the path of modeling interactions with concrete bindings like SQL queries or inline Java code then you're making your orchestration dependent on these bindings and more prone to break when things change. It also locks you into the customizations provided by the vendor. A better approach is to keep at the abstract level and encapsulate everything with interfaces - even if it's just a thin wrapper around a file system or db.


On 7/21/09 10:48 AM, "kodeninja" <ko...@gmail.com> wrote:



So what you're saying, Nelson, is that if something like this is required, it
also has to be exposed as a web service and that there's no other way?


Nelson Andrés Alvarez Salcedo wrote:
>
> El 21/07/2009 9:30, kodeninja escribió:
>> Howdy,
>>
>> If I want to read/write some stuff from/to a DB/File from within a BPEL
>> process, should that also be exposed as web service to my process, or is
>> there a way to write, say, some custom Java code that can talk directly
>> to
>> concerned entity? I'm trying to find out what kind customizations/hooks a
>> BPEL supports?
>>
>> When I search for this stuff online, most of the links returned are from
>> Oracle, where they talk about writing Adapters for achieving the above.
>> Are
>> adapters some standard BPEL stuff?
>>
>> Thanks,
>> -Kodeninja
>>
>>
>>
> You should consider the elements you manage in the BPEL process as
> *basic services*. Following this point of view, a BPEL process should
> only interact with exposed services and it was, as far as i know,
> designed to work that way. BPEL orchestrates (tells everyone what to do
> and when to do it, even integrating human tasks into the process) and
> its XML speech means that it talks to services through XML messages.
>
> Hope I make myself clear while trying to be helpful.
> --
> Nelson Álvarez Salcedo
> /"Verba volant, scripta manent"/
>
>

--
View this message in context: http://www.nabble.com/Reading-from-a-DB-File-in-a-BPEL-process-tp24588737p24589123.html
Sent from the Apache Ode User mailing list archive at Nabble.com.





--
Mark Ford
MIT Lincoln Laboratory
244 Wood Street
Lexington MA 02420
(781) 981-1843

Re: Reading from a DB/File in a BPEL process

Posted by kodeninja <ko...@gmail.com>.
So what you're saying, Nelson, is that if something like this is required, it
also has to be exposed as a web service and that there's no other way?


Nelson Andrés Alvarez Salcedo wrote:
> 
> El 21/07/2009 9:30, kodeninja escribió:
>> Howdy,
>>
>> If I want to read/write some stuff from/to a DB/File from within a BPEL
>> process, should that also be exposed as web service to my process, or is
>> there a way to write, say, some custom Java code that can talk directly
>> to
>> concerned entity? I'm trying to find out what kind customizations/hooks a
>> BPEL supports?
>>
>> When I search for this stuff online, most of the links returned are from
>> Oracle, where they talk about writing Adapters for achieving the above.
>> Are
>> adapters some standard BPEL stuff?
>>
>> Thanks,
>> -Kodeninja
>>
>>
>>    
> You should consider the elements you manage in the BPEL process as 
> *basic services*. Following this point of view, a BPEL process should 
> only interact with exposed services and it was, as far as i know, 
> designed to work that way. BPEL orchestrates (tells everyone what to do 
> and when to do it, even integrating human tasks into the process) and 
> its XML speech means that it talks to services through XML messages.
> 
> Hope I make myself clear while trying to be helpful.
> -- 
> Nelson Álvarez Salcedo
> /"Verba volant, scripta manent"/
> 
> 

-- 
View this message in context: http://www.nabble.com/Reading-from-a-DB-File-in-a-BPEL-process-tp24588737p24589123.html
Sent from the Apache Ode User mailing list archive at Nabble.com.


Re: Reading from a DB/File in a BPEL process

Posted by Nelson Andrés Alvarez Salcedo <na...@itosmosys.com>.
El 21/07/2009 9:30, kodeninja escribió:
> Howdy,
>
> If I want to read/write some stuff from/to a DB/File from within a BPEL
> process, should that also be exposed as web service to my process, or is
> there a way to write, say, some custom Java code that can talk directly to
> concerned entity? I'm trying to find out what kind customizations/hooks a
> BPEL supports?
>
> When I search for this stuff online, most of the links returned are from
> Oracle, where they talk about writing Adapters for achieving the above. Are
> adapters some standard BPEL stuff?
>
> Thanks,
> -Kodeninja
>
>
>    
You should consider the elements you manage in the BPEL process as 
*basic services*. Following this point of view, a BPEL process should 
only interact with exposed services and it was, as far as i know, 
designed to work that way. BPEL orchestrates (tells everyone what to do 
and when to do it, even integrating human tasks into the process) and 
its XML speech means that it talks to services through XML messages.

Hope I make myself clear while trying to be helpful.
-- 
Nelson Álvarez Salcedo
/"Verba volant, scripta manent"/