BizTalk Server General - biztalk mapping functoid - logical existence and scripts

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > December 2004 > biztalk mapping functoid - logical existence and scripts





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 biztalk mapping functoid - logical existence and scripts
pete

2004-09-22, 9:52 pm

i am not sure what group to post this in so i am starting
here.

i am mapping with the functoid 'logical existence'. if
this functiod is used in a situation where a record may or
may not be present. i know if the record is present i get
a result of 'true'. i have made the assumption
that 'false' is the result if the record is not present.

more specifically, i am check the existence of a record
and mapping a field within the record into a script as two
parameters. if it exist then i want to take a field from
the record and multiple by 100. if the record does not
exist then i want to make the result = zero.

here is the script

Function charges(betrgexist,chargeamt )
'if e1edk05/betrg exist then we have charges to add
' to invoice else force charges = 0

if betrgexist = "true" then
charges = chargeamt
else
charges = 1 * 0
end if

End Function

what i cant determine is my output when the record does
not exist.

does anyone have any ideas of what that output value would
be
Tatyana Yakushev [MSFT]

2004-09-22, 9:52 pm

Do you need to create a map that
if record exists
get value of some field in that record, mutiply it by 100 and return the result
else
return 0
?

This is easy to do.

1.Drop Logical Existance functoid connected to the record
2. Drop * functoid and connect it to the field, enter second value 100
3. Drop value mapping functoid, first input should be comming from functoid 1, second from fuctoid 2.
3. Drop some functoid that returns 0.
4. Drop logical equal functoid, connect it to logical existange functoid, enter second value "false"
5. Drop value mapping funcoitd, first input should be comming from 4, second input should be comming from 3.

If you need something different, please clarify what you need.

Thanks,
Tatyana

--------------------
>Content-Class: urn:content-classes:message
>From: "pete" <anonymous@discussions.microsoft.com>
>Sender: "pete" <anonymous@discussions.microsoft.com>
>Subject: biztalk mapping functoid - logical existence and scripts
>Date: Fri, 17 Sep 2004 10:52:07 -0700
>Lines: 34
>Message-ID: <0d0f01c49cdf$0cb62440$a501280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>thread-index: AcSc3wy2ZpmtjFz/TQq2JmWBIFptXA==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.biztalk.general
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.biztalk.general:19638
>NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
>X-Tomcat-NG: microsoft.public.biztalk.general
>
>i am not sure what group to post this in so i am starting
>here.
>
>i am mapping with the functoid 'logical existence'. if
>this functiod is used in a situation where a record may or
>may not be present. i know if the record is present i get
>a result of 'true'. i have made the assumption
>that 'false' is the result if the record is not present.
>
>more specifically, i am check the existence of a record
>and mapping a field within the record into a script as two
>parameters. if it exist then i want to take a field from
>the record and multiple by 100. if the record does not
>exist then i want to make the result = zero.
>
>here is the script
>
>Function charges(betrgexist,chargeamt )
>'if e1edk05/betrg exist then we have charges to add
>' to invoice else force charges = 0
>
> if betrgexist = "true" then
> charges = chargeamt
> else
> charges = 1 * 0
> end if
>
>End Function
>
>what i cant determine is my output when the record does
>not exist.
>
>does anyone have any ideas of what that output value would
>be
>



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

pete

2004-09-28, 5:52 pm

i am sorry it has taken so long to get back.
Yes,that is right but with an additional requirement. the
mapping logic works fine as long as there is a value to
return. the map will output a record segment and the
result is successfully added to another field and outputed
but when the result is zero(i guess because i cant tell
what the result is) i want to add the zero to the
aforementioned field and output a total too. more
specifically, this is a set of routines for an invoice
where there may be a service charge or not. another
portion of the map sums the invoice line items (qty *
cost) for the entire invoice. any service charges are in
another set of fields in the input document that occur at
the end of the data stream. if there is a service charge
i can successfully add it to the summation of line items
and output a net invoice amount (lines + service charge)
but when there are no service charges i get no output at
all. one of my real issues is debugging the output when
no service charge and output. another is ideas on
technique when no service charge records are resident in
the data stream to still be able to take the summation
output and move into net invoice amount

>-----Original Message-----
>Do you need to create a map that
>if record exists
> get value of some field in that record, mutiply it

by 100 and return the result
>else
> return 0
>?
>
>This is easy to do.
>
>1.Drop Logical Existance functoid connected to the record
>2. Drop * functoid and connect it to the field, enter

second value 100
>3. Drop value mapping functoid, first input should be

comming from functoid 1, second from fuctoid 2.
>3. Drop some functoid that returns 0.
>4. Drop logical equal functoid, connect it to logical

existange functoid, enter second value "false"
>5. Drop value mapping funcoitd, first input should be

comming from 4, second input should be comming from 3.
>
>If you need something different, please clarify what you

need.
>
>Thanks,
>Tatyana
>
>--------------------
and scripts[vbcol=seagreen]
microsoft.public.biztalk.general:19638[vbcol=seagreen]
starting[vbcol=seagreen]
or[vbcol=seagreen]
get[vbcol=seagreen]
two[vbcol=seagreen]
would[vbcol=seagreen]
>
>
>--
>
>This posting is provided "AS IS" with no warranties, and

confers no rights. Use of included script samples are
subject to the terms specified at
>http://www.microsoft.com/info/cpyright.htm
>
>Note: For the benefit of the community-at-large, all

responses to this message are best directed to the
newsgroup/thread from which they originated.
>
>.
>

Tatyana Yakushev [MSFT]

2004-09-29, 8:03 pm

Look at the steps 3,4 and 5 that I provided before. These steps are there specifically to return some result if record is not there.

Regards,
Tatyana

--------------------
>Content-Class: urn:content-classes:message
>From: "pete" <anonymous@discussions.microsoft.com>
>Sender: "pete" <anonymous@discussions.microsoft.com>
>References: <0d0f01c49cdf$0cb62440$a501280a@phx.gbl> <jVDAjcOnEHA.4040@cpmsftngxa06.phx.gbl>
>Subject: RE: biztalk mapping functoid - logical existence and scripts
>Date: Tue, 28 Sep 2004 09:34:56 -0700
>Lines: 129
>Message-ID: <3b0601c4a579$170b0300$a301280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcSleRcLop900QSyTWykVjd18H1ZEA==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.biztalk.general
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.biztalk.general:19952
>NNTP-Posting-Host: tk2msftngxa11.phx.gbl 10.40.1.163
>X-Tomcat-NG: microsoft.public.biztalk.general
>
>i am sorry it has taken so long to get back.
>Yes,that is right but with an additional requirement. the
>mapping logic works fine as long as there is a value to
>return. the map will output a record segment and the
>result is successfully added to another field and outputed
>but when the result is zero(i guess because i cant tell
>what the result is) i want to add the zero to the
>aforementioned field and output a total too. more
>specifically, this is a set of routines for an invoice
>where there may be a service charge or not. another
>portion of the map sums the invoice line items (qty *
>cost) for the entire invoice. any service charges are in
>another set of fields in the input document that occur at
>the end of the data stream. if there is a service charge
>i can successfully add it to the summation of line items
>and output a net invoice amount (lines + service charge)
>but when there are no service charges i get no output at
>all. one of my real issues is debugging the output when
>no service charge and output. another is ideas on
>technique when no service charge records are resident in
>the data stream to still be able to take the summation
>output and move into net invoice amount
>
>by 100 and return the result
>second value 100
>comming from functoid 1, second from fuctoid 2.
>existange functoid, enter second value "false"
>comming from 4, second input should be comming from 3.
>need.
>and scripts
>microsoft.public.biztalk.general:19638
>starting
>or
>get
>two
>would
>confers no rights. Use of included script samples are
>subject to the terms specified at
>responses to this message are best directed to the
>newsgroup/thread from which they originated.
>



--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

pete

2004-10-02, 8:59 pm

Please excuse me being a newbie to this but i tried to do
what you said and if i did it correctly i get no output
when the record and fields do not exist. i have
unsuccessfully tried many variations of steps 3,4,5
without any look.

i must be doing something very simply wrong and having
worked on it for a while i must not be able to 'see the
forest for the trees'. i have tried to depict what i
understood below. the first example works when record
exists. the second example when record/field does not
exist produces no output even if the field tds02 has data
from the summation of all invoice line detail (qty*price)

my test i thought was very simple just trying to output a
value via the value map if the record did not exist

here is what i am trying to do (2 examples : #1 works, #2
no output) this is best viewed in landscape mode

Mapping results when betrg exists

Input field logical
value /(values) output(xml)
(record exists) Existence map

Betrg ---- [?/true] ------- [--
>/ = ,100] ------- > <TDS_Record>


<TDS
PartyCode="JAS4010" TDS01="100" />

</TDS_Record>




Mapping results when betrg does not exist

Input field logical value /
(values) output (xml)
(no record) Existence map

Betrg ---- [?/false] - ---- [-- >/ = ,0] ------
- > TDS_Record>
[ ]
absolute
value = 0


1. in the first example, the record that betrg is in
is present. And being true, I can thru the value map
output 100 to the tds record into field tds01. also if
betrg is present I can add the value of betrg to another
value that is calculated by totaling (line qty * line
price for all line items on invoice) and store the sum of
the two values into the tds record in field tds01


2. in the second example. The record that betrg is in
is not present. I am trying to store the absolute value
of zero (0) into the tds01 record but instead I get
nothing. There are no values in the TDS record when the
record betrg is in does not exist in the input files.

thanks for all of your help

pete
>-----Original Message-----
>Look at the steps 3,4 and 5 that I provided before. These

steps are there specifically to return some result if
record is not there.
>
>Regards,
>Tatyana
>
>--------------------
<jVDAjcOnEHA.4040@cpmsftngxa06.phx.gbl>[vbcol=seagreen]
existence and scripts[vbcol=seagreen]
microsoft.public.biztalk.general:19952[vbcol=seagreen]
the[vbcol=seagreen]
outputed[vbcol=seagreen]
at[vbcol=seagreen]
charge[vbcol=seagreen]
record[vbcol=seagreen]
you[vbcol=seagreen]
V5.50.4910.0300[vbcol=seagreen]
may[vbcol=seagreen]
present.[vbcol=seagreen]
record[vbcol=seagreen]
from[vbcol=seagreen]
not[vbcol=seagreen]
does[vbcol=seagreen]
and[vbcol=seagreen]
>
>
>--
>
>This posting is provided "AS IS" with no warranties, and

confers no rights. Use of included script samples are
subject to the terms specified at
>http://www.microsoft.com/info/cpyright.htm
>
>Note: For the benefit of the community-at-large, all

responses to this message are best directed to the
newsgroup/thread from which they originated.
>
>.
>

Tan Bao Nguyen

2004-12-07, 5:49 pm

Pete,

Did you resolve the mapping issue? If not, could you send me your schemas,
map, and a sample of an input instance file?

Regards,
Tan

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------[vbcol=seagreen]
<jVDAjcOnEHA.4040@cpmsftngxa06.phx.gbl>
<3b0601c4a579$170b0300$a301280a@phx.gbl>
<NgScfwnpEHA.740@cpmsftngxa06.phx.gbl>[vbcol=seagreen]

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com