Topic
  • 1 reply
  • Latest Post - ‏2010-02-17T19:45:36Z by SystemAdmin
SystemAdmin
SystemAdmin
238 Posts

Pinned topic custom script erro in Virtual Appliance

‏2010-02-17T19:37:58Z |
i have a custom script in an orchestration the WORKS when testing in Cast Iron Studio.
the script adds 1 day to the current dateTime built-in function. the strings get formatted correctly using Format Date String and Read date String functions.
 script:
d1 = new Date(InDate);
d1.setDate(d1.getDate() + 1);
return d1.toUTCString();
however, when the VA tries running the orcestration, the mapping fails with the eror below
Exception in map activity: java.text.ParseException: Unparseable date: "Invalid Date"
 
Updated on 2010-02-17T19:45:36Z at 2010-02-17T19:45:36Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    238 Posts

    Do you have null dates?

    ‏2010-02-17T19:45:36Z  
    If you have empty or null dates, then you should add in the following check before you execute the Date() function:
    if(InDate == null || InDate.length == 0)
        return "";
    In fact, it's always good to add this check to all custom functions you write to prevent unexpected exceptions.
    Regards,
    Alan
    Director of Solutions Engineering and Cast Iron guru.