Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » Plain Java Application Constructor Parameter is null(POJO constructor Null Parameter)
Plain Java Application Constructor Parameter is null [message #742621] Thu, 20 October 2011 13:06 Go to next message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
Registered: October 2011
Member
In an Stardust process model, why would my POJO constructor parameter be null.
Re: Plain Java Application Constructor Parameter is null [message #742622 is a reply to message #742621] Thu, 20 October 2011 13:07 Go to previous messageGo to next message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
Registered: October 2011
Member
Did you configure two IN-data-mappings of the same kind. Probably by accident. Are they both configured to inject the structured data into the constructor?
Re: Plain Java Application Constructor Parameter is null [message #742624 is a reply to message #742622] Thu, 20 October 2011 13:08 Go to previous messageGo to next message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
Registered: October 2011
Member
The reason why the constructor parameter is NULL is that the data object has not been initialized in the process. Stardust tries to handle the space for data objects economically and any object that has never been used simply does not exist in the database.
When being consumed (as an IN-mapping, for example) without having been created before (e.g. as an OUT-mapping in a prior activity) then the object simply is NULL. Only primitives like long or boolean are automatically initiated to their defaults by Java.

If you had expected to receive an empty Map in your code, you should simply guard your constructor by checking for NULL and instantiating the Map if needed.
Re: Plain Java Application Constructor Parameter is null [message #742626 is a reply to message #742624] Thu, 20 October 2011 13:09 Go to previous message
Vikram Kodak is currently offline Vikram Kodak
Messages: 57
Registered: October 2011
Member
Yes !!
Thanks.
I made the change and it worked.
Previous Topic:Identifying the slowest non-interactive (automatic) activity instance using SQL
Next Topic:Identify which button click initiated 'complete' method call of backing bean
Goto Forum:
  


Current Time: Wed Jul 23 20:35:30 EDT 2014

Powered by FUDForum. Page generated in 0.01706 seconds