-1

When I want to compile, an error shown

use of unconstructed message

My code for expression is:

Message_2.Approved == false

XML code in scheme Article.xsd:

  <xs:element name="Approved">
  <xs:simpleType>
  <xs:restriction base="xs:boolean" /> 
  </xs:simpleType>
  </xs:element>

Message_2 is assigned to assigned to a Send shape.

And Message Type of Message_2 is BizTalk_Server_Project7.Article .

Bahman
  • 1
  • 3
  • Have never worked with `biztalk`, but maybe the error is because of the typo in `Artcile`? – Tim Zimmermann Aug 31 '14 at 08:21
  • Nothing is wrong with Article. Article is an XML scheme which is used into expression. My problem is to set the value to this part of Article. – Bahman Aug 31 '14 at 08:55
  • I know of `Article`, but in your post it says `ArtCile`. If you copy-pasted it, maybe that is the source of your error. – Tim Zimmermann Aug 31 '14 at 09:51
  • Is that the entire source of the Expression Shape? There is no 'if'. – Johns-305 Sep 01 '14 at 13:05
  • 1
    Is your code `Message_2.Article.Approved = false;` in an Expression Shape or in a Rule for Decision Shape? If it is a rule decision shape it should be `Message_2.Article.Approved == false` That is = should be == and no ; (semicolon) – Dijkgraaf Sep 02 '14 at 03:49
  • @Johns-305 In BizTalk you can't have an If in an Expression Shape. To achieve If logic in an Orchestration you need to use a Decision Shape in which you enter a boolean expression for each rule. – Dijkgraaf Sep 02 '14 at 03:54
  • Try using `!Message_2.Article.Approved` If that still gives the same error it means that it isn't actually a Boolean and there is something wrong with your distinguished field. And please answer if it is an Expression or a Decision shape. And are you trying to set the value as per your comment #2 or read it? – Dijkgraaf Sep 02 '14 at 22:17
  • The `Message Type` of `Message2` is `BizTalk_Server_Project7.Article`. – Bahman Sep 03 '14 at 05:17
  • This code is correct: `Message_2.Approved==false` but when I compile the project an error shown as **use of unconstructed message 'Message_2'** – Bahman Sep 03 '14 at 16:15
  • @Bahman. As you aren't answering the questions being asked of you it is very hard for us to determine what the issues are, especially as you seem now to be encountering a new problem. Please update your question with more details or if it is a new problem start a new question. The use of unreconstructed message means you are probably trying to assign to a message outside of a Construct Message shape, or you haven't created the message in the Construct Message shape yet. The fact that you are getting an error message means that your code is not correct. – Dijkgraaf Sep 03 '14 at 21:26
  • Ok! I updated. I assigned to a Send shape. – Bahman Sep 04 '14 at 16:05

2 Answers2

0

It looks like there is something wrong with your property promotion.

You are trying to use 'Approved' as a distinguished field in your expression shape to set a value, which is perfect use of a distinguished field. Please review this tutorial on MSDN if you did everything right.

Jeroen Maes
  • 663
  • 3
  • 8
  • Still anything doesn't change. – Bahman Sep 01 '14 at 10:15
  • This code is correct: `Message_2.Approved==false` but when I compile the project an error shown as **use of unconstructed message 'Message_2'** – Bahman Sep 03 '14 at 16:16
  • When you are trying to assing values to a message, you must do this from within a contruct message shape where you define the message that you are about to change. You can checkout the following thread about the ways of creating messages in an orchestration: http://stackoverflow.com/questions/313269/what-is-the-best-way-to-create-a-new-message-within-a-biztalk-orchestration – Jeroen Maes Sep 04 '14 at 16:09
0

make sure that the used property is promoted or distinguished before can be used in your orchestration's expression shape. if your property will be used only in messagebox context and not outside(filters or pipelines) you can make simple and use distiguished field.

Hichamveo
  • 340
  • 1
  • 13