Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hi,
I have created Java extension to create a thing template and services.
One of the service extract Date from Thingworx mashup i.e. DATETIME picker and pass it to sql query eg. "select * from db_table where date between from_date and to_date".
So i created the service and defined parameter as
@ThingworxServiceParameter( name="From_Date", description="From Date", baseType="DATETIME" ) Date from_date
But when i run the service from Thingworx composer i get error as "Cannot cast org.joda.time.DateTime to java.lang.Date"
Can anyone help me here to pass date from mashup to java extension? Also how to convert that date to sql query mentioned above?
I found similar case at PTC support but there is no resolution. Date Issue when passing from one service to another service
Thanks,
Nagnath
Solved! Go to Solution.
Used org.joda.time.DateTime and issue got resolved.
@ThingworxServiceParameter( name="From_Date", description="From Date", baseType="DATETIME" ) DateTime from_date
Used org.joda.time.DateTime and issue got resolved.
@ThingworxServiceParameter( name="From_Date", description="From Date", baseType="DATETIME" ) DateTime from_date