cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to map Thingworx DATETIME to java Date?

ngarad
5-Regular Member

How to map Thingworx DATETIME to java Date?

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

1 ACCEPTED SOLUTION

Accepted Solutions
ngarad
5-Regular Member
(To:ngarad)

Used org.joda.time.DateTime and issue got resolved.

@ThingworxServiceParameter( name="From_Date", description="From Date", baseType="DATETIME" )  DateTime from_date

View solution in original post

1 REPLY 1
ngarad
5-Regular Member
(To:ngarad)

Used org.joda.time.DateTime and issue got resolved.

@ThingworxServiceParameter( name="From_Date", description="From Date", baseType="DATETIME" )  DateTime from_date

Top Tags