Skip to Content
author's profile photo Former Member
Former Member

question about message mapping

Hi,

When I use the visual mapping tool, I specify the condition that:

<SourceValue> equalsA 1, <TargetValue> value is 1; else it's 0.

However in the source XML, sometimes source XML is like:

<Root>

</Root>

where there's no SourceValue element. And now the mapping has exception. Then I try to use IsNil functionality, however then another exception saying "cannot cast '' to decimal" occurrred.

Is there a way for me to judge in the mapping so that I can pass through, e.g., when there's no this element, the target value is also 0.

Best regards,

-Stanley

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 06:19 AM

    Hi,

    Just add one Node "mapWithDefault" --> Double click on it and pass value as "0"

    So it will generate the node <TargetValue> == 0 whenever SourceValue will not be available

    Thanks

    swarup

    Edited by: Swarup Sawant on Jul 23, 2008 8:19 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 06:16 AM

    hi

    Use Condition Function , pass value if u get from the source or make other lement as constant 0 as u mentioned

    rgds

    srini

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2008 at 06:19 AM

    Hi,

    First check if the node exist using the node function exists and then check your condition.

    Thanks

    SaNv...

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 06:39 AM
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.