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

parseDate works in service but does not work in subscription

SOLVED
Highlighted
Aquamarine

parseDate works in service but does not work in subscription

The parseDate function works when I run it in a service for testing purposes, but it does not work when I try to use it in a subscription that calls a service that uses the parseDate function.

Please see below:

 

Working example: Converts PST time to JST time

Thingworx - 2020-02-21 - parseDate working.PNG

 

Not working: Service called by subscription

Thingworx - 2020-02-21 - Service called in subscription.PNG

 

Error: "Invalid format"

Thingworx - 2020-02-21 - parseDate invalid format error.PNG

 

For reference:

https://www.ptc.com/en/support/article/CS219448

https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: parseDate works in service but does not work in subscription

I found the error....

 

It seems that I was using "eventData" instead of "eventData.newValue.value" as the input in the subscription....

The subscription is triggered based on DataChange.

View solution in original post

5 REPLIES 5
Highlighted

Re: parseDate works in service but does not work in subscription

It seems to want to 'pass on' time from epoch?

not sure why it works in one and not the other, is there any basetype differences?

Highlighted

Re: parseDate works in service but does not work in subscription

Basetypes of both services:

 

Input: string

Output: TimeStamp

Highlighted

Re: parseDate works in service but does not work in subscription

I found the error....

 

It seems that I was using "eventData" instead of "eventData.newValue.value" as the input in the subscription....

The subscription is triggered based on DataChange.

View solution in original post

Highlighted

Re: parseDate works in service but does not work in subscription

Hi @Willie.

 

Which version of ThingWorx are you running? We tested under 8.5.3 and received an unexpected result.  We'll probably need to open an internal case for this.

 

Regards.

 

--Sharon

Highlighted

Re: parseDate works in service but does not work in subscription

I am using thingworx v8.4.5

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!