Mombu the Microsoft Forum

Go Back   Mombu the Microsoft Forum > Microsoft > BIZTALKSERVER (TECHNET) > use of unconstructed message error
User Name
Password
REGISTER NOW!




Reply
 
1 24th September 16:02
External User
 
Posts: 1
Default use of unconstructed message error



I'm getting realy frustrated with BizTalk. (More accurately, with my not
understanding the messaging).

I'm trying to do something incredibly simple: receive a message of type X,
run a simple transform, and send it out as a message of type X.

The transform couldn't be simpler: put current date/time in a couple of
nodes, put some hard-coded strings here & there, other than that, it's an
identity transform.

However, when I try to build, I get a "use of unconstructed message" error.

The receive port/shape, the transform, and the send shape/port all use the
same message type. It seems to me BT should be able to take the incoming
message, let me run a simple transform, and output a message of that type.

I don't understand why some piece of the orchestration thinks the message is
unconstructed. Is there a problem with using the same type of message for
both input and output of a transform?

Thanks to all.
  Reply With Quote


 


2 29th September 15:17
randal van splunteren
External User
 
Posts: 1
Default use of unconstructed message error



Hello golddog,

Make sure that the transform has a different source and destination message.
I your case the source message is the message that comes in through the receive
shape. However you need to create a new message instance of the same message
type as the destination for the transform/map. You can than also use this
message to send out by using the send shape.

In general in a transform shape you can't use the same message for both source
and destination. This is because messages are immutable in BizTalk.

HTH,

Randal van Splunteren
Aviva Solutions
  Reply With Quote
3 29th September 15:17
External User
 
Posts: 1
Default use of unconstructed message error


Thank you. I'd seen some articles in other places talking about that, I kind
of figured my problem was related, but it wasn't clear to me what their code
examples were doing.

For example, they talked about using a Message Assignment to do something
like this in the expression:

myMessage2 = myMessage1;
myMessage2(*) = myMessage1(*);
myMessage2.ChangedField = \"NewValue\";

(In my case, my message type X is defined in a project called Schemas. I
think the class type is the Message Type attribute of the Message from the
Orchestration View, right?).

Here's what's not clear to me:

1) How do I know the variable name for the incoming message ("myMessage1" in
the example above)? I thought the Receive shape's "Message" attribute
defines the message type, but I don't know what the constructed class is
called inside the orchestration.

2) How does the new message become the message which is passed along the
orchestration? In other words, in a Construct Message, I will have a
MessageAssignment whose expression creates myMessage2 followed by a
transform; what causes myMessage2 to be the thing which goes into the
transform and (eventually) the send port, instead of myMessage1?

I just don't feel like I'm getting it. Everything in BizTalk is a struggle,
and that can't be right. Other people use it without so many problems.

Thank you very much for your advice. I appreciate the effort.
  Reply With Quote
4 29th September 15:17
External User
 
Posts: 1
Default use of unconstructed message error


Thank you. I'd seen some articles in other places talking about that, I kind
of figured my problem was related, but it wasn't clear to me what their code
examples were doing.

For example, they talked about using a Message Assignment to do something
like this in the expression:

myMessage2 = myMessage1;
myMessage2(*) = myMessage1(*);
myMessage2.ChangedField = \"NewValue\";

(In my case, my message type X is defined in a project called Schemas. I
think the class type is the Message Type attribute of the Message from the
Orchestration View, right?).

Here's what's not clear to me:

1) How do I know the variable name for the incoming message ("myMessage1" in
the example above)? I thought the Receive shape's "Message" attribute
defines the message type, but I don't know what the constructed class is
called inside the orchestration.

2) How does the new message become the message which is passed along the
orchestration? In other words, in a Construct Message, I will have a
MessageAssignment whose expression creates myMessage2 followed by a
transform; what causes myMessage2 to be the thing which goes into the
transform and (eventually) the send port, instead of myMessage1?

I just don't feel like I'm getting it. Everything in BizTalk is a struggle,
and that can't be right. Other people use it without so many problems.

Thank you very much for your advice. I appreciate the effort.
  Reply With Quote
5 29th September 15:17
jan eliasen
External User
 
Posts: 1
Default use of unconstructed message error


The myMessage1 is the message you specify on the receive shape.

When you write this:
NewMessage = myMessage1
it means that you set NewMessage to be the same as myMessage1 - no
transformation needed! But after you have given NewMessage the same
content as myMessage1, you can change values, using distinguished
fields - as long as you are inside the same construct message shape.

I have put an example of what you are trying to accomplish at
http://www.eliasen.dk/biztalk/messageassignment.zip

--
eliasen, representing himself and not the company he works for.

Private blog: http://blog.eliasen.dk

Private email: jan@eliasen.dk
  Reply With Quote
6 29th September 15:18
External User
 
Posts: 1
Default use of unconstructed message error


Thanks very much, Jan and Randal. Great help.

In case anyone else stumbles upon this thread, the assignment tutorial Jan
put together is great. It exposes things I didn't know how to do in BizTalk
like:

--create orchestration-level variables (right-click the variables folder in
the orchestration view)
--use those variables in an expression (the syntax is kind of C#-like, but
not quite--the types are defined in the variables above)
--make clear that the Message attribute in receive/send/construct shapes is
the orchestration variable name (I'd thought it was just giving a reference
to the *type* of message, but creating a new message is creating a new
object, not defining a new type).
--Made clearer how the message flow works, and how things like transforms
actually create a new message object of the same type.

One follow-up on this: in my simple orchestration, I get message X, run a
transform to construct message Y, then send it via an FTP port to a file.

In my first run, I forgot to change the send shape's message, so the FTP
site got message X. After a bit of dithering why my transform wasn't, I
realized that, and off we went.

But now that I'm sending Y to FTP, what's happened to X? It seems like it's
in a bad state; came into the orchestration, then just stopped instead of
processing to some "completion".

Sincere thanks again guys.
  Reply With Quote
7 29th September 15:18
External User
 
Posts: 1
Default use of unconstructed message error


Thanks Randal and Jan, your explanations really helped.

In case anyone else comes across this thread with similar problems, download
what Jan's got, it shows a nice, simple orchestration and cleared up a lot
for me:

--Shows setting up an orchestration variable (right-click variables in the
orchestration view)
--using that variable in an expression (kind of C# syntax, but not exactly)
--cleared up for me some of how messages flow (I'd thought that the Message
attribute in the receive/send/construct shapes was just defining the *type*
of message, via the orchestration's Message. Now I see it's the name of an
object to represent that type).
--And that's why my transform needs to have a different message going in and
coming out; it's not that I'm tweaking some nodes in a type X message, I'm
taking in a type X message named "bob" and transforming it into a type X
message named "tom".

One follow-up, if you get this far:

When I initially plugged in my transform, I got the original message on the
FTP site. After dithering a bit about what was wrong with my transform, I
realized I'd forgotten to change the Message on my Send shape to the
newly-constructed variable.

My question is this: it seems like there's a message in a bad or incomplete
state then: "bob" comes in, is transformed into "tom", which goes to a send
port and gets completed. But "bob" is still just hanging around. What
happened to him?

Or, for fans of Bill Murray, what about bob?

Sincere thanks again guys.
  Reply With Quote
8 29th September 15:18
jan eliasen
External User
 
Posts: 1
Default use of unconstructed message error


Well, the incoming message has served its purpose. It is like a
variable that comes into a method. You can use it all you want, but at
the end of the method, the variable i just garbage collected.

If you want to, you can write the message to a file, but basically, if
you only needed it to construct the new message, then that's all you
needed. If an orchestration completes, all mesasges inside it are
lost. If you need it somewhere, you can send it out via a port. Or you
can enable tracking in BizTalk to keep it.

--
eliasen, representing himself and not the company he works for.

Private blog: http://blog.eliasen.dk

Private email: jan@eliasen.dk
  Reply With Quote


 


Reply






Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666