0

In a Biztalk map, how can I execute a scripting functoid ONLY IF the source message contains a specific value? Which functoid combination can allow me to do this?

Edit

I want to check a certain element for a specific value. The scripting will be inline xslt.

In response to 40Alpha first suggestion: This is the method I would like to use but I can't connect the scripting functoid to the value mapping functoid. I'm probably doing something wrong here?

Imgur

ChG
  • 349
  • 1
  • 3
  • 13
  • Can you elaborate on `specific value`... do you want to search all nodes in the message for a specific value, check a certain element for a specific value, or look if a specific element is present? – S1r-Lanzelot Oct 14 '14 at 21:41
  • Also what type of scripting are you using in the current functoid, inline C#, XSLT, etc? – S1r-Lanzelot Oct 14 '14 at 22:04

1 Answers1

2

The two easiest options (IMO) would be:

What I would do is:

  1. Create an Equal Functoid (1st condition being that "certain element" and 2nd condition being the text you would like to check it against)
  2. Create a Value Mapping Functoid and connect the Equal Functoid (that you just made) to it first and then connect it your scripting functoid.
  3. Now connect your scripting functoid to the desired target element(s).

OR a simpler approach would be:

Wrap your xslt with this in your scripting functoid:

<xsl:if test="/yournode[text()="SomeValue"]">
    <!--YOUR SCRIPTING HERE -->
</xsl:if>
S1r-Lanzelot
  • 2,206
  • 3
  • 31
  • 45
  • The first suggestion is what I want to do, but I can't seem to connect the scripting functoid to the value mapping one. If all else fail I'll try your second suggestion. Please see my edit. – ChG Oct 14 '14 at 23:18
  • You need to pass two arguments to the the value mapping functoid (1: true/false -> which the `=` functoid is doing; 2: a value to pass), also what is your scripting function doing? Can you post that to your question. Please read what each functoid does within the biztalk windows (double click the functoid and read the text at the bottom of the opened window)... it will help you understand what arguments are required in each functoid. Lastly, please help me understand your desired logic, do you want to pass the value of the certain element (if it exists) into the scripting functoid? – S1r-Lanzelot Oct 15 '14 at 01:05