ah thx juergen,
so the <sequence> is like the {} in java and defines a block.
cheers
Thomas Menzel @ brox IT-Solutions GmbH
From: smila-dev-bounces@xxxxxxxxxxx [mailto:smila-dev-bounces@xxxxxxxxxxx] On Behalf Of Jürgen Schumacher
Sent: Freitag, 9. März 2012 14:54
To: Smila project developer mailing list
Subject: Re: [smila-dev] BPEL wont instantiate pipelet of same class 2x in certain circumstances
Hi Thomas,
the problem is in the BPEL: two consecutive pipelet invocations must be placed inside a <sequence> element,
or ODE will execute only the first one. The <if> structure is something like
<if>
<condition>…</condition>
&activity;
</if>
and &activity; is either ONE extensionActicity (or some other basic BPEL activity) or a structured activity like <sequence>.
On the other hand you can omit the <sequence> around the <if> because the <if> is the only activity inside the <forEach><scope>.
(Yeah, BPEL is fun … ;-)
And finally, when using the index variable in the pipelet invocation, you probably don’t want to use the output variable, because it
then will contain only one record ID from the input variable selected by the index, but not the complete record list processed by the
pipeline. Of course, yu must also return the original “request” variable in the <reply> activity, because the “result” variable does is
not set anymore. That’s OK because it’s only the record IDs in the BPEL variables that matter, the record content is taken from the
blackboard.
The way to use output and index together is shown in the attached “testpipeline3-alternative.bpel”: Inside the <forEach> scope you
can declare a new variable that will hold only the single record that is processed in <forEach> scope. The first pipelet invocation then
writes the record “request[index]” to variable “currentRecord” and the second pipelet can process just “currentRecord” without
using the index variable. That should be a bit faster, especially if the many records are processed in a single pipeline run, or if lots of
pipelets are invoked in the sequence of the <forEach> loop.
Hope that helps (-; At least, here the test is green with both variants.
Cheers,
Juergen