You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ode.apache.org by Jit K <jk...@gmail.com> on 2016/09/12 11:29:06 UTC
Dynamically invoke a child process
Hi,
I want to invoke a process dynamically. I have a main process and a child
process. The child process is deployed on 2 servers 'server1' and 'server2'
The main process is also deployed on 'server1' in the same package with the
child process.
In the main process, I want to invoke the child process based on an input.
If input is '1' then invoke child process from 'server1' else invoke child
process from 'server2'.
However, whatever input I give, the main process always invokes child
process from 'server1'.
I tried following 2 ways:
1. Setting the child process url to the child process partner link
2. Setting a service reference to the child process partner link
In both the case the result is same. I have checked the activity flow using
instance management API. It shows correct path after the IF condition i.e.
if input is 1, assign activity 'SetPartner1' is called and if input is 2,
assign activity 'SetPartner2' is called. However, always the child process
from server1 is invoked.
Please suggest what am I missing.
Attaching the BPEL files.
Thanks.
JK
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
I think it will process one by one. In case if the input message has
arrived even before the receive is activated, the message will be enqueued
and when the receive activity gets activated it will check for any messages
that has already arrived and process it otherwise it will wait for the
input message to arrive.
Which ODE version are you on?
Are you using OpenJPA or Hibernate?
I would suggest to model the process and try it.
On Thu, Nov 3, 2016 at 10:19 AM, Jit K <jk...@gmail.com> wrote:
> Hi Sathwik,
>
> >> In BPEL a sub-process is implemented by using a <SCOPE /> within the
> <PROCESS />. Just to clarify your sub process definition is actually a full
> blown process. Am I right?
> Yes, my sub process is a full blown process (defined in a separate .bpel
> file).
>
> I am restructuring my query about While loop. I am considering explicit
> correlations to implement this because we will have to relate
> invoke-receive activities.
> While loop executes its child activity in sequence, i.e. start new activity
> after first is complete. This is OK for one way <invoke>. However I do not
> understand how it will work for <receive>. Considering the sequential
> behavior of while loop, in the first iteration it will execute the first
> <receive> activity and wait till it is complete. Once the first <receive>
> is complete, it will execute the second <receive> and wait till is is
> complete and so on. However, while it is waiting for second <receive>, what
> if the process receives a response from 3rd <invoke>? It will fail because
> there is no corresponding <receive> on.
> Is my understanding correct or I am missing something here?
>
> Regards,
> JK
>
>
> On Wed, Nov 2, 2016 at 6:46 PM, Sathwik B P <sa...@gmail.com> wrote:
>
> > Response Inline
> >
> > On Wed, Nov 2, 2016 at 4:50 PM, Jit K <jk...@gmail.com> wrote:
> >
> > > Hi Sathwik,
> > >
> > > Thank you for taking time to suggest these ideas.
> > >
> > > I was thinking on the same line but did not implement because I was not
> > > sure about calling <receive /> in a loop.
> > > Since <receive /> is a blocking activity, I thought the loop will stop
> > > during the first iteration when it executes the first <receive />
> > activity
> > > and will not not complete.
> > >
> > > I have few queries.
> > >
> > > 1) Iterative forEach parallel='yes'
> > > In my case I would like to collate the result of all sub-processes in
> the
> > > main process. So in the first approach (forEach) do you think I can
> add a
> > > <receive /> after <invoke /> as shown below
> > >
> > > <bpel:forEach parallel='yes' ...>
> > > initialize the counter here
> > > <scope>
> > > <partnerlink .. /> access the EPR array using the index
> > > counter and assign it to the partnerlink.
> > > <invoke .../>
> > > <receive .../> to receive the response from above invoke
> > > </scope>
> > > </bpel:forEach>
> > >
> > >
> > In BPEL a sub-process is implemented by using a <SCOPE /> within the
> > <PROCESS />. Just to clarify your sub process definition is actually a
> full
> > blown process. Am I right?
> > Yes, you can add a <RECEIVE /> after <INVOKE />, make sure you use
> > correlations. Also, any variables defined within the <SCOPE /> is a local
> > variable and cannot be accessed outside of it.
> >
> > Example forEach Parallel:
> > https://github.com/apache/ode/blob/master/bpel-scripts/src/
> > main/resources/2.0/good/foreach/ForEach2-2.0.bpel
> >
> >
> > > 2) While loop with async communication and explicit correlation
> > > In case of while loop, the execution is sequential. This is ok for
> > <invoke
> > > /> activities. But may not work for <receive /> activities because
> there
> > is
> > > no guarantee that the responses will be received in the same order of
> > > invoke.
> > > Or putting <receive /> in <while> will create an implicit <flow> like
> > > <forEach> loop?
> > >
> > > Thank you once again.
> > >
> > > JK
> > >
> >
> > There is no guarantee of order of message processing. But, if you can
> make
> > a unique correlated value relate for every invoke-receive then you can
> know
> > which receive relates to the invoke. So, it doesn't matter in which order
> > the receive has arrived.
> >
> > <FOREACH> creates an implicit <FLOW> as per the bpel specification:
> > http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.
> html#_Toc164738521
> > <WHILE> does not create any implicit <FLOW>.
> >
> > regards,
> > sathwik
> >
>
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
Hi Sathwik,
>> In BPEL a sub-process is implemented by using a <SCOPE /> within the
<PROCESS />. Just to clarify your sub process definition is actually a full
blown process. Am I right?
Yes, my sub process is a full blown process (defined in a separate .bpel
file).
I am restructuring my query about While loop. I am considering explicit
correlations to implement this because we will have to relate
invoke-receive activities.
While loop executes its child activity in sequence, i.e. start new activity
after first is complete. This is OK for one way <invoke>. However I do not
understand how it will work for <receive>. Considering the sequential
behavior of while loop, in the first iteration it will execute the first
<receive> activity and wait till it is complete. Once the first <receive>
is complete, it will execute the second <receive> and wait till is is
complete and so on. However, while it is waiting for second <receive>, what
if the process receives a response from 3rd <invoke>? It will fail because
there is no corresponding <receive> on.
Is my understanding correct or I am missing something here?
Regards,
JK
On Wed, Nov 2, 2016 at 6:46 PM, Sathwik B P <sa...@gmail.com> wrote:
> Response Inline
>
> On Wed, Nov 2, 2016 at 4:50 PM, Jit K <jk...@gmail.com> wrote:
>
> > Hi Sathwik,
> >
> > Thank you for taking time to suggest these ideas.
> >
> > I was thinking on the same line but did not implement because I was not
> > sure about calling <receive /> in a loop.
> > Since <receive /> is a blocking activity, I thought the loop will stop
> > during the first iteration when it executes the first <receive />
> activity
> > and will not not complete.
> >
> > I have few queries.
> >
> > 1) Iterative forEach parallel='yes'
> > In my case I would like to collate the result of all sub-processes in the
> > main process. So in the first approach (forEach) do you think I can add a
> > <receive /> after <invoke /> as shown below
> >
> > <bpel:forEach parallel='yes' ...>
> > initialize the counter here
> > <scope>
> > <partnerlink .. /> access the EPR array using the index
> > counter and assign it to the partnerlink.
> > <invoke .../>
> > <receive .../> to receive the response from above invoke
> > </scope>
> > </bpel:forEach>
> >
> >
> In BPEL a sub-process is implemented by using a <SCOPE /> within the
> <PROCESS />. Just to clarify your sub process definition is actually a full
> blown process. Am I right?
> Yes, you can add a <RECEIVE /> after <INVOKE />, make sure you use
> correlations. Also, any variables defined within the <SCOPE /> is a local
> variable and cannot be accessed outside of it.
>
> Example forEach Parallel:
> https://github.com/apache/ode/blob/master/bpel-scripts/src/
> main/resources/2.0/good/foreach/ForEach2-2.0.bpel
>
>
> > 2) While loop with async communication and explicit correlation
> > In case of while loop, the execution is sequential. This is ok for
> <invoke
> > /> activities. But may not work for <receive /> activities because there
> is
> > no guarantee that the responses will be received in the same order of
> > invoke.
> > Or putting <receive /> in <while> will create an implicit <flow> like
> > <forEach> loop?
> >
> > Thank you once again.
> >
> > JK
> >
>
> There is no guarantee of order of message processing. But, if you can make
> a unique correlated value relate for every invoke-receive then you can know
> which receive relates to the invoke. So, it doesn't matter in which order
> the receive has arrived.
>
> <FOREACH> creates an implicit <FLOW> as per the bpel specification:
> http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#_Toc164738521
> <WHILE> does not create any implicit <FLOW>.
>
> regards,
> sathwik
>
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
Response Inline
On Wed, Nov 2, 2016 at 4:50 PM, Jit K <jk...@gmail.com> wrote:
> Hi Sathwik,
>
> Thank you for taking time to suggest these ideas.
>
> I was thinking on the same line but did not implement because I was not
> sure about calling <receive /> in a loop.
> Since <receive /> is a blocking activity, I thought the loop will stop
> during the first iteration when it executes the first <receive /> activity
> and will not not complete.
>
> I have few queries.
>
> 1) Iterative forEach parallel='yes'
> In my case I would like to collate the result of all sub-processes in the
> main process. So in the first approach (forEach) do you think I can add a
> <receive /> after <invoke /> as shown below
>
> <bpel:forEach parallel='yes' ...>
> initialize the counter here
> <scope>
> <partnerlink .. /> access the EPR array using the index
> counter and assign it to the partnerlink.
> <invoke .../>
> <receive .../> to receive the response from above invoke
> </scope>
> </bpel:forEach>
>
>
In BPEL a sub-process is implemented by using a <SCOPE /> within the
<PROCESS />. Just to clarify your sub process definition is actually a full
blown process. Am I right?
Yes, you can add a <RECEIVE /> after <INVOKE />, make sure you use
correlations. Also, any variables defined within the <SCOPE /> is a local
variable and cannot be accessed outside of it.
Example forEach Parallel:
https://github.com/apache/ode/blob/master/bpel-scripts/src/main/resources/2.0/good/foreach/ForEach2-2.0.bpel
> 2) While loop with async communication and explicit correlation
> In case of while loop, the execution is sequential. This is ok for <invoke
> /> activities. But may not work for <receive /> activities because there is
> no guarantee that the responses will be received in the same order of
> invoke.
> Or putting <receive /> in <while> will create an implicit <flow> like
> <forEach> loop?
>
> Thank you once again.
>
> JK
>
There is no guarantee of order of message processing. But, if you can make
a unique correlated value relate for every invoke-receive then you can know
which receive relates to the invoke. So, it doesn't matter in which order
the receive has arrived.
<FOREACH> creates an implicit <FLOW> as per the bpel specification:
http://docs.oasis-open.org/wsbpel/2.0/OS/wsbpel-v2.0-OS.html#_Toc164738521
<WHILE> does not create any implicit <FLOW>.
regards,
sathwik
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
Hi Sathwik,
Thank you for taking time to suggest these ideas.
I was thinking on the same line but did not implement because I was not
sure about calling <receive /> in a loop.
Since <receive /> is a blocking activity, I thought the loop will stop
during the first iteration when it executes the first <receive /> activity
and will not not complete.
I have few queries.
1) Iterative forEach parallel='yes'
In my case I would like to collate the result of all sub-processes in the
main process. So in the first approach (forEach) do you think I can add a
<receive /> after <invoke /> as shown below
<bpel:forEach parallel='yes' ...>
initialize the counter here
<scope>
<partnerlink .. /> access the EPR array using the index
counter and assign it to the partnerlink.
<invoke .../>
<receive .../> to receive the response from above invoke
</scope>
</bpel:forEach>
2) While loop with async communication and explicit correlation
In case of while loop, the execution is sequential. This is ok for <invoke
/> activities. But may not work for <receive /> activities because there is
no guarantee that the responses will be received in the same order of
invoke.
Or putting <receive /> in <while> will create an implicit <flow> like
<forEach> loop?
Thank you once again.
JK
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
Hi Jit,
Hope these couple of approaches might address your requirement. This is
just a high level idea.
1) Iterative forEach parallel='yes'
<bpel:forEach parallel='yes' ...>
initialize the counter here
<scope>
<partnerlink .. />
access the EPR array using the index counter and assign it
to the partnerlink.
<invoke .../>
</scope>
</bpel:forEach>
The forEach parallel loop runs an implicit <flow> for the embedded <scope
/> and that's how it runs parallel. You might have to use an array to hold
the EPR and use the counter value within the loop to access the specific
EPR during each iteration and assign it to the partnerlink. In order to
hold EPR values in an array you might have to use an XSLT transformation.
Instead of using a global partnerlink you might define and use a local
partner link within the forEach scope.
2) While loop with async communication and explicit correlation
<while ...>
<invoke /> This is a one way invoke with explicit correlation
</while>
<while ...>
<receive /> This receive should be with explicit correlation
</while>
Here, the first while loop does an sequential invoke, but since its a
one way invocation it doesn't wait for any response and it completes almost
immediately. The second while loop will wait for as many responses as the
invokes were made. Correlation values have to be unique across the
iterations.
Hope this helps.
regards,
sathwik
On Mon, Oct 24, 2016 at 12:04 PM, Sathwik B P <sa...@gmail.com> wrote:
> Hi,
>
> We will be happy to answer questions if there is any specific problems in
> executing the process model on ODE or question on the behaviour of ODE.
>
> We cannot answer questions about complete process solution models.
>
>
>
> *To answer this question,Do I need all sub processes to have same
> interface (namespace, operations and messages)? *
> Ans: Bpel activity definition is static in nature (Bpel Specification) and
> one cannot change it at runtime. Henceforth, invoking multiple sub process
> using the same Invoke activity definition would enforce you to have your
> sub process adhere to same interface. Only the endpoints of the partnerlink
> can be changed.
>
> regards,
> sathwik
>
>
> On Mon, Oct 24, 2016 at 6:15 AM, Raghvendra Srivastava <
> raghvendrasrivastava@gmail.com> wrote:
>
>> Hi Sathwik,
>> How are you doing?
>> I am also very interested in this use case. Please suggest a way to
>> accomplish this using ode.
>> Thanks,
>> Rag
>>
>> On Thursday, September 15, 2016, Jit K <jk...@gmail.com> wrote:
>>
>> > It worked too. Thanks.
>> >
>> > H
>> > owever, this was just a part the solution I am trying to develop.
>> >
>> > I have a main process and bunch of sub processes. Each sub process is
>> > registered in a central repository with a unique name. Sub processes
>> may be
>> > added or removed as required (with appropriate addition or removal from
>> > central repository).
>> > The request message to the main process has a list of sub processes to
>> be
>> > invoked for that particular request. For example, request-1 may need to
>> > invoke sub-process-1 and sub-process-3 whereas request-2 may need to
>> invoke
>> > sub-process-2 and sub-process-3.
>> > Thus I want to invoke the specified sub processes. Sub processes should
>> > execute in parallel. At the end there should be a join to collate the
>> > results of all sub processes.
>> >
>> > Please suggest how can I achieve this?
>> > Do I need all sub processes to have same interface (namespace,
>> operations
>> > and messages)? Till now I was trying with the SAME Sub process (same
>> name,
>> > same interface) deployed at 2 different locations. Now I am trying with
>> > DIFFERENT sub processes (different names, same interface).
>> >
>> > Any kind of help is appreciated.
>> >
>> > Regards,
>> > JK
>> >
>> >
>>
>
>
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
Hi,
We will be happy to answer questions if there is any specific problems in
executing the process model on ODE or question on the behaviour of ODE.
We cannot answer questions about complete process solution models.
*To answer this question,Do I need all sub processes to have same interface
(namespace, operations and messages)? *
Ans: Bpel activity definition is static in nature (Bpel Specification) and
one cannot change it at runtime. Henceforth, invoking multiple sub process
using the same Invoke activity definition would enforce you to have your
sub process adhere to same interface. Only the endpoints of the partnerlink
can be changed.
regards,
sathwik
On Mon, Oct 24, 2016 at 6:15 AM, Raghvendra Srivastava <
raghvendrasrivastava@gmail.com> wrote:
> Hi Sathwik,
> How are you doing?
> I am also very interested in this use case. Please suggest a way to
> accomplish this using ode.
> Thanks,
> Rag
>
> On Thursday, September 15, 2016, Jit K <jk...@gmail.com> wrote:
>
> > It worked too. Thanks.
> >
> > H
> > owever, this was just a part the solution I am trying to develop.
> >
> > I have a main process and bunch of sub processes. Each sub process is
> > registered in a central repository with a unique name. Sub processes may
> be
> > added or removed as required (with appropriate addition or removal from
> > central repository).
> > The request message to the main process has a list of sub processes to be
> > invoked for that particular request. For example, request-1 may need to
> > invoke sub-process-1 and sub-process-3 whereas request-2 may need to
> invoke
> > sub-process-2 and sub-process-3.
> > Thus I want to invoke the specified sub processes. Sub processes should
> > execute in parallel. At the end there should be a join to collate the
> > results of all sub processes.
> >
> > Please suggest how can I achieve this?
> > Do I need all sub processes to have same interface (namespace, operations
> > and messages)? Till now I was trying with the SAME Sub process (same
> name,
> > same interface) deployed at 2 different locations. Now I am trying with
> > DIFFERENT sub processes (different names, same interface).
> >
> > Any kind of help is appreciated.
> >
> > Regards,
> > JK
> >
> >
>
Re: Dynamically invoke a child process
Posted by Raghvendra Srivastava <ra...@gmail.com>.
Hi Sathwik,
How are you doing?
I am also very interested in this use case. Please suggest a way to
accomplish this using ode.
Thanks,
Rag
On Thursday, September 15, 2016, Jit K <jk...@gmail.com> wrote:
> It worked too. Thanks.
>
> H
> owever, this was just a part the solution I am trying to develop.
>
> I have a main process and bunch of sub processes. Each sub process is
> registered in a central repository with a unique name. Sub processes may be
> added or removed as required (with appropriate addition or removal from
> central repository).
> The request message to the main process has a list of sub processes to be
> invoked for that particular request. For example, request-1 may need to
> invoke sub-process-1 and sub-process-3 whereas request-2 may need to invoke
> sub-process-2 and sub-process-3.
> Thus I want to invoke the specified sub processes. Sub processes should
> execute in parallel. At the end there should be a join to collate the
> results of all sub processes.
>
> Please suggest how can I achieve this?
> Do I need all sub processes to have same interface (namespace, operations
> and messages)? Till now I was trying with the SAME Sub process (same name,
> same interface) deployed at 2 different locations. Now I am trying with
> DIFFERENT sub processes (different names, same interface).
>
> Any kind of help is appreciated.
>
> Regards,
> JK
>
>
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
It worked too. Thanks.
H
owever, this was just a part the solution I am trying to develop.
I have a main process and bunch of sub processes. Each sub process is
registered in a central repository with a unique name. Sub processes may be
added or removed as required (with appropriate addition or removal from
central repository).
The request message to the main process has a list of sub processes to be
invoked for that particular request. For example, request-1 may need to
invoke sub-process-1 and sub-process-3 whereas request-2 may need to invoke
sub-process-2 and sub-process-3.
Thus I want to invoke the specified sub processes. Sub processes should
execute in parallel. At the end there should be a join to collate the
results of all sub processes.
Please suggest how can I achieve this?
Do I need all sub processes to have same interface (namespace, operations
and messages)? Till now I was trying with the SAME Sub process (same name,
same interface) deployed at 2 different locations. Now I am trying with
DIFFERENT sub processes (different names, same interface).
Any kind of help is appreciated.
Regards,
JK
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
Good to know it worked. It should work for your first approach as well, by
copying it directly to the partnerlink. If not file a bug.
On Thu, Sep 15, 2016 at 12:16 PM, Jit K <jk...@gmail.com> wrote:
> Bingo!!!!!!!!!!
> It worked.
> Thanks a lot Sathwik.
>
> JK
>
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
Bingo!!!!!!!!!!
It worked.
Thanks a lot Sathwik.
JK
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
try assigning the service-ref containing the soap address element directly
to the partnerlink and no via the string variable partnerEPR
On Wed, Sep 14, 2016 at 4:38 PM, Jit K <jk...@gmail.com> wrote:
> Hi Sathwik,
>
> The results of using flag usePeer2Peer are as follows.
>
> *usePeer2Peer="false" on invoke in deploy.xml*
> invoke locally deployed child process - fails (expected)
> invoke remotely deployed child process - *fails *(should work as you
> said)
>
> *usePeer2Peer="false" not specified on invoke in deploy.xml*
> invoke locally deployed child process - works (expected)
> invoke remotely deployed child process - fails (expected)
>
> I have used the second approach (Simple URL, wrapped in an soap:address
> element from http://ode.apache.org/endpoint-references.html) to pass in
> the EPR to the partnerlink.
>
> The error in all the failure cases is same as follows
>
> 15:12:07,706 WARN [EndpointFactory] Couldnt create any endpoint for
> element <?xml version="1.0" encoding="UTF-8"?>
> <service-ref xmlns="http://docs.oasis-open.org/wsbpel/2.0/serviceref">
> <temporary-simple-type-wrapper xmlns="" xmlns:sref="http://docs.oasis-
> open.org/wsbpel/2.0/serviceref">
> <soap:address location="http://server2:8110/ode.1.3.6/processes/
> GetHostNameAddrProcess" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/
> "/>
> </temporary-simple-type-wrapper>
> </service-ref>
> 15:12:07,706 ERROR [BpelRuntimeContextImpl] Couldn't find endpoint for
> partner EPR <?xml version="1.0" encoding="UTF-8"?>
> <service-ref xmlns="http://docs.oasis-open.org/wsbpel/2.0/serviceref">
> <temporary-simple-type-wrapper xmlns="" xmlns:sref="http://docs.oasis-
> open.org/wsbpel/2.0/serviceref">
> <soap:address location="http://server2:8110/ode.1.3.6/processes/
> GetHostNameAddrProcess" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/
> "/>
> </temporary-simple-type-wrapper>
> </service-ref>
> 15:12:07,706 ERROR [INVOKE] Failure during invoke: UnknownEndpoint
> 15:12:07,706 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering
> activity 13, failure reason: UnknownEndpoint on channel 22
>
> Attaching the updated Main and Child Process packages.
>
> Regards,
> JK
>
>
>
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
Hi Sathwik,
The results of using flag usePeer2Peer are as follows.
*usePeer2Peer="false" on invoke in deploy.xml*
invoke locally deployed child process - fails (expected)
invoke remotely deployed child process - *fails *(should work as you
said)
*usePeer2Peer="false" not specified on invoke in deploy.xml*
invoke locally deployed child process - works (expected)
invoke remotely deployed child process - fails (expected)
I have used the second approach (Simple URL, wrapped in an soap:address
element from http://ode.apache.org/endpoint-references.html) to pass in the
EPR to the partnerlink.
The error in all the failure cases is same as follows
15:12:07,706 WARN [EndpointFactory] Couldnt create any endpoint for
element <?xml version="1.0" encoding="UTF-8"?>
<service-ref xmlns="http://docs.oasis-open.org/wsbpel/2.0/serviceref">
<temporary-simple-type-wrapper xmlns="" xmlns:sref="
http://docs.oasis-open.org/wsbpel/2.0/serviceref">
<soap:address location="
http://server2:8110/ode.1.3.6/processes/GetHostNameAddrProcess" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"/>
</temporary-simple-type-wrapper>
</service-ref>
15:12:07,706 ERROR [BpelRuntimeContextImpl] Couldn't find endpoint for
partner EPR <?xml version="1.0" encoding="UTF-8"?>
<service-ref xmlns="http://docs.oasis-open.org/wsbpel/2.0/serviceref">
<temporary-simple-type-wrapper xmlns="" xmlns:sref="
http://docs.oasis-open.org/wsbpel/2.0/serviceref">
<soap:address location="
http://server2:8110/ode.1.3.6/processes/GetHostNameAddrProcess" xmlns:soap="
http://schemas.xmlsoap.org/wsdl/soap/"/>
</temporary-simple-type-wrapper>
</service-ref>
15:12:07,706 ERROR [INVOKE] Failure during invoke: UnknownEndpoint
15:12:07,706 INFO [BpelRuntimeContextImpl] ActivityRecovery: Registering
activity 13, failure reason: UnknownEndpoint on channel 22
Attaching the updated Main and Child Process packages.
Regards,
JK
Re: Dynamically invoke a child process
Posted by Jit K <jk...@gmail.com>.
Thank you Sathwik.
Will try the P2P setting and report the results.
Regards,
JK
Re: Dynamically invoke a child process
Posted by Sathwik B P <sa...@gmail.com>.
Hi,
ODE uses an optimization technique for Process to Process communication in
which the communication is designed to happen as an object to object call
on the local machine. It doesn't go through the integration layer (axis2).
This optimization overcomes the overhead of serialization and
de-serialization of messages over the wire. Henceforth you may be
experiencing this behaviour where the child process on the same local
machine is being invoked.
If you do not want this optimization then you can override this behaviour
by adding an attribute usePeer2Peer="false" on the invoke element in
deploy.xml. The link below shows an example of it
https://github.com/apache/ode/blob/master/axis2-war/src/
test/resources/TestNoP2P/deploy.xml#L28
Note: By overriding this optimization all calls to the child process even
on the local machine will go via the integration layer.
Kindly refer the link (http://ode.apache.org/endpoint-references.html) to
pass in the EPR to the partnerlink. Apart from the first approach where a
URL string is assigned to the partnerlink, try to use any other approach in
the document.
Let is know how it goes.
There might be a bug in the first approach specified in the (
http://ode.apache.org/endpoint-references.html) link. Can you raise a JIRA
please and attach your process to it.
regards,
sathwik
On Mon, Sep 12, 2016 at 4:59 PM, Jit K <jk...@gmail.com> wrote:
> Hi,
>
> I want to invoke a process dynamically. I have a main process and a child
> process. The child process is deployed on 2 servers 'server1' and 'server2'
> The main process is also deployed on 'server1' in the same package with the
> child process.
>
> In the main process, I want to invoke the child process based on an input.
> If input is '1' then invoke child process from 'server1' else invoke child
> process from 'server2'.
>
> However, whatever input I give, the main process always invokes child
> process from 'server1'.
> I tried following 2 ways:
> 1. Setting the child process url to the child process partner link
> 2. Setting a service reference to the child process partner link
>
> In both the case the result is same. I have checked the activity flow
> using instance management API. It shows correct path after the IF condition
> i.e. if input is 1, assign activity 'SetPartner1' is called and if input is
> 2, assign activity 'SetPartner2' is called. However, always the child
> process from server1 is invoked.
>
> Please suggest what am I missing.
> Attaching the BPEL files.
>
> Thanks.
> JK
>