|
Home > Archive > BizTalk Server Orchestration > February 2006 > Correlation Challenges
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Correlation Challenges
|
|
| Neal Walters 2006-02-08, 9:01 pm |
| I'm dying to know how correlation internals work.
I create a demo orch just to see what is possible...
1) Receive TestOrderIn (activating receive)
2) Map to TestOrderReq
3) Under an Decide statement I send TestOrderReq
The decide is based on x > 1, and x is initialized to 10.
I initialize correlation set on the send.
4) I have a second Decide statement, same critieria x> 1.
I use the following correlation set on the receive.
The compiler is trying to "help" me, and giving me error:
error X2279: uninitialized correlation
'TestCorrelationInit.TestCorrInitOrch.Correlation_1'
Of course if I take out the Decide shapes, it will compile and run okay.
In my application, I know that I won't try the Receive unless I have done
the Send, but the compiler can't figure that out.
So this gets back to my question in previous posts, is there a way to
initialize correlation other than sending a message?
It seems like one get around would be to send a dummy message.
I know you can also initialize correlation on a receive, but might want to
generate a GUID to use for the value of the correlation.
This gets back to something else I've been trying to figure out.
When is the subscription written to the database?
I.e. when you use the subscription viewer, it is show us entries in a
subscription table.
Is the subscript set up:
1) On the initialize correlation
2) When a receive is encountered
3) Send
4) Other
Here's another case - what about the scatter gather model?
If you send out 10 messages, then receive 10 messages in a loop?
What happens if the one of the 10 messages results in a return message
before the last of the 10 messages is sent? This makes me think that the
subscription must be entered on the Send?
Thanks again - lost in correlation and parallel shape land.
What got me started on the above was this situation:
It seems like there should be an initialize correlation shape!
To get around the problem I posted earlier today about the parallel action
shape, I'm considering starting two different orchestrations. I don't want to
use the StartOrch shape because I need to continue when they are done.
Thus, I was going to use a Send with direct binding, then have a
gather-loop. The problem is that I might call Orch-X and I might call Orch-Y
or I might not call either one (but each one will not be called more than
once). I'm planning on doing a receive in a loop based on counter.
If I keep the send that starts Orch-X and Orch-Y in a parallel shape for
readability, then neither branch can initialize the correlation.
My correlation will be a GUID in a SOAP-Header.
If I switch to sequential where I might call Orch-X then I might call
Orch-Y, then I guess I have to put the second Send under a decide shape that
has to know if the previous Send already initialized correlation or not?
Neal Walters
http://Biztalk-Training.com
| |
| Samuel L 2006-02-10, 7:48 am |
| Hi Neal!
I'm no expert, but I have some thoughts about your questions.
First, there is no way to "manually" initialize a correlation set, so it
must initialized using either a send or receive shape. I have been searching
for a way to initialize it using an expression shape, so having an
"initialize correlation shape" is an excellent idea.
Secondly, is it possible to have a decision shape execute two branches in
the same execution? I thought this was not the case, but maybe you're right
there.
I hope you will get some more feedback on this! Godd luck!
"Neal Walters" wrote:
> I'm dying to know how correlation internals work.
>
> I create a demo orch just to see what is possible...
>
> 1) Receive TestOrderIn (activating receive)
> 2) Map to TestOrderReq
> 3) Under an Decide statement I send TestOrderReq
> The decide is based on x > 1, and x is initialized to 10.
> I initialize correlation set on the send.
> 4) I have a second Decide statement, same critieria x> 1.
> I use the following correlation set on the receive.
>
> The compiler is trying to "help" me, and giving me error:
> error X2279: uninitialized correlation
> 'TestCorrelationInit.TestCorrInitOrch.Correlation_1'
>
> Of course if I take out the Decide shapes, it will compile and run okay.
>
> In my application, I know that I won't try the Receive unless I have done
> the Send, but the compiler can't figure that out.
>
> So this gets back to my question in previous posts, is there a way to
> initialize correlation other than sending a message?
>
> It seems like one get around would be to send a dummy message.
>
> I know you can also initialize correlation on a receive, but might want to
> generate a GUID to use for the value of the correlation.
>
> This gets back to something else I've been trying to figure out.
> When is the subscription written to the database?
> I.e. when you use the subscription viewer, it is show us entries in a
> subscription table.
>
> Is the subscript set up:
> 1) On the initialize correlation
> 2) When a receive is encountered
> 3) Send
> 4) Other
>
>
> Here's another case - what about the scatter gather model?
> If you send out 10 messages, then receive 10 messages in a loop?
> What happens if the one of the 10 messages results in a return message
> before the last of the 10 messages is sent? This makes me think that the
> subscription must be entered on the Send?
>
> Thanks again - lost in correlation and parallel shape land.
>
> What got me started on the above was this situation:
>
> It seems like there should be an initialize correlation shape!
>
> To get around the problem I posted earlier today about the parallel action
> shape, I'm considering starting two different orchestrations. I don't want to
> use the StartOrch shape because I need to continue when they are done.
>
> Thus, I was going to use a Send with direct binding, then have a
> gather-loop. The problem is that I might call Orch-X and I might call Orch-Y
> or I might not call either one (but each one will not be called more than
> once). I'm planning on doing a receive in a loop based on counter.
>
> If I keep the send that starts Orch-X and Orch-Y in a parallel shape for
> readability, then neither branch can initialize the correlation.
>
> My correlation will be a GUID in a SOAP-Header.
>
> If I switch to sequential where I might call Orch-X then I might call
> Orch-Y, then I guess I have to put the second Send under a decide shape that
> has to know if the previous Send already initialized correlation or not?
>
> Neal Walters
> http://Biztalk-Training.com
| |
| MaurĂcio Ritter 2006-02-10, 5:51 pm |
| Can't you use a another orchestration with a Start Orchestration shape and
pass a port as a parameter to it ? This will you would use SelfCorrelation
and kindof "call back port". Don't know if got the problem you're having.
I've written an article about parallelism using two orchestrations, if you're
interested here is the link:
http://www.codeproject.com/useritems/bts_async_call.asp
--
MaurĂ_cio Ritter
MCP (Biztalk 2004), MCSD (VC++, VB, VB.NET), MCAD
MCSE (Win2000), MCDBA (SQL2000), MCT years 2002 to 2005
http://www.dotnetmaniacs.com.br
"Neal Walters" wrote:
> I'm dying to know how correlation internals work.
>
> I create a demo orch just to see what is possible...
>
> 1) Receive TestOrderIn (activating receive)
> 2) Map to TestOrderReq
> 3) Under an Decide statement I send TestOrderReq
> The decide is based on x > 1, and x is initialized to 10.
> I initialize correlation set on the send.
> 4) I have a second Decide statement, same critieria x> 1.
> I use the following correlation set on the receive.
>
> The compiler is trying to "help" me, and giving me error:
> error X2279: uninitialized correlation
> 'TestCorrelationInit.TestCorrInitOrch.Correlation_1'
>
> Of course if I take out the Decide shapes, it will compile and run okay.
>
> In my application, I know that I won't try the Receive unless I have done
> the Send, but the compiler can't figure that out.
>
> So this gets back to my question in previous posts, is there a way to
> initialize correlation other than sending a message?
>
> It seems like one get around would be to send a dummy message.
>
> I know you can also initialize correlation on a receive, but might want to
> generate a GUID to use for the value of the correlation.
>
> This gets back to something else I've been trying to figure out.
> When is the subscription written to the database?
> I.e. when you use the subscription viewer, it is show us entries in a
> subscription table.
>
> Is the subscript set up:
> 1) On the initialize correlation
> 2) When a receive is encountered
> 3) Send
> 4) Other
>
>
> Here's another case - what about the scatter gather model?
> If you send out 10 messages, then receive 10 messages in a loop?
> What happens if the one of the 10 messages results in a return message
> before the last of the 10 messages is sent? This makes me think that the
> subscription must be entered on the Send?
>
> Thanks again - lost in correlation and parallel shape land.
>
> What got me started on the above was this situation:
>
> It seems like there should be an initialize correlation shape!
>
> To get around the problem I posted earlier today about the parallel action
> shape, I'm considering starting two different orchestrations. I don't want to
> use the StartOrch shape because I need to continue when they are done.
>
> Thus, I was going to use a Send with direct binding, then have a
> gather-loop. The problem is that I might call Orch-X and I might call Orch-Y
> or I might not call either one (but each one will not be called more than
> once). I'm planning on doing a receive in a loop based on counter.
>
> If I keep the send that starts Orch-X and Orch-Y in a parallel shape for
> readability, then neither branch can initialize the correlation.
>
> My correlation will be a GUID in a SOAP-Header.
>
> If I switch to sequential where I might call Orch-X then I might call
> Orch-Y, then I guess I have to put the second Send under a decide shape that
> has to know if the previous Send already initialized correlation or not?
>
> Neal Walters
> http://Biztalk-Training.com
| |
| Neal Walters 2006-02-10, 5:51 pm |
| That's what Stephen Thomas showed me and it's working fine. I never really
explored the idea of passing ports before.
Obrigado!
Neal Walters
http://Biztalk-Training.com
|
|
|
|
|