BizTalk Server Orchestration - Checking for a null property

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server Orchestration > April 2004 > Checking for a null property





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 Checking for a null property
Eric Z. Beard

2004-04-23, 3:36 pm

Hello,

Hopefully this will be a simple question to answer.

If you promote a property that is based on an optional XML field, how
can you check to see if it exists? This expression statement fails:

IncomingPOMsg(WSPOSampleBizTalk.PropertySchema.Description) == null

with this error in the event log:

There is no value associated with the property
'WSPOSampleBizTalk.PropertySchema.Description' in the message

I must be missing something simple.

Thanks!

EZB
Eric Z. Beard

2004-04-27, 9:36 am

I'll go ahead and answer my own post.. it was pretty simple but just
in case someone else is searching for it:

You can't check for null with a promoted property. It must be
guaranteed to exist in the XML. So you need to put something like a
blank string in the XML.. the orchestration will fail if a promoted
type does not appear.

By the way, it might be nice to have some sort of Biztalk method like
PropertySpecified(String propName): bool

so that the whole orchestration won't abort if you receive an XML file
that's missing an element. I realize you shouldn't use an element
with MinOccurs=0 for a promoted property, but Biztalk lets you shoot
yourself in the foot and do it anyway.

EZB

ericzbeard@yahoo.com (Eric Z. Beard) wrote in message news:<8684f290.0404231117.54e8dca0@posting.google.com>...
> Hello,
>
> Hopefully this will be a simple question to answer.
>
> If you promote a property that is based on an optional XML field, how
> can you check to see if it exists? This expression statement fails:
>
> IncomingPOMsg(WSPOSampleBizTalk.PropertySchema.Description) == null
>
> with this error in the event log:
>
> There is no value associated with the property
> 'WSPOSampleBizTalk.PropertySchema.Description' in the message
>
> I must be missing something simple.
>
> Thanks!
>
> EZB

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com