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

RUNTIME EXCEPTION-Cannot cast null to boolean'.

Hi Friends,

I have the below mapping.The if condition is satisfied,even though 'then' value is going to the target field.

When i try to check the queue of the 'IF' function it is throwing error RUNTIME EXCEPTION-Cannot cast null to boolean

>splitbyvalue(eachvalue) ----> then

->splitbyvalue(eachvalue)


>if---->target field

->mapwithdefault ->else

Please help !!!

Regards,

Suresh.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2009 at 08:46 AM

    the input to the if standard function should be boolean value true or false.So use those standard function before if whose output is boolean.

    SplitByValue does not return boolean value.

    If you tell us your mapping requirement then we will help you to do the correct mapping.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 05, 2009 at 08:46 AM

    Hi Suresh,

    >splitbyvalue(eachvalue)----> then

    ->splitbyvalue(eachvalue)


    >if---->target field

    ->mapwithdefault->else

    What are you trying to do with the above mapping?What is the source field? Provide some more details

    >>RUNTIME EXCEPTION-Cannot cast null to boolean

    This is a valid error because you are passing "null" and it expected "boolean"

    Regards

    Suraj

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Suresh,

      Please try the below code with the inputs to the function as otype, filter and telno respectively. Use context as the input type in the UDF

      for(int i=0;i<OTYPE.length;i++)

      {

      if(OTYPE<i> == "P" & FILTER<i> == "SD1"

      (

      TELNO<i> = "123";

      result.addValue(TELNO<i>);

      )

      else

      result.addValue(TELNO<i>);

      }

      Regards,

      Vishnu.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 05, 2009 at 10:03 AM

    Hi Suresh ,

    Do the mapping as

    OTYPE -------->equalS------------->\
    Constant[P]/                                  Constant[123]--->Then
                                           -->And -------------------> If ------- --- --> TELNO
    FILTER------->equalS(StringFunction)--->/                  TELNO-->Else
     Constant[SD1]
    
    

    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.