Initialize bpel variable

View: New views
11 Messages — Rating Filter:   Alert me  

Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How do I initialize a variable in the bpel mapper?

Nigel

Re: Initialize bpel variable

by Wouter van Reeven :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Feb 28, 2008 at 03:16:05AM -0800, Niggy wrote:
> How do I initialize a variable in the bpel mapper?

Use an Assing operation. You can put a literal value in the first argument and
connect the second to your variable.


HTH, Wouter van Reeven

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Wouter.  What would I do in a while loop?

Nigel

Wouter van Reeven wrote:
On Thu, Feb 28, 2008 at 03:16:05AM -0800, Niggy wrote:
> How do I initialize a variable in the bpel mapper?

Use an Assing operation. You can put a literal value in the first argument and
connect the second to your variable.


HTH, Wouter van Reeven

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Wouter van Reeven :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Feb 28, 2008 at 04:17:56AM -0800, Niggy wrote:
> Thanks Wouter.  What would I do in a while loop?

That depends on what you'd want to do :-) Can you be more specific?


Greets, Wouter

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I want to iterate through an invoked and received complex type using a counter in order to copy all the element values to my wsdl's complex type.  I guess I need to initialize a counter which should always be less than the count of my complex types and then create an assign to map all the elements if all that makes sense?

Nigel
Wouter van Reeven wrote:
On Thu, Feb 28, 2008 at 04:17:56AM -0800, Niggy wrote:
> Thanks Wouter.  What would I do in a while loop?

That depends on what you'd want to do :-) Can you be more specific?


Greets, Wouter

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Wouter van Reeven :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
> I want to iterate through an invoked and received complex type using a
> counter in order to copy all the element values to my wsdl's complex type.
> I guess I need to initialize a counter which should always be less than the
> count of my complex types and then create an assign to map all the elements
> if all that makes sense?

You can use the ForEach activity for that. You can find that in the Structured
Activities palette. If you'd like to keep track of a counter you might initiate
it to 0 before the ForEach activity and then increase the value inside the
ForEach activity with another Assign activity.


HTH, Wouter

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have it working almost.  The For Each activity is iterating through an assign which copies the complex type and its elements.  The trouble is that it is overwriting the data, so I only see the second item in a set of two.  Any ideas?

Nigel
Wouter van Reeven wrote:
On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
> I want to iterate through an invoked and received complex type using a
> counter in order to copy all the element values to my wsdl's complex type.
> I guess I need to initialize a counter which should always be less than the
> count of my complex types and then create an assign to map all the elements
> if all that makes sense?

You can use the ForEach activity for that. You can find that in the Structured
Activities palette. If you'd like to keep track of a counter you might initiate
it to 0 before the ForEach activity and then increase the value inside the
ForEach activity with another Assign activity.


HTH, Wouter

--

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"

Re: Initialize bpel variable

by Kiran Bhumana-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could it be because you are not using an index to access your repeating elements? Repeating elements are like arrays, and you need to use predicate expression to get or set values.
Perhaps this blog entry will help you do create predicate expression.
http://blogs.sun.com/kiransden/resource/how_to_create_repeating_nodes/how_to_create_repeating_nodes.htm

-Kiran.

Niggy wrote:
I have it working almost.  The For Each activity is iterating through an
assign which copies the complex type and its elements.  The trouble is that
it is overwriting the data, so I only see the second item in a set of two. 
Any ideas?

Nigel

Wouter van Reeven wrote:
  
On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
    
I want to iterate through an invoked and received complex type using a
counter in order to copy all the element values to my wsdl's complex
type. 
I guess I need to initialize a counter which should always be less than
the
count of my complex types and then create an assign to map all the
elements
if all that makes sense?
      
You can use the ForEach activity for that. You can find that in the
Structured
Activities palette. If you'd like to keep track of a counter you might
initiate
it to 0 before the ForEach activity and then increase the value inside the
ForEach activity with another Assign activity.


HTH, Wouter

-- 

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"


    

  

-- 
Kiran Bhumana
Open ESB Community (http://open-esb.org)

Re: Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK.  If I set the predicate to 1, I get the first element and so on.  That works.  If I initialize a counter before the foreach and increment it in an assign during the foreach and use this counter+1 as the predicate - since the values are accessed from 1 upwards - I get a selectionFailure.

Kiran Bhumana-2 wrote:
Could it be because you are not using an index to access your repeating
elements? Repeating elements are like arrays, and you need to use
predicate expression to get or set values.
Perhaps this blog entry will help you do create predicate expression.
http://blogs.sun.com/kiransden/resource/how_to_create_repeating_nodes/how_to_create_repeating_nodes.htm

-Kiran.

Niggy wrote:
> I have it working almost.  The For Each activity is iterating through an
> assign which copies the complex type and its elements.  The trouble is that
> it is overwriting the data, so I only see the second item in a set of two.
> Any ideas?
>
> Nigel
>
> Wouter van Reeven wrote:
>  
>> On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
>>    
>>> I want to iterate through an invoked and received complex type using a
>>> counter in order to copy all the element values to my wsdl's complex
>>> type.
>>> I guess I need to initialize a counter which should always be less than
>>> the
>>> count of my complex types and then create an assign to map all the
>>> elements
>>> if all that makes sense?
>>>      
>> You can use the ForEach activity for that. You can find that in the
>> Structured
>> Activities palette. If you'd like to keep track of a counter you might
>> initiate
>> it to 0 before the ForEach activity and then increase the value inside the
>> ForEach activity with another Assign activity.
>>
>>
>> HTH, Wouter
>>
>> --
>>
>> People: "If she weighs the same as a Duck, she's made of wood!"
>> Sir Bedevere: "And therefore...?"
>>
>>
>>    
>
>  

--
Kiran Bhumana
Open ESB Community (http://open-esb.org)

Re: Initialize bpel variable

by Kiran Bhumana-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Where do you get the selection failure? What does the log say? What does your BPEL look like?

Did you use the BPEL debugger? Try using that to debug your project.

Niggy wrote:
OK.  If I set the predicate to 1, I get the first element and so on.  That
works.  If I initialize a counter before the foreach and increment it in an
assign during the foreach and use this counter+1 as the predicate - since
the values are accessed from 1 upwards - I get a selectionFailure. 


Kiran Bhumana-2 wrote:
  
Could it be because you are not using an index to access your repeating 
elements? Repeating elements are like arrays, and you need to use 
predicate expression to get or set values.
Perhaps this blog entry will help you do create predicate expression.
http://blogs.sun.com/kiransden/resource/how_to_create_repeating_nodes/how_to_create_repeating_nodes.htm

-Kiran.

Niggy wrote:
    
I have it working almost.  The For Each activity is iterating through an
assign which copies the complex type and its elements.  The trouble is
that
it is overwriting the data, so I only see the second item in a set of
two. 
Any ideas?

Nigel

Wouter van Reeven wrote:
  
      
On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
    
        
I want to iterate through an invoked and received complex type using a
counter in order to copy all the element values to my wsdl's complex
type. 
I guess I need to initialize a counter which should always be less than
the
count of my complex types and then create an assign to map all the
elements
if all that makes sense?
      
          
You can use the ForEach activity for that. You can find that in the
Structured
Activities palette. If you'd like to keep track of a counter you might
initiate
it to 0 before the ForEach activity and then increase the value inside
the
ForEach activity with another Assign activity.


HTH, Wouter

-- 

People: "If she weighs the same as a Duck, she's made of wood!"
Sir Bedevere: "And therefore...?"


    
        
  
      
-- 
Kiran Bhumana
Open ESB Community (http://open-esb.org)



    

  

-- 
Kiran Bhumana
Open ESB Community (http://open-esb.org)

Re: Initialize bpel variable

by Niggy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Its ok - I was iterating through the foreach loop too many times.  Everything's working.  Thanks for sticking with me on this.

Nigel


OK.  If I set the predicate to 1, I get the first element and so on.  That works.  If I initialize a counter before the foreach and increment it in an assign during the foreach and use this counter+1 as the predicate - since the values are accessed from 1 upwards - I get a selectionFailure.

Kiran Bhumana-2 wrote:
Could it be because you are not using an index to access your repeating
elements? Repeating elements are like arrays, and you need to use
predicate expression to get or set values.
Perhaps this blog entry will help you do create predicate expression.
http://blogs.sun.com/kiransden/resource/how_to_create_repeating_nodes/how_to_create_repeating_nodes.htm

-Kiran.

Niggy wrote:
> I have it working almost.  The For Each activity is iterating through an
> assign which copies the complex type and its elements.  The trouble is that
> it is overwriting the data, so I only see the second item in a set of two.
> Any ideas?
>
> Nigel
>
> Wouter van Reeven wrote:
>  
>> On Thu, Feb 28, 2008 at 04:56:50AM -0800, Niggy wrote:
>>    
>>> I want to iterate through an invoked and received complex type using a
>>> counter in order to copy all the element values to my wsdl's complex
>>> type.
>>> I guess I need to initialize a counter which should always be less than
>>> the
>>> count of my complex types and then create an assign to map all the
>>> elements
>>> if all that makes sense?
>>>      
>> You can use the ForEach activity for that. You can find that in the
>> Structured
>> Activities palette. If you'd like to keep track of a counter you might
>> initiate
>> it to 0 before the ForEach activity and then increase the value inside the
>> ForEach activity with another Assign activity.
>>
>>
>> HTH, Wouter
>>
>> --
>>
>> People: "If she weighs the same as a Duck, she's made of wood!"
>> Sir Bedevere: "And therefore...?"
>>
>>
>>    
>
>  

--
Kiran Bhumana
Open ESB Community (http://open-esb.org)