cancel
Showing results for 
Search instead for 
Did you mean: 

How to get rid of the first "null" in SplitByValue

Former Member
0 Kudos

Hi,

I have a message mapping

... --> SplitByValue --> if --> ...

The very first element of the input queue is a Context Change with the label SUPRESS. The first value of the output queue however is a context change with the label [null]. Therefore the if-step complains: RuntimeException in Message-Mapping transformation: Cannot cast null to boolean.

I can not believe that I am the first person with this problem, but I couldn't find any solutions, yet. I hope someone has an idea...

Thanks and regards,

Dominik Schlund

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Just use Remove Context before the splitByValue or check with exists API if the node exists or supressed.

--> "exists" -->"if-then-else",

Accordingly you could process ahead with avoiding the 1st Supress value.

Thanks

Swarup

Edited by: Swarup Sawant on Feb 26, 2008 7:15 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

thanks for all the quick ideas. I now solved it by simply adding a sort after the SplitByValue. Since every value is in its own context anyway that doesn't change anything, but it converts the CC-null into CC-SUPPRESS again.

However I see it mor as a workaraound than a solution. I would say that the behaviour of the SplitByValue is strange at the first place.

Anyway, thanks for your help,

Dominik

Former Member
0 Kudos

Hi,

One more solution for you:

Use standard function of mapWithDefault, it will manually create a node if the node not exist.

This node can manually maintain the length of queue for one node equals to another node.

It is useful when you use SortBykey.

It depends on your case, to choose which one is best solution.

Liang

Edited by: Liang Ji on Feb 27, 2008 5:50 AM

Former Member
0 Kudos

maybe use function idExists from node function than in case of empty you will receive false.

/wg